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

core/filter.{h,cpp}: Add pvalue parameter for filter method

This will ease unit testing
parent 30571c97
......@@ -58,7 +58,7 @@ void FilterWithACAutomaton::buildACAutomatonToFilterBioReader(string seed){
based on it.
BioReader FilterWithACAutomaton::filterBioReaderWithACAutomaton(
seqtype &seq, int kmer_threshold){
seqtype &seq, int kmer_threshold, int pvalue){
BioReader result;
map<KmerAffect, int> mapAho;
......@@ -126,7 +126,7 @@ BioReader FilterWithACAutomaton::filterBioReaderWithACAutomaton(
transferBioReaderSequences(originalBioReader, result, element.first);
if (nbKmers == kmer_threshold && nb_kmers_limit == -1) {
int maxlen = getSizeLongestTransferredSequence(result, element.first);
nb_kmers_limit = compute_nb_kmers_limit(element.first.getLength(), element.second, maxlen);
nb_kmers_limit = compute_nb_kmers_limit(element.first.getLength(), element.second, maxlen, pvalue);
if (nb_kmers_limit == 0) {
this->filtered_sequences_nb += originalBioReader.size();
return originalBioReader;
......@@ -22,7 +22,7 @@ class FilterWithACAutomaton {
This function will filter a BioReader
@param idxAho: A pointer to a pair containing an int vector pointer and
an AbstractACAutomaton pointer parametrized by KmerAffect.
......@@ -39,9 +39,11 @@ class FilterWithACAutomaton {
it will filter on the "kmer_threshold" number of K-mers. For
Example if kmer_threshold = 10, it will filter on the 10 most
significant K-mers returned by getMultiResults.
@param pvalue: The pvalue to be used for determining the minimal number of kmers.
This pvalu must actually be given as an integer (90, for .9, 999 for .999…)
BioReader filterBioReaderWithACAutomaton(
seqtype &seq, int kmer_threshold = NO_LIMIT_VALUE);
seqtype &seq, int kmer_threshold = NO_LIMIT_VALUE, int pvalue=999);
This function takes a BioReader as a parameter and returns
a couple containing an int vector pointer and an automaton
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