From f4b7a7c23aa7e165718c77e91f62f60fc431ba2c Mon Sep 17 00:00:00 2001 From: Trent Hauck Date: Tue, 21 Sep 2021 04:39:22 -0700 Subject: [PATCH] feat: adds iupac amino acid alpha (#444) --- src/alphabets/protein.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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")); + } }