Enum rustyms::modification::Modification
source · pub enum Modification {
Mass(Mass),
Formula(MolecularFormula),
Glycan(Vec<(MonoSaccharide, isize)>),
GlycanStructure(GlycanStructure),
Predefined(MolecularFormula, Vec<PlacementRule>, Ontology, String, usize),
Gno(GnoComposition, String),
}Expand description
A modification on an amino acid
Variants§
Mass(Mass)
A modification defined with a monoisotopic mass shift
Formula(MolecularFormula)
A modification defined with a molecular formula
Glycan(Vec<(MonoSaccharide, isize)>)
A glycan without a defined structure
GlycanStructure(GlycanStructure)
A glycan with a defined structure
Predefined(MolecularFormula, Vec<PlacementRule>, Ontology, String, usize)
A modification from one of the modification ontologies
Gno(GnoComposition, String)
A modification from one of the modification ontologies
Implementations§
source§impl Modification
impl Modification
sourcepub fn try_from(
line: &str,
range: Range<usize>,
lookup: &mut Vec<(Option<String>, Option<Self>)>
) -> Result<ReturnModification, CustomError>
pub fn try_from( line: &str, range: Range<usize>, lookup: &mut Vec<(Option<String>, Option<Self>)> ) -> Result<ReturnModification, CustomError>
Try to parse the modification. Any ambiguous modification will be number according to the lookup (which may be added to if necessary). The result is the modification, with, if applicable, its determined ambiguous group.
Errors
If it is not a valid modification return a CustomError explaining the error.
sourcepub fn sloppy_modification(line: &str, location: Range<usize>) -> Option<Self>
pub fn sloppy_modification(line: &str, location: Range<usize>) -> Option<Self>
Parse a modification defined by sloppy names
sourcepub fn is_possible(
&self,
seq: &SequenceElement,
index: usize,
length: usize
) -> bool
pub fn is_possible( &self, seq: &SequenceElement, index: usize, length: usize ) -> bool
Check to see if this modification can be placed on the specified element
Trait Implementations§
source§impl Chemical for Modification
impl Chemical for Modification
source§fn formula(&self) -> MolecularFormula
fn formula(&self) -> MolecularFormula
Get the molecular formula
source§impl Clone for Modification
impl Clone for Modification
source§fn clone(&self) -> Modification
fn clone(&self) -> Modification
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Modification
impl Debug for Modification
source§impl<'de> Deserialize<'de> for Modification
impl<'de> Deserialize<'de> for Modification
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Modification
impl Display for Modification
source§impl PartialEq for Modification
impl PartialEq for Modification
source§fn eq(&self, other: &Modification) -> bool
fn eq(&self, other: &Modification) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for Modification
impl Serialize for Modification
impl StructuralPartialEq for Modification
Auto Trait Implementations§
impl RefUnwindSafe for Modification
impl Send for Modification
impl Sync for Modification
impl Unpin for Modification
impl UnwindSafe for Modification
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
Mutably borrows from an owned value. Read more
§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.