Commit 50c398fa authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

core/germline.cpp: extract and bikeshed out_index_seed() from &operator<<(..., germline)

see #4665
parent 999344d5
...@@ -230,23 +230,31 @@ Germline::~Germline() ...@@ -230,23 +230,31 @@ Germline::~Germline()
} }
} }
void out_index_seed(ostream &out,
const Germline &germline,
string seed_x,
string affect_x)
{
size_t seed_x_span = seed_x.size();
out << " " << fixed << setprecision(3) << setw(5)
<< 100 * germline.index->getIndexLoad(KmerAffect(affect_x, 1, seed_x_span)) << "%"
<< " l" << left << setw(2) << seed_x.length()
<< " k" << left << setw(2) << seed_weight(seed_x)
<< " " << left << setw(15) << seed_x ;
}
ostream &operator<<(ostream &out, const Germline &germline) ostream &operator<<(ostream &out, const Germline &germline)
{ {
out << setw(5) << left << germline.code << right << " '" << germline.shortcut << "' " out << setw(5) << left << germline.code << right << " '" << germline.shortcut << "' "
<< " "; << " ";
size_t seed_5_span = germline.seed_5.size();
size_t seed_5_w = seed_weight(germline.seed_5);
size_t seed_3_span = germline.seed_3.size();
size_t seed_3_w = seed_weight(germline.seed_3);
if (germline.index) { if (germline.index) {
out << " 0x" << hex << setw(2) << setfill('0') << germline.index->id << dec << setfill(' ') << " " ; out << " 0x" << hex << setw(2) << setfill('0') << germline.index->id << dec << setfill(' ') << " " ;
out << fixed << setprecision(3) << setw(8)
<< 100 * germline.index->getIndexLoad(KmerAffect(germline.affect_5, 1, seed_5_span)) << "%" << " " out_index_seed(out, germline, germline.seed_5, germline.affect_5);
<< 100 * germline.index->getIndexLoad(KmerAffect(germline.affect_3, 1, seed_3_span)) << "%"; out_index_seed(out, germline, germline.seed_3, germline.affect_3);
out << " l" << germline.seed_5.length() << " k" << seed_5_w << " " << germline.seed_5 ;
out << " l" << germline.seed_3.length() << " k" << seed_3_w << " " << germline.seed_3 ;
} }
out << endl; out << endl;
......
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