Olgabot/use x if codon not found#529
Conversation
Codecov Report
@@ Coverage Diff @@
## master #529 +/- ##
==========================================
+ Coverage 90.76% 90.76% +<.01%
==========================================
Files 33 33
Lines 5011 5013 +2
Branches 36 37 +1
==========================================
+ Hits 4548 4550 +2
Misses 463 463
Continue to review full report at Codecov.
|
|
Any updates on this merge? |
| for (unsigned int j = 0; j < dna_size; j += 3) { | ||
| std::string codon = dna.substr(j, 3); | ||
| aa += (_codon_table)[codon]; | ||
| std::map<std::string,std::string>::iterator translated = _codon_table.find(codon); |
There was a problem hiding this comment.
quick comment: you can replace std::map<std::string,std::string>::iterator with auto and avoid having to figure out the proper type (yay C++11)
There was a problem hiding this comment.
Yay! Just made the change :)
|
Hi! Why did you choose |
|
Yep, |
|
I think this sounds reasonable, any comments @ctb ? |
This adjusts the
_dna_to_aacode to fallback on the "X" if the codon was not found. Hopefully addresses #502 becausestd::map::operator[]inserts a new element and returns it, in this case the empty string, and then the protein kmers built on DNA seuqences with "N"s are an incorrect length because they are too short.Can't get sourmash to install via conda on my mac laptop right now so I haven't been able to run the tests.
make testDid it pass the tests?make coverageIs the new code covered?Did it change the command-line interface? Only additions are allowedwithout a major version increment. Changing file formats also requires a
major version number increment.
changes were made?