Simple MS/MS spectrum preprocessing and visualization in Python
Switch branches/tags
Nothing to show
Clone or download
Latest commit 04bad2c Dec 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spectrum_utils Don't set a plot title Dec 5, 2018
.travis.yml Fix Python version for Travis CI Dec 5, 2018
LICENSE.txt Add license Dec 5, 2018
README.md Add README Dec 5, 2018
setup.py Initial commit Dec 5, 2018
spectrum_utils.png Add figure Dec 5, 2018

README.md

spectrum_utils

Build status Python version

Simple MS/MS spectrum preprocessing and visualization in Python.

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()

spectrum_utils