Commit c411a097 authored by Mikaël Salson's avatar Mikaël Salson

kmeraffect.cpp: Keep the same length as previously

This is an arbitrary choice but when building the final automaton we may
add information from previous states in the current state (so information from
shorter seeds). We prefer to keep the longest one.
parent 1e841705
......@@ -118,18 +118,14 @@ KmerAffect &KmerAffect::operator+=(const KmerAffect &kmer) {
if (kmer.affect != affect) {
if (isUnknown())
*this = kmer;
else if (affect_char(affect) == affect_char(kmer.affect)
&& (affect_strand(affect) != affect_strand(kmer.affect))) {
// Same label but different strand
else {
// If we have same label but different strand
// -> we put ambiguous, we could have something to say that
// strand is ambiguous but not the label, but we don't have enough space
// in 1 byte…
unsigned char length = affect.length;
affect.length = kmer.getLength();
} else {
assert(affect.c != kmer.affect.c || getLength() == kmer.getLength());
affect.length = kmer.getLength();
affect.length = length;
return *this;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment