rustyms Python bindings
Python bindings to the rustyms library for proteomics and mass spectrometry.
Quickstart
Python bindings are provided to several core components of the rustyms library, including:
Element
Chemical elementsMolecularFormula
Molecular formulasAminoAcid
Amino acidsModification
Amino acid modifications, with support for mass shifts, chemical formulas, Unimod, and PSI-MOD labelsAmbiguousModification
Modification
with ambiguous localization.Fragment
Theoretical fragment ionSequenceElement
One position in a peptide sequence with amino acid and modificationsLinearPeptide
Peptide sequence, modifications, and charge, using ProForma 2.0 (see ProForma support for more information)RawPeak
A single peak in a mass spectrumRawSpectrum
A mass spectrum without any annotationsAnnotatedPeak
A single peak in a mass spectrum with annotationsAnnotatedSpectrum
A mass spectrum with annotations
rustyms
can, for example, annotate a mass spectrum from a
ProForma 2.0 peptidoforms string:
import rustyms
# Create a new spectrum
raw_spectrum = rustyms.RawSpectrum(
title="spectrum_1",
num_scans=6,
rt=10,
precursor_mass=436.12634,
precursor_charge=2,
mz_array=[72.04444, 148.06048, 175.05362, 263.08742, 290.08056, 366.09661],
intensity_array=[100, 600, 300, 400, 500, 200],
)
# Create a new peptide from a ProForma 2.0 string
peptide = rustyms.LinearPeptide("ACDE/2")
# Annotate the spectrum with the peptide
annotated_spectrum = raw_spectrum.annotate(peptide, "cid_hcd")
Installation
Install with pip:
pip install rustyms
Contributing and development
See Contributing for information on the development setup and how to contribute to the rustyms Python bindings.