Skip to main content

Mass spectrometry spectrum processing library.

Project description

spxtacular logo

CI PyPI Python versions Docs License

spxtacular

spxtacular is a Python library for mass spectrometry spectrum processing. It provides a chainable Spectrum API covering the full centroid-to-neutral-mass pipeline: denoising, isotope deconvolution, neutral mass conversion, fragment matching, and PSM scoring — with interactive Plotly visualizations throughout.

Part of the tacular-omics ecosystem alongside peptacular, paftacular, and mzmlpy.

Install

pip install spxtacular

# Optional: Numba JIT acceleration (~3–4× faster deconvolution)
pip install spxtacular[numba]

Quick start

import spxtacular as spx

spec = spx.Spectrum(mz=mz_array, intensity=intensity_array)

# Full pipeline: denoise → deconvolute → filter → neutral mass
neutral = (
    spec
    .denoise(method="mad", snr=3.0)
    .deconvolute(charge_range=(1, 5), tolerance=10, tolerance_type="ppm", min_score=0.4)
    .decharge()
)

neutral.plot(title="Neutral masses").show()

Features

Feature Description
Isotope deconvolution Bhattacharyya-scored greedy algorithm; optional Numba JIT acceleration
Quality filtering min_score, m/z, intensity, charge, and ion mobility filters
Neutral mass conversion decharge() converts charged clusters to neutral masses
Fragment matching match_fragments() with ppm/Da tolerance
PSM scoring Hyperscore, spectral angle, matched fraction, and more
Interactive visualization Stick plots, mirror plots, annotated fragment spectra (Plotly)
File reading Bruker timsTOF .d files (DReader) and mzML (MzmlReader)

Deconvolution pipeline

# 1. Find isotope clusters → assign monoisotopic m/z + charge + Bhattacharyya score
decon = spec.deconvolute(charge_range=(1, 5), tolerance=10, tolerance_type="ppm")

# charge > 0  → assigned cluster
# charge = -1 → singleton / unassigned
# score 0–1   → isotope profile quality (0.0 for singletons)

# 2. Keep only high-confidence clusters
filtered = decon.filter(min_score=0.5)

# 3. Convert to neutral masses (drops singletons)
neutral = filtered.decharge()

Documentation

Full documentation with API reference, guides, and interactive plots is available at tacular-omics.github.io/spxtacular.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spxtacular-0.3.0.tar.gz (94.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spxtacular-0.3.0-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

Details for the file spxtacular-0.3.0.tar.gz.

File metadata

  • Download URL: spxtacular-0.3.0.tar.gz
  • Upload date:
  • Size: 94.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spxtacular-0.3.0.tar.gz
Algorithm Hash digest
SHA256 23944077e1819679af83b480a31c328c3fc30d93e84b09c12772b5bcdd532b68
MD5 69cd98cfa450d0077b4ed4cf327166ea
BLAKE2b-256 d6bf143f698e07d8ded852610eca19931da677e36f630a1f83d74aba0ed3c045

See more details on using hashes here.

File details

Details for the file spxtacular-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: spxtacular-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 48.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spxtacular-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e663864fcc03a2c06f8d269eb1352b2e7ffd51ab87a197a998f1b4e20894c1e
MD5 73aab6841a79faa3e0685541fe2dc352
BLAKE2b-256 8a2717bdd2cb5e10a74e3f0b1af94d36f197b6d671605674a7ac4508cfb8cd9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page