-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Olgabot/use x if codon not found #529
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? |
sourmash/kmer_min_hash.hh
Outdated
@@ -174,7 +174,14 @@ public: | |||
unsigned int dna_size = (dna.size() / 3) * 3; // floor it | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Just made the change :)
Hi! Why did you choose |
Yep, |
I think this sounds reasonable, any comments @ctb ? |
This adjusts the
_dna_to_aa
code 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 test
Did it pass the tests?make coverage
Is 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?