Skip to content

Commit

Permalink
Fixed issue #254
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreybarrick committed Dec 24, 2020
1 parent 36c6a0c commit 9f368df
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Version 0.35.4
* Critical bug fix for crashes during output creation when -j is >1
* Bug fix for incorrect "Plots could not be created" message in HTML pages when -j is >1.
* Bug fix for #254: "Provided translation table #0 does not have 64 codons". This was a rare
case where two SNPs occur in the same codon of a CDS and also overlap a noncoding gene.

Version 0.35.4
* Critical bug fix for crashes during output creation when -j is >1.

Version 0.35.3
* Fixed problem where HTML coverage and alignment files were not produced. (Bug introduced in v0.35.2)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([breseq], [0.35.4], [[email protected]], [breseq], [http://barricklab.org/breseq])
AC_INIT([breseq], [0.35.5], [[email protected]], [breseq], [http://barricklab.org/breseq])
AC_CONFIG_AUX_DIR(aux_build)
AC_CONFIG_MACRO_DIR([aux_build/m4])
AC_CONFIG_HEADERS([aux_build/config.h])
Expand Down
21 changes: 14 additions & 7 deletions src/c/breseq/reference_sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,7 @@ char cReferenceSequences::translate_codon(string seq, uint32_t translation_table
? cReferenceSequences::initiation_codon_translation_tables[translation_table]
: cReferenceSequences::translation_tables[translation_table]
;
ASSERT(tt.size() == 64, "Provided translation table #" + to_string(translation_table) + " does not have 64 codons." + (gene.size()>0 ? " for gene " + gene :"") + ".");
ASSERT(tt.size() == 64, "Provided translation table #" + to_string(translation_table) + " does not have 64 codons" + (gene.size()>0 ? " for gene " + gene :"") + ".");

return (cReferenceSequences::codon_to_aa_index.count(seq) == 0)
? '?'
Expand All @@ -2736,7 +2736,7 @@ char cReferenceSequences::translate_codon(string seq, uint32_t translation_table
char cReferenceSequences::translate_codon(string seq, string translation_table, string translation_table_1, uint32_t codon_number_1, const string& gene)
{
ASSERT(seq.size()==3, "Attempt to translate codon without three bases" + (gene.size()>0 ? " in gene " + gene :"") + ".");
ASSERT(translation_table.size()==64, "Provided translation table #" + to_string(translation_table) + " does not have 64 codons." + (gene.size()>0 ? " for gene " + gene :"") + ".");
ASSERT(translation_table.size()==64, "Provided translation table #" + to_string(translation_table) + " does not have 64 codons" + (gene.size()>0 ? " for gene " + gene :"") + ".");
const string& tt = (codon_number_1 == 1) ? translation_table_1 : translation_table;

return (cReferenceSequences::codon_to_aa_index.count(seq) == 0)
Expand Down Expand Up @@ -3683,12 +3683,19 @@ void cReferenceSequences::annotate_mutations(cGenomeDiff& gd, bool only_muts, bo
vector<string> codon_new_seq_list_j = split((*snp_muts[on_key][j])["codon_new_seq"], multiple_separator);
vector<string> aa_new_seq_list_i = split((*snp_muts[on_key][i])["aa_new_seq"], multiple_separator);
vector<string> aa_new_seq_list_j = split((*snp_muts[on_key][j])["aa_new_seq"], multiple_separator);

codon_new_seq_list_i[ii] = new_codon;
codon_new_seq_list_j[jj] = new_codon;
aa_new_seq_list_i[ii] = translate_codon(new_codon, from_string((*snp_muts[on_key][i])["transl_table"]), from_string((*snp_muts[on_key][i])["aa_position"]));
aa_new_seq_list_j[jj] = translate_codon(new_codon, from_string((*snp_muts[on_key][j])["transl_table"]), from_string((*snp_muts[on_key][j])["aa_position"]));

// If translation table is NA, then we don't translate for that gene!
vector<string> transl_table_list_i = split((*snp_muts[on_key][i])["transl_table"], multiple_separator);
vector<string> transl_table_list_j = split((*snp_muts[on_key][i])["transl_table"], multiple_separator);

if (transl_table_list_i[ii] != "NA") {
codon_new_seq_list_i[ii] = new_codon;
aa_new_seq_list_i[ii] = translate_codon(new_codon, from_string(transl_table_list_i[ii]), from_string((*snp_muts[on_key][i])["aa_position"]));
}
if (transl_table_list_i[jj] != "NA") {
codon_new_seq_list_j[jj] = new_codon;
aa_new_seq_list_j[jj] = translate_codon(new_codon, from_string(transl_table_list_i[jj]), from_string((*snp_muts[on_key][j])["aa_position"]));
}
(*snp_muts[on_key][i])["codon_new_seq"] = join(codon_new_seq_list_i, multiple_separator);
(*snp_muts[on_key][j])["codon_new_seq"] = join(codon_new_seq_list_j, multiple_separator);
(*snp_muts[on_key][i])["aa_new_seq"] = join(aa_new_seq_list_i, multiple_separator);
Expand Down

0 comments on commit 9f368df

Please sign in to comment.