pub enum Modification {
Simple(SimpleModification),
CrossLink {
peptide: usize,
sequence_index: SequencePosition,
linker: SimpleModification,
name: CrossLinkName,
side: CrossLinkSide,
},
Ambiguous {
group: String,
id: usize,
modification: SimpleModification,
localisation_score: Option<OrderedFloat<f64>>,
preferred: bool,
},
}
Expand description
A modification on an amino acid
Variants§
Simple(SimpleModification)
Any of the simple modifications
CrossLink
A cross link to another (or the same) peptide, a branch is also seen as a cross-link but then the name is None.
Fields
peptide: usize
The index of the peptide this cross-link is bound to (can be the index for this peptide if it is an intra link)
sequence_index: SequencePosition
The sequence index where this cross-link is bound to
linker: SimpleModification
The linker that defines the chemical structure that is the actual linker
name: CrossLinkName
The name of the cross-linker, if CrossLinkName::Branch
it is a branch instead of cross-link
side: CrossLinkSide
To determine if the cross-link is placed symmetrically or if asymmetrically if this is the left or right side
Ambiguous
An ambiguous modification, that can be placed at multiple locations
Fields
id: usize
The id to compare be able to find the other locations where this modifications can be placed
modification: SimpleModification
The modification itself
localisation_score: Option<OrderedFloat<f64>>
If present the localisation score, meaning the chance/ratio for this modification to show up on this exact spot
Implementations§
Source§impl Modification
impl Modification
Sourcepub const fn is_cross_link(&self) -> bool
pub const fn is_cross_link(&self) -> bool
Check if this modification is a cross-link.
Sourcepub const fn is_ambiguous(&self) -> bool
pub const fn is_ambiguous(&self) -> bool
Check if this modification is an ambiguous modification.
Sourcepub fn formula(&self) -> MolecularFormula
pub fn formula(&self) -> MolecularFormula
Get the formula for a modification, if it is a cross linked modification only get the cross link
Sourcepub const fn simple(&self) -> Option<&SimpleModification>
pub const fn simple(&self) -> Option<&SimpleModification>
Check if this is a simple modification
Sourcepub fn into_simple(self) -> Option<SimpleModification>
pub fn into_simple(self) -> Option<SimpleModification>
Check if this is a simple modification
Sourcepub fn ontology_url(&self) -> Option<String>
pub fn ontology_url(&self) -> Option<String>
Get a url for more information on this modification. Only defined for modifications from ontologies.
Sourcepub fn is_possible<T>(
&self,
seq: &SequenceElement<T>,
position: SequencePosition,
) -> RulePossible
pub fn is_possible<T>( &self, seq: &SequenceElement<T>, position: SequencePosition, ) -> RulePossible
Check to see if this modification can be placed on the specified element
Source§impl Modification
impl Modification
Sourcepub fn display(
&self,
f: &mut impl Write,
specification_compliant: bool,
display_ambiguous: bool,
) -> Result
pub fn display( &self, f: &mut impl Write, specification_compliant: bool, display_ambiguous: bool, ) -> Result
Display a modification either normalised to the internal representation or as fully valid ProForma
(no glycan structure or custom modifications). display_ambiguous
shows or hides the modification
definition of any ambiguous modifications (eg true results in ‘+1#1’ false in ‘#1’).
§Errors
When the given writer errors.
Source§impl Modification
impl Modification
Sourcepub fn sloppy_modification(
line: &str,
location: Range<usize>,
position: Option<&SequenceElement<SemiAmbiguous>>,
custom_database: Option<&CustomDatabase>,
) -> Result<SimpleModification, CustomError>
pub fn sloppy_modification( line: &str, location: Range<usize>, position: Option<&SequenceElement<SemiAmbiguous>>, custom_database: Option<&CustomDatabase>, ) -> Result<SimpleModification, CustomError>
Parse a modification defined by sloppy names
§Errors
If the name is not in Unimod, PSI-MOD, the custom database, or the predefined list of common trivial names.
Or if this is the case when the modification follows a known structure (eg mod (AAs)
).
Trait Implementations§
Source§impl Clone for Modification
impl Clone for Modification
Source§fn clone(&self) -> Modification
fn clone(&self) -> Modification
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl Display for Modification
impl Display for Modification
Source§impl From<Arc<SimpleModificationInner>> for Modification
impl From<Arc<SimpleModificationInner>> for Modification
Source§fn from(value: SimpleModification) -> Self
fn from(value: SimpleModification) -> Self
Source§impl From<SimpleModificationInner> for Modification
impl From<SimpleModificationInner> for Modification
Source§fn from(value: SimpleModificationInner) -> Self
fn from(value: SimpleModificationInner) -> Self
Source§impl Hash for Modification
impl Hash for Modification
Source§impl Ord for Modification
impl Ord for Modification
Source§fn cmp(&self, other: &Modification) -> Ordering
fn cmp(&self, other: &Modification) -> 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 Modification
impl PartialEq for Modification
Source§impl PartialOrd for Modification
impl PartialOrd for Modification
Source§impl Serialize for Modification
impl Serialize for Modification
impl Eq for Modification
impl StructuralPartialEq for Modification
Auto Trait Implementations§
impl Freeze for Modification
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> HighestOf<T> for T
impl<T> HighestOf<T> for T
Source§type HighestLevel = T
type HighestLevel = T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more