Commit 272347d0 authored by Mikaël Salson's avatar Mikaël Salson

windowExtractor.{h,cpp}: Stats output is centralised in WindowExtractor.

Following the previous commit, the output is also centralized in the same place.
Therefore MultiGermline::out_stats (by @magiraud) is moved to WindowExtractor::out_stats_germlines.
parent 1c48a2f8
......@@ -236,21 +236,6 @@ void MultiGermline::build_with_one_index(string seed, bool set_index)
insert_in_one_index(index, set_index);
}
void MultiGermline::out_stats(ostream &out)
{
out << " " ;
out << "reads av. len clones av. rds" ;
out << endl ;
for (list<Germline*>::const_iterator it = germlines.begin(); it != germlines.end(); ++it)
{
Germline *germline = *it ;
out << germline->stats_reads ;
out << germline->stats_clones ;
out << endl ;
}
}
/* Mark k-mers common to several germlines as ambiguous */
void MultiGermline::mark_cross_germlines_as_ambiguous()
{
......
......@@ -110,8 +110,6 @@ class MultiGermline {
void build_with_one_index(string seed, bool set_index);
void mark_cross_germlines_as_ambiguous();
void out_stats(ostream &out);
};
ostream &operator<<(ostream &out, const MultiGermline &multigermline);
......
......@@ -172,6 +172,12 @@ void WindowExtractor::init_stats() {
void WindowExtractor::out_stats(ostream &out)
{
out_stats_germlines(out);
out << endl;
out_stats_segmentation(out);
}
void WindowExtractor::out_stats_segmentation(ostream &out) {
for (int i=0; i<STATS_SIZE; i++)
{
// stats[NOT_PROCESSED] should equal to 0
......@@ -184,3 +190,17 @@ void WindowExtractor::out_stats(ostream &out)
out << stats[i] << endl ;
}
}
void WindowExtractor::out_stats_germlines(ostream &out) {
out << " " ;
out << "reads av. len clones av. rds" ;
out << endl ;
for (map<string,BinReadStorage>::iterator it = stats_reads.begin(); it != stats_reads.end(); ++it)
{
stats_reads[it->first].out_average_scores(out);
stats_clones[it->first].out_average_scores(out);
out << endl ;
}
}
......@@ -117,11 +117,21 @@ class WindowExtractor {
void setAffectsOutput(ostream *out);
/**
* Output the segmentation stats
* Output the segmentation and germlines stats
* @param out: The output stream
*/
void out_stats(ostream &out);
/**
* Output segmentation stats
*/
void out_stats_segmentation(ostream &out);
/**
* Output germlines statistics (read lengths per germline,
* and number of reads per clones).
*/
void out_stats_germlines(ostream &out);
private:
/**
* Initialize the statistics (put 0 everywhere).
......
......@@ -1011,11 +1011,6 @@ int main (int argc, char **argv)
stream_segmentation_info << " ! Please check the unsegmentation causes below and refer to the documentation." << endl ;
}
cout << "Build clone stats" << endl;
windowsStorage->fillStatsClones();
multigermline->out_stats(stream_segmentation_info);
stream_segmentation_info << endl;
we.out_stats(stream_segmentation_info);
cout << stream_segmentation_info.str();
......
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