Struct rustyms::LinearPeptide
source · pub struct LinearPeptide {
pub global: Vec<(Element, u16)>,
pub labile: Vec<Modification>,
pub n_term: Option<Modification>,
pub c_term: Option<Modification>,
pub sequence: Vec<SequenceElement>,
pub ambiguous_modifications: Vec<Vec<usize>>,
pub charge_carriers: Option<MolecularCharge>,
}Expand description
A peptide with all data as provided by pro forma. Preferably generated by using the crate::ComplexPeptide::pro_forma function.
Fields§
§global: Vec<(Element, u16)>Global isotope modifications, saved as the element and the species that all occurrence of that element will consist of. Eg (N, 15) will make all occurring nitrogens be isotope 15.
labile: Vec<Modification>Labile modifications, which will not be found in the actual spectrum.
n_term: Option<Modification>N terminal modification
c_term: Option<Modification>C terminal modification
sequence: Vec<SequenceElement>The sequence of this peptide (includes local modifications)
ambiguous_modifications: Vec<Vec<usize>>For each ambiguous modification list all possible positions it can be placed on. Indexed by the ambiguous modification id.
charge_carriers: Option<MolecularCharge>The adduct ions, if specified
Implementations§
source§impl LinearPeptide
impl LinearPeptide
sourcepub fn n_term(&self) -> MolecularFormula
pub fn n_term(&self) -> MolecularFormula
The mass of the N terminal modifications. The global isotope modifications are NOT applied.
sourcepub fn c_term(&self) -> MolecularFormula
pub fn c_term(&self) -> MolecularFormula
The mass of the C terminal modifications. The global isotope modifications are NOT applied.
sourcepub fn formula(&self) -> Option<MolecularFormula>
pub fn formula(&self) -> Option<MolecularFormula>
Gives the formula for the whole peptide. With the global isotope modifications applied.
sourcepub fn bare_formula(&self) -> Option<MolecularFormula>
pub fn bare_formula(&self) -> Option<MolecularFormula>
Gives the formula for the whole peptide with no C and N terminal modifications. With the global isotope modifications applied.
sourcepub fn generate_theoretical_fragments(
&self,
max_charge: Charge,
model: &Model,
peptide_index: usize
) -> Option<Vec<Fragment>>
pub fn generate_theoretical_fragments( &self, max_charge: Charge, model: &Model, peptide_index: usize ) -> Option<Vec<Fragment>>
Generate the theoretical fragments for this peptide, with the given maximal charge of the fragments, and the given model. With the global isotope modifications applied.
Panics
If max_charge outside the range 1..=u64::MAX.
Trait Implementations§
source§impl Clone for LinearPeptide
impl Clone for LinearPeptide
source§fn clone(&self) -> LinearPeptide
fn clone(&self) -> LinearPeptide
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LinearPeptide
impl Debug for LinearPeptide
source§impl Default for LinearPeptide
impl Default for LinearPeptide
source§fn default() -> LinearPeptide
fn default() -> LinearPeptide
source§impl Display for LinearPeptide
impl Display for LinearPeptide
source§impl PartialEq for LinearPeptide
impl PartialEq for LinearPeptide
source§fn eq(&self, other: &LinearPeptide) -> bool
fn eq(&self, other: &LinearPeptide) -> bool
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for LinearPeptide
Auto Trait Implementations§
impl RefUnwindSafe for LinearPeptide
impl Send for LinearPeptide
impl Sync for LinearPeptide
impl Unpin for LinearPeptide
impl UnwindSafe for LinearPeptide
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.