Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grumpy"
version = "1.2.5"
version = "1.2.6"
edition = "2021"
description = "Genetic analysis in Rust."
license-file = "LICENSE"
Expand Down
7 changes: 6 additions & 1 deletion src/gene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,16 @@ impl Gene {
/// # Returns
/// - Amino acid the codon codes for
pub fn codon_to_aa(codon: String) -> char {
if codon.contains("x") {
// Nulls can be parsed from VCF as `x` or
// genbanks can denote `n`
if codon.contains("x") || codon.contains("n") {
return 'X';
}
// Het calls
if codon.contains("z") {
return 'Z';
}
// Real codons
match codon.as_str() {
"ttt" | "ttc" => 'F',
"tta" | "ttg" | "ctt" | "ctc" | "cta" | "ctg" => 'L',
Expand Down Expand Up @@ -782,6 +786,7 @@ pub fn complement_base(base: char) -> char {
// Het and null don't get complements
'z' => 'z',
'x' => 'x',
'n' => 'n',
_ => base,
}
}
Loading