Commit a6edb097 authored by Mathieu Giraud's avatar Mathieu Giraud

windows.{h,cpp}: getRepresentativeComputer() returns a KmerRepresentativeComputer

This should be directly moved into some KmerRepresentativeComputer() constructor.
parent d674c2ba
......@@ -57,7 +57,7 @@ list<Sequence> WindowsStorage::getReads(junction window) {
return seqs_by_window[window].getReads();
}
Sequence WindowsStorage::getRepresentative(junction window,
KmerRepresentativeComputer WindowsStorage::getRepresentativeComputer(junction window,
string seed, size_t min_cover,
float percent_cover,
size_t nb_sampled,
......@@ -79,7 +79,7 @@ Sequence WindowsStorage::getRepresentative(junction window,
if (!repComp.hasRepresentative())
throw invalid_argument("No representative for junction " + window);
return repComp.getRepresentative();
return repComp;
}
list<Sequence> WindowsStorage::getSample(junction window, size_t nb_sampled,
......
......@@ -20,6 +20,7 @@
#include "germline.h"
#include "read_storage.h"
#include "read_score.h"
#include "representative.h"
#define NB_BINS 15
#define MAX_VALUE_BINS 500
......@@ -84,10 +85,10 @@ class WindowsStorage {
* algorithm.
* @param nb_buckets: Number of buckets for sampling (see SequenceSampler)
* @pre nb_sampled <= getMaximalNbReadsPerWindow() if hasLimitForReadsPerWindow()
* @return the representative sequence of a window or NULL_SEQUENCE if we
* cannot find any representative
* @return the representative computer
*/
Sequence getRepresentative(junction window, string seed, size_t min_cover,
KmerRepresentativeComputer getRepresentativeComputer(junction window, string seed, size_t min_cover,
float percent_cover, size_t nb_sampled,
size_t nb_buckets=HISTOGRAM_SIZE_AUDITIONED);
......
......@@ -1162,12 +1162,14 @@ int main (int argc, char **argv)
cout << auditioned.size() << " auditioned sequences, avg length " << total_length / auditioned.size() << endl ;
}
Sequence representative
= windowsStorage->getRepresentative(it->first, seed,
KmerRepresentativeComputer repComp
= windowsStorage->getRepresentativeComputer(it->first, seed,
min_cover_representative,
ratio_representative,
max_auditionned);
Sequence representative = repComp.getRepresentative();
// Store the representative and its label
representatives.push_back(representative);
representatives_labels.push_back(string_of_int(num_clone));
......
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