Skip to content

Commit 4c823e9

Browse files
authored
Merge pull request #42 from thomaskf/bugfix
The models added by --madd cannot be skipped.
2 parents a60b61b + 0fb7db0 commit 4c823e9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

main/phylotesting.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ int CandidateModelSet::generate(Params &params, Alignment *aln, bool separate_ra
16551655
StrVector extra_model_names;
16561656
convert_string_vec(params.model_extra_set, extra_model_names);
16571657
for (auto s : extra_model_names)
1658-
push_back(CandidateModel(s, "", aln));
1658+
push_back(CandidateModel(s, "", aln, MF_CANNOT_BE_IGNORED));
16591659
}
16601660
return max_cats;
16611661
}
@@ -2832,7 +2832,7 @@ void CandidateModelSet::filterRates(int finished_model) {
28322832
ok_rates.insert(rate_name);
28332833
}
28342834
for (model = finished_model+1; model < size(); model++)
2835-
if (ok_rates.find(at(model).orig_rate_name) == ok_rates.end())
2835+
if (ok_rates.find(at(model).orig_rate_name) == ok_rates.end() && !at(model).hasFlag(MF_CANNOT_BE_IGNORED))
28362836
at(model).setFlag(MF_IGNORED);
28372837
}
28382838

@@ -2854,11 +2854,11 @@ void CandidateModelSet::filterSubst(int finished_model) {
28542854
if (at(model).getScore() <= ok_score) {
28552855
string subst_name = at(model).orig_subst_name;
28562856
ok_model.insert(subst_name);
2857-
} else
2857+
} else if (!at(model).hasFlag(MF_CANNOT_BE_IGNORED))
28582858
at(model).setFlag(MF_IGNORED);
28592859
}
28602860
for (model = finished_model+1; model < size(); model++)
2861-
if (ok_model.find(at(model).orig_subst_name) == ok_model.end())
2861+
if (ok_model.find(at(model).orig_subst_name) == ok_model.end() && !at(model).hasFlag(MF_CANNOT_BE_IGNORED))
28622862
at(model).setFlag(MF_IGNORED);
28632863
}
28642864

main/phylotesting.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const int MF_IGNORED = 2;
3131
const int MF_RUNNING = 4;
3232
const int MF_WAITING = 8;
3333
const int MF_DONE = 16;
34+
const int MF_CANNOT_BE_IGNORED = 32; // those models added by -madd cannot be filtered out
3435

3536
enum MixtureAction {MA_NONE, MA_FIND_RATE, MA_NUMBER_CLASS, MA_FIND_CLASS, MA_ADD_CLASS};
3637

0 commit comments

Comments
 (0)