Commit 0dc21dce authored by Cyprien Borée's avatar Cyprien Borée Committed by Mikaël Salson

Fix filter method in algo/filter.cpp

For more informations see issue #3279
parent 077c61de
Pipeline #28619 passed with stages
in 29 minutes and 11 seconds
......@@ -93,10 +93,12 @@ BioReader filterBioReaderWithACAutomaton(
int nbKmers = 0, previousOccurences = 0;
for(pair<KmerAffect, int> element : setOfWords){
// Add corresponding sequences to the BioReader
if(nbKmers <= kmer_threshold){
nbKmers++;
if(nbKmers == kmer_threshold && previousOccurences == element.second){
nbKmers--;
//Keep the same amount of genes
}else if(nbKmers < kmer_threshold){
nbKmers++;
}else{
break;
}
tmpKmer = element.first;
asciiChar = tmpKmer.getLabel().at(0);
......@@ -108,11 +110,6 @@ BioReader filterBioReaderWithACAutomaton(
result.add(origin.read(i));
}
previousOccurences = element.second;
}
else{
/* Enough K-mers used for filtering, no need to go further */
break;
}
}
}
return (result.size() == 0) ? origin : result;
......
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