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.2.0.tar.gz (83.7 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.2.0-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spxtacular-0.2.0.tar.gz
Algorithm Hash digest
SHA256 58317c70ef1e60935550046596655a77ba4d6e21f1cee934329322cd88bccf34
MD5 28d3e677bef322c95c07319edcc6ba8a
BLAKE2b-256 897a80076f164c32cc0a1a67352c1e0d9532a2531e93c20756e736e11e822d83

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for spxtacular-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9601563221874e231914e3c61756ab15a7d5fd0a41a648206616f17a611193
MD5 881eb2751f6a9cdf2157093252caf070
BLAKE2b-256 16ed2b82725fa2a38762360330541f1fe6a4d0f37681664b7959382a165b8e4e

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