Enum rustyms::AminoAcid

source ·
pub enum AminoAcid {
Show 26 variants Alanine = 0, Arginine = 1, Asparagine = 2, AsparticAcid = 3, Cysteine = 4, Glutamine = 5, GlutamicAcid = 6, Glycine = 7, Histidine = 8, Isoleucine = 9, Leucine = 10, Lysine = 11, Methionine = 12, Phenylalanine = 13, Proline = 14, Serine = 15, Threonine = 16, Tryptophan = 17, Tyrosine = 18, Valine = 19, AmbiguousAsparagine = 20, AmbiguousLeucine = 21, AmbiguousGlutamine = 22, Selenocysteine = 23, Pyrrolysine = 24, Unknown = 25,
}
Expand description

An amino acid, alongside the standard ones some ambiguous (B/J/Z/X) and non-standard (U/O) are included.

Variants§

§

Alanine = 0

§

Arginine = 1

§

Asparagine = 2

§

AsparticAcid = 3

§

Cysteine = 4

§

Glutamine = 5

§

GlutamicAcid = 6

§

Glycine = 7

§

Histidine = 8

§

Isoleucine = 9

§

Leucine = 10

§

Lysine = 11

§

Methionine = 12

§

Phenylalanine = 13

§

Proline = 14

§

Serine = 15

§

Threonine = 16

§

Tryptophan = 17

§

Tyrosine = 18

§

Valine = 19

§

AmbiguousAsparagine = 20

§

AmbiguousLeucine = 21

§

AmbiguousGlutamine = 22

§

Selenocysteine = 23

§

Pyrrolysine = 24

§

Unknown = 25

Implementations§

source§

impl AminoAcid

All amino acid property classes according to IMGT.

IMGT standardized criteria for statistical analysis of immunoglobulin V-REGION amino acid properties

Christelle Pommié, Séverine Levadoux, Robert Sabatier, Gérard Lefranc, Marie-Paule Lefranc

https://doi.org/10.1002/jmr.647

Adapted to include J,B,Z,U,O, and X.

source§

impl AminoAcid

source

pub const TOTAL_NUMBER: usize = 26usize

The total number of amino acids

source

pub fn from_dna(dna: &str) -> Result<Option<Self>, NotACodon>

Translate the dna codon into the corresponding amino acid according to the standard DNA codon table. It returns None for a stop codon. https://en.wikipedia.org/wiki/DNA_and_RNA_codon_tables

§Errors

It returns Err(NotACodon) when the given codon is not a valid dna codon.

source§

impl AminoAcid

source

pub const A: Self = Self::Alanine

source

pub const B: Self = Self::AmbiguousAsparagine

source

pub const C: Self = Self::Cysteine

source

pub const D: Self = Self::AsparticAcid

source

pub const E: Self = Self::GlutamicAcid

source

pub const F: Self = Self::Phenylalanine

source

pub const G: Self = Self::Glycine

source

pub const H: Self = Self::Histidine

source

pub const I: Self = Self::Isoleucine

source

pub const J: Self = Self::AmbiguousLeucine

source

pub const K: Self = Self::Lysine

source

pub const L: Self = Self::Leucine

source

pub const M: Self = Self::Methionine

source

pub const N: Self = Self::Asparagine

source

pub const O: Self = Self::Pyrrolysine

source

pub const P: Self = Self::Proline

source

pub const Q: Self = Self::Glutamine

source

pub const R: Self = Self::Arginine

source

pub const S: Self = Self::Serine

source

pub const T: Self = Self::Threonine

source

pub const U: Self = Self::Selenocysteine

source

pub const V: Self = Self::Valine

source

pub const W: Self = Self::Tryptophan

source

pub const X: Self = Self::Unknown

source

pub const Y: Self = Self::Tyrosine

source

pub const Z: Self = Self::AmbiguousGlutamine

source

pub const Ala: Self = Self::Alanine

source

pub const Cys: Self = Self::Cysteine

source

pub const Asn: Self = Self::Asparagine

source

pub const Asp: Self = Self::AsparticAcid

source

pub const Asx: Self = Self::AmbiguousAsparagine

source

pub const Glu: Self = Self::GlutamicAcid

source

pub const Phe: Self = Self::Phenylalanine

source

pub const Gly: Self = Self::Glycine

source

pub const His: Self = Self::Histidine

source

pub const Ile: Self = Self::Isoleucine

source

pub const Xle: Self = Self::AmbiguousLeucine

source

pub const Lys: Self = Self::Lysine

source

pub const Leu: Self = Self::Leucine

source

pub const Met: Self = Self::Methionine

source

pub const Pyl: Self = Self::Pyrrolysine

source

pub const Pro: Self = Self::Proline

source

pub const Gln: Self = Self::Glutamine

source

pub const Glx: Self = Self::AmbiguousGlutamine

source

pub const Arg: Self = Self::Arginine

source

pub const Ser: Self = Self::Serine

source

pub const Thr: Self = Self::Threonine

source

pub const Sec: Self = Self::Selenocysteine

source

pub const Val: Self = Self::Valine

source

pub const Trp: Self = Self::Tryptophan

source

pub const Tyr: Self = Self::Tyrosine

source

pub const Xaa: Self = Self::Unknown

source

pub const UNIQUE_MASS_AMINO_ACIDS: &'static [Self] = _

All amino acids with a unique mass (no I/L in favour of J, no B, no Z, and no X)

source

pub const CANONICAL_AMINO_ACIDS: &'static [Self] = _

All 20 canonical amino acids

source

pub fn satellite_ion_fragments(self) -> Multi<MolecularFormula>

source

pub fn fragments( self, n_term: &[(MolecularFormula, String)], c_term: &[(MolecularFormula, String)], modifications: &MolecularFormula, charge_carriers: &MolecularCharge, sequence_index: usize, sequence_length: usize, ions: &PossibleIons<'_>, peptide_index: usize ) -> Vec<Fragment>

source

pub const fn char(self) -> char

source

pub fn canonical_identical(self, rhs: Self) -> bool

Check if two amino acids are considered identical. X is identical to anything, J to IL, B to ND, Z to EQ.

Trait Implementations§

source§

impl Clone for AminoAcid

source§

fn clone(&self) -> AminoAcid

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AminoAcid

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AminoAcid

source§

fn default() -> AminoAcid

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AminoAcid

source§

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 FromStr for AminoAcid

§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for AminoAcid

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl MultiChemical for AminoAcid

source§

fn formulas(&self) -> Multi<MolecularFormula>

Get all possible formulas for an amino acid (has one for all except B/Z has two for these)

source§

fn charge(&self) -> Option<i16>

Get the charge of this chemical, it returns None if no charge is defined.
source§

impl Ord for AminoAcid

source§

fn cmp(&self, other: &AminoAcid) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for AminoAcid

source§

fn eq(&self, other: &AminoAcid) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for AminoAcid

source§

fn partial_cmp(&self, other: &AminoAcid) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for AminoAcid

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&str> for AminoAcid

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: &str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&u8> for AminoAcid

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: &u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<char> for AminoAcid

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: char) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<u8> for AminoAcid

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for AminoAcid

source§

impl Eq for AminoAcid

source§

impl StructuralPartialEq for AminoAcid

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,