Skip to main content

spectrum_utils

Build status Python 3.6 Python 3.7

Efficient MS/MS spectrum processing and visualization in Python.

Features

  • Spectrum processing
    • Precursor & noise peak removal
    • Intensity filtering
    • Intensity scaling
    • Peak annotations
      • Modification-aware (static & variable) peptide fragments
      • SMILES-based molecules
      • Custom strings
  • Spectrum plotting
    • Fully customizable individual spectrum plots
    • Mirror plot of matching spectra
    • Interactive spectrum plots

Installation

spectrum_utils can easily be installed using 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.

Alternative installation options

The recommended way to install spectrum_utils is using conda. Alternatively spectrum_utils can also be installed using pip:

pip install spectrum_utils

To install the basic spectrum_utils version. Or:

pip install spectrum_utils[iplot]

To include the interactive plotting functionality (requires Pandas and Altair).

When installing using pip it is recommended to explicitly install any dependencies (listed above or in the environment file) in advance. Any missing dependencies will be automatically installed from PyPI when you install spectrum_utils, except RDKit. Please refer to the RDKit installation notes for information on how to install RDKit.

In contrast, when installing spectrum_utils using conda all dependencies will be automatically installed, including RDKit.

Example

import spectrum_utils.plot as sup
import spectrum_utils.spectrum as sus


# Initialize spectrum information first...

spectrum = sus.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'
spectrum = (spectrum.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=50)
            .annotate_peptide_fragments(fragment_tol_mass, fragment_tol_mode,
                                        ion_types='aby'))

# Plot the MS/MS spectrum.
sup.spectrum(spectrum, grid=False)

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.3.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.3.0
File Size Uploaded Provenance Actions
spectrum_utils-0.3.0.tar.gz 17.9 kB Without provenance Details for spectrum_utils-0.3.0.tar.gz

Release files / spectrum_utils-0.3.0.tar.gz

Download URL spectrum_utils-0.3.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2890d728c91aac2503186827f98473134ceb87663c1903d8b5a8e2fcdbd7b7c8
BLAKE2b-256 checksum
How to use checksums
d01b8d39827f642704d64aa5f4d212035a44b00b410733e81f0e9390b5cd7f0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

Security for spectrum-utils 0.3.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