Crate rustyms

source ·
Expand description

rustyms documentation Crates.io

Match those fragments!

A peptide fragmentation matching library for rust.

use rustyms::*;
use rustyms::system::*;
// Parse a peptide
let peptide = ComplexPeptide::pro_forma("VAEINPSNGGTTFNEKFKGGKATJ").unwrap();
// Get the theoretical fragmentation for EThcD
let fragments = peptide.generate_theoretical_fragments(Charge::new::<e>(4.0), &Model::ethcd()).unwrap();
// Load the raw file
let spectra = rawfile::mgf::open("data/annotated_example.mgf").unwrap();
// Annotate the spectrum with this peptide
let matched = spectra[0].annotate(peptide, &fragments, &Model::ethcd(), MassMode::Monoisotopic);

Features

  • Read pro forma sequences (‘level 2-ProForma + mass spectrum compliant + glycans compliant’, with the intention to fully support the whole spec)
  • Generate theoretical fragments with control over the fragmentation model from any supported pro forma peptide
    • Generate fragments from satellite ions (w, d, and v)
    • Generate glycan fragments
    • Generate theoretical fragments for modifications of unknown position
    • Generate theoretical fragments for chimeric spectra
  • Read mgf files
  • Match spectra to the generated fragments
  • Extensive use of uom for compile time unit checking
  • Align peptides based on mass (algorithm will be tweaked extensively over time) (see Stitch for more information, but the algorithm has been improved)

Re-exports

Modules

  • A module to contain all alignment related structures and algorithms.
  • Contain the definition for errors with all additional data that is needed to generate nice error messages
  • Handle fragment related issues, access provided if you want to dive deeply into fragments in your own code.
  • Handle glycan related issues, access provided if you want to work with glycans on your own.
  • Read in the annotations from peptide identification sources
  • Handle model instantiation.
  • Handle modification related issues, access provided if you want to dive deeply into modifications in your own code.
  • Handling raw files
  • Spectrum related code
  • The measurement system used in this crate. A redefinition of the important SI units for them to be stored in a more sensible base unit for MS purposes.

Macros

Structs

Enums

Constants

  • All elements sorted so that single characters come after two character element symbols (needed for greedy parsing)

Traits

  • Any item that has a clearly defined molecular formula

Functions

  • Get the elemental data
  • Find the isobaric sets for the given mass with the given modifications and ppm error. The modifications are placed on any location they are allowed based on the given placement rules, so using any modifications which provide those is advised.