From 177cf754f729b638cbf8f0b9ff1d6795bc79b364 Mon Sep 17 00:00:00 2001 From: Trent Hauck Date: Wed, 4 Aug 2021 20:27:28 -0700 Subject: [PATCH] feat: adds iupac amino acid alpha --- 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")); + } }