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.1

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.1
File Size Uploaded Provenance Actions
spectrum_utils-0.2.1.tar.gz 12.5 kB Without provenance Details for spectrum_utils-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 38.5 kB

Release files / spectrum_utils-0.2.1.tar.gz

Download URL spectrum_utils-0.2.1.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
23b3e2b19583f1fec9180347a20096ffcce72d89c3ec000f78f20ccb434789f1
BLAKE2b-256 checksum
How to use checksums
bff41d062da3644d56973bfe5a9ad2fbce61d9aec54045806f83926f02ad18c6
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.1-py3.7.egg

Download URL spectrum_utils-0.2.1-py3.7.egg
Size 26.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
d074b47fad8a2cb1f7ce67873b4d0bacca678b5012533ca810dc59b36a1895b5
BLAKE2b-256 checksum
How to use checksums
7b87108c432a36d08782f5402214ca4bab60bd72839ab1f745ee953a99dd95d0
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.1

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