Amino

Enum Amino 

Source
#[repr(u8)]
pub enum Amino {
Show 23 variants Stop = 42, A = 65, C = 67, D = 68, E = 69, F = 70, G = 71, H = 72, I = 73, K = 75, L = 76, M = 77, N = 78, O = 79, P = 80, Q = 81, R = 82, S = 83, T = 84, U = 85, V = 86, W = 87, Y = 89,
}
Expand description

Amino acid

For details, see: https://en.wikipedia.org/wiki/FASTA_format#Sequence_representation

Aminos are ordered by the value of their ASCII representation.

Variants§

§

Stop = 42

Translation stop

§

A = 65

Alanine

§

C = 67

Cysteine

§

D = 68

Aspartic acid

§

E = 69

Glutamic acid

§

F = 70

Phenylalanine

§

G = 71

Glycine

§

H = 72

Histidine

§

I = 73

Isoleucine

§

K = 75

Lysine

§

L = 76

Leucine

§

M = 77

Methionine

§

N = 78

Asparagine

§

O = 79

Pyrrolysine

§

P = 80

Proline,

§

Q = 81

Glutamine

§

R = 82

Arginine

§

S = 83

Serine

§

T = 84

Threonine

§

U = 85

Selenocysteine

§

V = 86

Valine

§

W = 87

Tryptophan

§

Y = 89

Tyrosine

Implementations§

Source§

impl Amino

Source

pub const ALL: [Self; 23]

All Aminos sorted in ascending order

Source

pub fn to_str(self) -> &'static str

Return uppercase string representation

§Examples
use nucs::Amino;

assert_eq!(Amino::A.to_str(), "A");
assert_eq!(Amino::Stop.to_str(), "*");
Source

pub const fn from_ascii(ascii: u8) -> Result<Self, ParseSymbolError>

Construct from ASCII representation

§Errors

Returns ParseSymbolError if the given byte isn’t A, C, D, E, F, G, H, I, K, L, M, N, O, P, Q, R, S, T, U, V, W, Y or * (case-insensitive).

§Examples
use nucs::Amino;

assert_eq!(Amino::from_ascii(b'A'), Ok(Amino::A));
assert_eq!(Amino::from_ascii(b'*'), Ok(Amino::Stop));
assert!(Amino::from_ascii(b'B').is_err());
Source

pub fn to_ascii(self) -> u8

Return uppercase ASCII representation

§Examples
use nucs::Amino;

assert_eq!(Amino::A.to_ascii(), b'A');
assert_eq!(Amino::Stop.to_ascii(), b'*');
Source

pub const fn lit<const N: usize>(literal: &[u8; N]) -> [Amino; N]

Construct Amino array from literal without allocating.

§Examples
use nucs::Amino;

let aas1 = Amino::lit(b"ACME*WIDGETS");
// ...is shorthand for...
use Amino::{A, C, M, E, Stop, W, I, D, G, T, S};
let aas2 = [A, C, M, E, Stop, W, I, D, G, E, T, S];

assert_eq!(aas1, aas2);
§Panics

This panics if the supplied literal isn’t valid. Whitespace is NOT allowed because the returned array must have the same length.

Trait Implementations§

Source§

impl AsMut<Amino> for Amino

Source§

fn as_mut(&mut self) -> &mut Amino

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<Amino> for Amino

Source§

fn as_ref(&self) -> &Amino

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl BitOr<&AmbiAmino> for &Amino

Source§

type Output = AmbiAmino

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &AmbiAmino) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<&Amino> for &AmbiAmino

Source§

type Output = AmbiAmino

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Amino) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<AmbiAmino> for Amino

Source§

type Output = AmbiAmino

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: AmbiAmino) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<Amino> for AmbiAmino

Source§

type Output = AmbiAmino

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Amino) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for &Amino

Source§

type Output = AmbiAmino

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Amino) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for Amino

Source§

type Output = AmbiAmino

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Amino) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign<&Amino> for AmbiAmino

Source§

fn bitor_assign(&mut self, rhs: &Amino)

Performs the |= operation. Read more
Source§

impl BitOrAssign<Amino> for AmbiAmino

Source§

fn bitor_assign(&mut self, rhs: Amino)

Performs the |= operation. Read more
Source§

impl Clone for Amino

Source§

fn clone(&self) -> Amino

Returns a duplicate 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 Amino

Source§

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

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

impl Display for Amino

Source§

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

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

impl From<Amino> for AmbiAmino

Source§

fn from(amino: Amino) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Amino

Source§

type Err = ParseSymbolError

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 Amino

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 Ord for Amino

Source§

fn cmp(&self, other: &Amino) -> 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,

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

impl PartialEq<AmbiAmino> for Amino

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<Amino> for AmbiAmino

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for Amino

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd<AmbiAmino> for Amino

Source§

fn partial_cmp(&self, other: &AmbiAmino) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<Amino> for AmbiAmino

Source§

fn partial_cmp(&self, other: &Amino) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd for Amino

Source§

fn partial_cmp(&self, other: &Amino) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Symbol for Amino

Source§

type Concrete = Amino

Concrete symbols, i.e. Nuc or Amino
Source§

type Ambiguous = AmbiAmino

Ambiguous symbols, i.e. AmbiNuc or AmbiAmino
Source§

fn to_str(self) -> &'static str

Return uppercase string representation
Source§

fn from_ascii(ascii: u8) -> Result<Self, ParseSymbolError>

Construct from (case-insensitive) ASCII representation Read more
Source§

fn to_ascii(self) -> u8

Return uppercase ASCII representation
Source§

fn lit<const N: usize>(literal: &[u8; N]) -> [Self; N]

Construct array from literal without allocating. Read more
Source§

impl TryFrom<AmbiAmino> for Amino

Source§

type Error = AmbiAmino

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

fn try_from(amino: AmbiAmino) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Amino

Source§

impl Eq for Amino

Source§

impl StructuralPartialEq for Amino

Auto Trait Implementations§

§

impl Freeze for Amino

§

impl RefUnwindSafe for Amino

§

impl Send for Amino

§

impl Sync for Amino

§

impl Unpin for Amino

§

impl UnwindSafe for Amino

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.