Commit 5ccd2ec7 authored by Mikaël Salson's avatar Mikaël Salson

algo/core/{kmerstore.h,germline.cpp,affectanalyser.cpp}: Hack for the xxx germline

See #2596 for the reason why we need to do this.
This should be reverted with #1169
parent a797c16d
Pipeline #35194 failed with stages
in 2 minutes and 6 seconds
...@@ -193,10 +193,16 @@ affect_infos KmerAffectAnalyser::getMaximum(const KmerAffect &before, ...@@ -193,10 +193,16 @@ affect_infos KmerAffectAnalyser::getMaximum(const KmerAffect &before,
results.nb_before_right++; results.nb_before_right++;
} }
left_evalue = kms.getProbabilityAtLeastOrAbove(before, KmerAffect left_affect = before;
KmerAffect right_affect = after;
if (kms.multiple_in_one) {
left_affect = AFFECT_NOT_UNKNOWN;
right_affect = AFFECT_NOT_UNKNOWN;
}
left_evalue = kms.getProbabilityAtLeastOrAbove(left_affect,
results.nb_before_left, results.nb_before_left,
1 + results.last_pos_max); 1 + results.last_pos_max);
right_evalue = kms.getProbabilityAtLeastOrAbove(after, right_evalue = kms.getProbabilityAtLeastOrAbove(right_affect,
results.nb_after_right, results.nb_after_right,
seq.size() - 1 - results.first_pos_max); seq.size() - 1 - results.first_pos_max);
...@@ -220,7 +226,11 @@ affect_infos KmerAffectAnalyser::getMaximum(const KmerAffect &before, ...@@ -220,7 +226,11 @@ affect_infos KmerAffectAnalyser::getMaximum(const KmerAffect &before,
double KmerAffectAnalyser::getProbabilityAtLeastOrAbove(const KmerAffect &kmer, int at_least) const { double KmerAffectAnalyser::getProbabilityAtLeastOrAbove(const KmerAffect &kmer, int at_least) const {
return kms.getProbabilityAtLeastOrAbove(kmer, at_least, seq.size()); KmerAffect affect = kmer;
if (kms.multiple_in_one) {
affect = AFFECT_NOT_UNKNOWN;
}
return kms.getProbabilityAtLeastOrAbove(affect, at_least, seq.size());
} }
pair <double, double> KmerAffectAnalyser::getLeftRightProbabilityAtLeastOrAbove() const { pair <double, double> KmerAffectAnalyser::getLeftRightProbabilityAtLeastOrAbove() const {
......
...@@ -395,6 +395,7 @@ void MultiGermline::build_with_one_index(string seed, bool set_index) ...@@ -395,6 +395,7 @@ void MultiGermline::build_with_one_index(string seed, bool set_index)
index = KmerStoreFactory<KmerAffect>::createIndex(indexType, seed, rc); index = KmerStoreFactory<KmerAffect>::createIndex(indexType, seed, rc);
index->refs = 1; index->refs = 1;
insert_in_one_index(index, set_index); insert_in_one_index(index, set_index);
index->multiple_in_one = true;
} }
void MultiGermline::finish() { void MultiGermline::finish() {
......
...@@ -82,6 +82,7 @@ public: ...@@ -82,6 +82,7 @@ public:
static int last_id; static int last_id;
int id; // id of this index int id; // id of this index
int refs; // number of germlines using this index int refs; // number of germlines using this index
bool multiple_in_one;
list< pair <T, BioReader> > labels; list< pair <T, BioReader> > labels;
...@@ -205,6 +206,7 @@ IKmerStore<T>::IKmerStore() { ...@@ -205,6 +206,7 @@ IKmerStore<T>::IKmerStore() {
id = ++last_id; id = ++last_id;
refs = 0; refs = 0;
finished_building = false; finished_building = false;
multiple_in_one = false;
} }
template<class T> int IKmerStore<T>::last_id = 0; template<class T> int IKmerStore<T>::last_id = 0;
......
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