Expand description
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
uomfor compile time unit checking - Align peptides based on mass (algorithm will be tweaked extensively over time) (see
Stitchfor more information, but the algorithm has been improved)
Re-exports
pub use crate::model::Model;pub use crate::modification::Modification;pub use crate::spectrum::AnnotatedSpectrum;pub use crate::spectrum::MassMode;pub use crate::spectrum::RawSpectrum;pub use fragment::Fragment;
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
- Macro to implement
quantitytype aliases for a specific system of units and value storage type. - Internal code for the
molecular_formulamacro. - Easily define molecular formulas using the following syntax:
<element> <num>or(<isotope>)<element> <num>
Structs
- A peptide with all data as provided by pro forma. Preferably generated by using the
crate::ComplexPeptide::pro_formafunction. - A molecular formula, a selection of elements of specified isotopes together forming a structure
- One block in a sequence meaning an aminoacid and its accompanying modifications
Enums
- An amino acid, alongside the standard ones some ambiguous (J/X) and non-standard (U/O) are included. https://www.insdc.org/submitting-standards/feature-table/#7.4.3
- A single pro forma entry, can contain multiple peptides
- The elements (and electrons)
- A tolerance around a given mass for searching purposes
- All possible neutral losses
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.