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: AminoAcidThe 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 formula(&self, selected_ambiguous: &[usize]) -> Option<MolecularFormula>
pub fn formula(&self, selected_ambiguous: &[usize]) -> Option<MolecularFormula>
Get the molecular formula for this position (unless it is B/Z) with the selected ambiguous modifications, without any global isotype modifications
sourcepub fn formula_greedy(&self, placed: &mut [bool]) -> Option<MolecularFormula>
pub fn formula_greedy(&self, placed: &mut [bool]) -> Option<MolecularFormula>
Get the molecular formula for this position (unless it is B/Z) with the ambiguous modifications placed on the very first placed (and updating this in placed), without any global isotype modifications
sourcepub fn formula_all(&self) -> Option<MolecularFormula>
pub fn formula_all(&self) -> Option<MolecularFormula>
Get the molecular formula for this position (unless it is B/Z) with all ambiguous modifications, without any global isotype modifications
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 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 ==.impl StructuralPartialEq for SequenceElement
Auto Trait Implementations§
impl RefUnwindSafe for SequenceElement
impl Send for SequenceElement
impl Sync for SequenceElement
impl Unpin for SequenceElement
impl UnwindSafe for SequenceElement
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.