Skip to content
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

Fix bug with reverse complement not being normalized. #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

donovan-h-parks
Copy link

Fixes bug with reverse complement of sequence not being normalized during identification of canonical kmers. This impacts both fixed and scaled sketches, and results in incorrect containment and Jaccard values.

let rc = seq.reverse_complement();
for (_, kmer, is_rev_complement) in
seq.normalize(false).canonical_kmers(self.kmer_length, &rc)
let norm_seq = seq.normalize(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in practice this trait is not well thought. The process function should take a &Sequence since we do not need anything from the &SequenceRecord and normalizing it here implicitly would allocate twice for normalized sequence if you need that elsewhere. In that case you would still need to call normalize before calling process though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants