Mass spectrometry utility functions
Project description
spectrum_utils
Simple MS/MS spectrum preprocessing and visualization in Python.
Features
- Spectrum (pre)processing
- Precursor & noise peak removal
- Intensity filtering
- Intensity scaling
- Fragment ion annotating (powered by Pyteomics)
- Spectrum plotting
- Single spectrum with annotated ions
- Mirror plot of matching spectra
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.)
Installation
spectrum_utils
can be installed easily via pip:
pip install 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
spectrum_utils-0.1.0.tar.gz
(10.9 kB
view hashes)
Built Distributions
spectrum_utils-0.1.0-py3.7.egg
(20.2 kB
view hashes)
spectrum_utils-0.1.0-py3.6.egg
(20.2 kB
view hashes)
Close
Hashes for spectrum_utils-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 902610fb58c347e2cc4c5c9efe0e9996949df8169496abb0a5a738721cd019b6 |
|
MD5 | d76d6f1024be7af1a7492fe195aa41ea |
|
BLAKE2b-256 | b2416846efe8156447d32e65025bb41ea8912baf3c6b8386c4a4e264e1629e30 |