Commit 8700a50d authored by Mikaël Salson's avatar Mikaël Salson
Browse files

getIndexLoad: Compute it on all the germlines

When the germline by itself didn't insert any kmer but relies
on other germlines (eg. for the XXX germline), we compute the
index load by relying on the index load of the other germlines.

Note that the sum may not accurately reflect the index load
(as there may have common k-mers between the germlines).
parent 0971ce9f
......@@ -19,7 +19,15 @@ void AbstractACAutomaton<Info>::finish_building() {
template<class Info>
float AbstractACAutomaton<Info>::getIndexLoad(Info kmer) const {
float load = kmers_inserted.at(kmer) / pow(4.0, kmer.getLength());
float load = 0;
if (kmers_inserted.count(kmer) == 0) {
for(auto iter: kmers_inserted) {
load += getIndexLoad(iter.first);
}
return load;
} else {
load = kmers_inserted.at(kmer) / pow(4.0, kmer.getLength());
}
return (kmer.isUnknown()) ? 1 - load : load;
}
......
Supports Markdown
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