Skip to main content

spectrum_utils

Build status Python 3.6 Python 3.7

Simple MS/MS spectrum preprocessing and visualization in Python.

Features

  • Spectrum (pre)processing
    • Precursor & noise peak removal
    • Intensity filtering
    • Intensity scaling
    • Modification-aware fragment ion annotating (powered by Pyteomics)
  • Spectrum plotting
    • Single spectrum with annotated ions
    • Mirror plot of matching spectra
    • Interactive spectrum plots

Example

import matplotlib.pyplot as plt

from spectrum_utils import plot
from spectrum_utils import spectrum


# Initialize spectrum information first...

spec = spectrum.MsmsSpectrum(identifier, precursor_mz, precursor_charge,
                             mz, intensity, retention_time=retention_time,
                             peptide=peptide)

# Preprocess the MS/MS spectrum.
fragment_tol_mass = 10
fragment_tol_mode = 'ppm'
spec = (spec.set_mz_range(min_mz=100, max_mz=1400)
            .remove_precursor_peak(fragment_tol_mass, fragment_tol_mode)
            .filter_intensity(min_intensity=0.05, max_num_peaks=150)
            .scale_intensity(scaling='root')
            .annotate_peaks(fragment_tol_mass, fragment_tol_mode,
                            ion_types='aby'))

# Plot the MS/MS spectrum.
plot.spectrum(spec)

plt.show()
plt.close()

(Condensed example. See here for the full code to generate the figure below.)

spectrum_utils

Installation

spectrum_utils can be installed easily via pip:

pip install spectrum_utils

Or via conda:

conda install -c bioconda spectrum_utils

Dependencies

spectrum_utils has the following dependencies:

Missing dependencies will be automatically installed when you install spectrum_utils.

API documentation

You can find the API documentation here.

Contact

For more information you can visit the official code website or send an email to wout.bittremieux@uantwerpen.be.

Metadata

Release files for spectrum-utils 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spectrum-utils 0.2.0
File Size Uploaded Provenance Actions
spectrum_utils-0.2.0.tar.gz 12.4 kB Without provenance Details for spectrum_utils-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spectrum-utils 0.2.0
File Interpreter ABI Platform Actions
spectrum_utils-0.2.0-py3.7.egg Legacy Egg format - - Details for spectrum_utils-0.2.0-py3.7.egg

Total release size: 38.5 kB

Release files / spectrum_utils-0.2.0.tar.gz

Download URL spectrum_utils-0.2.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a60ae818acdbca66d078f6fd5310eece64caeb09f8ac523e97a93f997ebac400
BLAKE2b-256 checksum
How to use checksums
73219b504f7e26e25b585ee5485337df8f763d9771b705077c8f23f35899d521
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.2

Release files / spectrum_utils-0.2.0-py3.7.egg

Download URL spectrum_utils-0.2.0-py3.7.egg
Size 26.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
1f681436ee2d9a312db4f8bc93a961896d9d6bc69ead19341650b27dcce3560d
BLAKE2b-256 checksum
How to use checksums
b916faf9821a675bb12b3042606f3b1a440654c78b5cf10eb43ea13177f6142b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.2

Security for spectrum-utils 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page