diff --git a/src/alphabets/protein.rs b/src/alphabets/protein.rs index 5bb72c8960..dd7311b389 100644 --- a/src/alphabets/protein.rs +++ b/src/alphabets/protein.rs @@ -21,6 +21,11 @@ pub fn alphabet() -> Alphabet { Alphabet::new(&b"ARNDCEQGHILKMFPSTWYVarndceqghilkmfpstwyv"[..]) } +/// Returns the IUPAC amino acid alphabet. +pub fn iupac_alphabet() -> Alphabet { + Alphabet::new(b"ABCDEFGHIKLMNPQRSTVWXYZabcdefghiklmnpqrstvwxyz") +} + #[cfg(test)] mod tests { use super::*; @@ -44,4 +49,9 @@ mod tests { fn number_is_no_word() { assert!(!alphabet().is_word(b"42")); } + + #[test] + fn iupac_contains_iupac_chars() { + assert!(iupac_alphabet().is_word(b"XMN")); + } }