Struct rustyms::SequenceElement
source · pub struct SequenceElement {
pub aminoacid: AminoAcid,
pub modifications: Vec<Modification>,
pub possible_modifications: Vec<AmbiguousModification>,
pub ambiguous: Option<usize>,
}
Expand description
One block in a sequence meaning an aminoacid and its accompanying modifications
Fields§
§aminoacid: AminoAcid
The aminoacid
modifications: Vec<Modification>
All present modifications
possible_modifications: Vec<AmbiguousModification>
All ambiguous modifications (could be placed here or on another position)
ambiguous: Option<usize>
If this aminoacid is part of an ambiguous sequence group (QA)?
in pro forma
Implementations§
source§impl SequenceElement
impl SequenceElement
sourcepub const fn new(aminoacid: AminoAcid, ambiguous: Option<usize>) -> Self
pub const fn new(aminoacid: AminoAcid, ambiguous: Option<usize>) -> Self
Create a new aminoacid without any modifications
sourcepub fn formulas(&self, selected_ambiguous: &[usize]) -> Multi<MolecularFormula>
pub fn formulas(&self, selected_ambiguous: &[usize]) -> Multi<MolecularFormula>
Get the molecular formulas for this position with the selected ambiguous modifications, without any global isotype modifications
sourcepub fn formulas_greedy(&self, placed: &mut [bool]) -> Multi<MolecularFormula>
pub fn formulas_greedy(&self, placed: &mut [bool]) -> Multi<MolecularFormula>
Get the molecular formulas for this position with the ambiguous modifications placed on the very first placed (and updating this in placed
), without any global isotype modifications
sourcepub fn formulas_all(&self) -> Multi<MolecularFormula>
pub fn formulas_all(&self) -> Multi<MolecularFormula>
Get the molecular formulas for this position with all ambiguous modifications, without any global isotype modifications
sourcepub fn formulas_all_options(&self) -> Multi<MolecularFormula>
pub fn formulas_all_options(&self) -> Multi<MolecularFormula>
Get the molecular formulas for this position, with all formulas for the amino acids combined with all options for the modifications. If you have 2 options for amino acid mass (B or Z) and 2 ambiguous modifications that gives you 8 total options for the mass. (2 AA * 2 amb1 * 2 amb2)
Trait Implementations§
source§impl Clone for SequenceElement
impl Clone for SequenceElement
source§fn clone(&self) -> SequenceElement
fn clone(&self) -> SequenceElement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SequenceElement
impl Debug for SequenceElement
source§impl<'de> Deserialize<'de> for SequenceElement
impl<'de> Deserialize<'de> for SequenceElement
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<T> From<T> for SequenceElement
impl<T> From<T> for SequenceElement
source§impl Hash for SequenceElement
impl Hash for SequenceElement
source§impl Ord for SequenceElement
impl Ord for SequenceElement
source§fn cmp(&self, other: &SequenceElement) -> Ordering
fn cmp(&self, other: &SequenceElement) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for SequenceElement
impl PartialEq for SequenceElement
source§fn eq(&self, other: &SequenceElement) -> bool
fn eq(&self, other: &SequenceElement) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SequenceElement
impl PartialOrd for SequenceElement
source§fn partial_cmp(&self, other: &SequenceElement) -> Option<Ordering>
fn partial_cmp(&self, other: &SequenceElement) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more