Commit eb803cd1 authored by Mathieu Giraud's avatar Mathieu Giraud

core/windows.{h,cpp}: WindowsStorage::fillStatsClones()

We store in the 'clone_stats' member of germlines the statistics related to clones
(number of clones, number of reads per clone).
parent 917b35d1
......@@ -114,6 +114,20 @@ void WindowsStorage::add(junction window, Sequence sequence, int status, Germlin
germline_by_window[window] = germline;
}
void WindowsStorage::fillStatsClones()
{
for (map <junction, list<Sequence> >::iterator it = seqs_by_window.begin();
it != seqs_by_window.end();
it++)
{
junction junc = it->first;
int nb_reads = it->second.size();
Germline *germline = germline_by_window[junc];
germline->stats_clones.insert(nb_reads);
}
}
pair <int, int> WindowsStorage::keepInterestingWindows(size_t min_reads_window) {
int removes = 0 ;
int nb_reads = 0 ;
......
......@@ -75,6 +75,13 @@ class WindowsStorage {
list<Sequence> getSample(junction window, size_t nb_sampled,
size_t nb_buckets=HISTOGRAM_SIZE_AUDITIONED);
/*
* Fill the stats_clone member of the different Germlines
*/
void fillStatsClones();
/**
* @return a list of windows together with the number of reads they appear in.
* @pre sort() must have been called at least once and must have been called
......
......@@ -897,6 +897,9 @@ int main (int argc, char **argv)
stream_segmentation_info << " ! If this is unexpected, check the germline (-G) and try to change seed parameters (-k)." << endl ;
}
cout << "Build clone stats" << endl;
windowsStorage->fillStatsClones();
stream_segmentation_info << " # av. length" << endl ;
multigermline->out_stats(stream_segmentation_info);
......
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