Skip to content

Commit

Permalink
feat: adds iupac amino acid alpha (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
tshauck committed Sep 21, 2021
1 parent c038f94 commit f4b7a7c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/alphabets/protein.rs
Expand Up @@ -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::*;
Expand All @@ -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"));
}
}

0 comments on commit f4b7a7c

Please sign in to comment.