#[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
impl Amino
Sourcepub fn to_str(self) -> &'static str
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(), "*");Sourcepub const fn from_ascii(ascii: u8) -> Result<Self, ParseSymbolError>
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());Sourcepub fn to_ascii(self) -> u8
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'*');Sourcepub const fn lit<const N: usize>(literal: &[u8; N]) -> [Amino; N]
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 BitOrAssign<&Amino> for AmbiAmino
impl BitOrAssign<&Amino> for AmbiAmino
Source§fn bitor_assign(&mut self, rhs: &Amino)
fn bitor_assign(&mut self, rhs: &Amino)
|= operation. Read moreSource§impl BitOrAssign<Amino> for AmbiAmino
impl BitOrAssign<Amino> for AmbiAmino
Source§fn bitor_assign(&mut self, rhs: Amino)
fn bitor_assign(&mut self, rhs: Amino)
|= operation. Read more