Commit f2a71a4b authored by Cyprien Borée's avatar Cyprien Borée

add operator<< in filter class and update vidjil.cpp

Since we display the filter's informations in the main, it makes more sense
that this class has its own display method.

For more informations see #3259.
parent a951046f
Pipeline #31572 passed with stages
in 52 minutes and 32 seconds
......@@ -126,3 +126,15 @@ vector<int>* FilterWithACAutomaton::getIndexes() const{
AbstractACAutomaton<KmerAffect>* FilterWithACAutomaton::getAutomaton() const{
return this->automaton;
}
ostream &operator<<(ostream &out, const FilterWithACAutomaton& obj){
int origin_bioreader_size = obj.originalBioReader.size();
int total_sequences_filtered = obj.filtered_sequences_nb;
int total_filtered_calls = obj.filtered_sequences_calls;
int total_sequences_origin = total_filtered_calls * origin_bioreader_size;
float aligned_rate = ((float)total_sequences_filtered/(float)total_sequences_origin) * 100;
out << "aligned\t" << total_sequences_filtered;
out << "/" << total_sequences_origin << " (" << aligned_rate << "%)";
out << endl;
return out;
}
......@@ -112,5 +112,7 @@ class FilterWithACAutomaton {
* about how the label is used, see buildACAutomatonToFilterBioReader's doc.
*/
void transferBioReaderSequences(const BioReader &src, BioReader &dst, const KmerAffect k) const;
friend ostream &operator<<(ostream&, const FilterWithACAutomaton&);
};
#endif
......@@ -1626,14 +1626,9 @@ int main (int argc, char **argv)
cout << "FineSegmenter:" << endl;
for(list<Germline*>::const_iterator it = multigermline->germlines.begin(); it != multigermline->germlines.end(); ++it){
FilterWithACAutomaton *f = (*it)->getFilter_5();
int original_bioreader_size = (*it)->rep_5.size();
int total_sequences_filtered = (f) ? f->filtered_sequences_nb : 0;
int total_filtered_calls = (f) ? f->filtered_sequences_calls : 0;
int total_sequences_original = total_filtered_calls * original_bioreader_size;
float aligned_rate = ((float)total_sequences_filtered/(float)total_sequences_original) * 100;
cout << '\t'<< (*it)->code << "\taligned\t" << total_sequences_filtered;
cout << "/" << total_sequences_original << " (" << aligned_rate << "%)";
cout << endl;
if(f){
cout << "\t" << (*it)->code << "\t" << *f;
}
}
}
......
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