summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2022-12-12 10:06:30 -0500
committerBrian Cully <bjc@kublai.com>2022-12-12 10:06:30 -0500
commita0b19de6a07da91037787bac900453693147e0e4 (patch)
tree60820e12c593ed5a948833be3a72ca7b8e66468a
parentc0c8775cb79412d515d43c7f1dc0db95b7f795a9 (diff)
downloadfav-a0b19de6a07da91037787bac900453693147e0e4.tar.gz
fav-a0b19de6a07da91037787bac900453693147e0e4.zip
crash out early if codon lookup fails
-rwxr-xr-xvarscan2codon.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/varscan2codon.pl b/varscan2codon.pl
index 8cd36c6..71d880f 100755
--- a/varscan2codon.pl
+++ b/varscan2codon.pl
@@ -61,6 +61,8 @@ while (<$variants>) {
}
my $codon = substr $genome, $start+$protein_start, 3;
+ die "$. - couldn't find amino acid for codon '$codon'\n" unless ($codon2aa{$codon});
+
my $orig_aa = $aa2letter{$codon2aa{$codon}};
substr $codon, $offset, 1, $new_nt;
my $new_aa = $aa2letter{$codon2aa{$codon}};