From ded1ef321d838fe1b9691b13c6660e2a1accaa80 Mon Sep 17 00:00:00 2001 From: minh Date: Fri, 22 Dec 2017 22:37:17 +0100 Subject: [PATCH] some cleanup and set the default model LG+F+G for partition model selection --- alignment/alignment.cpp | 8 ++++---- main/phylotesting.cpp | 14 +++++++------- model/modelunrest.cpp | 2 +- tree/phylokernelnew.h | 4 ++-- tree/quartet.cpp | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/alignment/alignment.cpp b/alignment/alignment.cpp index 51c38f37..9d1f7e19 100644 --- a/alignment/alignment.cpp +++ b/alignment/alignment.cpp @@ -128,7 +128,7 @@ int Alignment::checkAbsentStates(string msg) { if (!absent_states.empty()) cout << "NOTE: State(s) " << absent_states << " not present in " << msg << " and thus removed from Markov process to prevent numerical problems" << endl; if (!rare_states.empty()) - cerr << "WARNING: States(s) " << rare_states << " rarely appear in " << msg << " and may cause numerical problems" << endl; + cout << "WARNING: States(s) " << rare_states << " rarely appear in " << msg << " and may cause numerical problems" << endl; delete[] state_freq; return count; } @@ -290,15 +290,15 @@ int Alignment::checkIdenticalSeq() } if (equal_seq) { if (first) - cerr << "WARNING: Identical sequences " << getSeqName(seq1); - cerr << ", " << getSeqName(seq2); + cout << "WARNING: Identical sequences " << getSeqName(seq1); + cout << ", " << getSeqName(seq2); num_identical++; checked[seq2] = 1; first = false; } } checked[seq1] = 1; - if (!first) cerr << endl; + if (!first) cout << endl; } if (num_identical) outWarning("Some identical sequences found that should be discarded before the analysis"); diff --git a/main/phylotesting.cpp b/main/phylotesting.cpp index f44e80e0..e5bd22a6 100644 --- a/main/phylotesting.cpp +++ b/main/phylotesting.cpp @@ -1497,19 +1497,19 @@ void testPartitionModel(Params ¶ms, PhyloSuperTree* in_tree, ModelCheckpoint // Analysis on supermatrix { - cout << "Performing single model on concatenated supermatrix..." << endl; Alignment *conaln = super_aln->concatenateAlignments(); string model_name; switch (conaln->seq_type) { - case SEQ_DNA: model_name = "GTR+G"; break; - case SEQ_PROTEIN: model_name = "LG+G"; break; - case SEQ_CODON: model_name = "GY+G"; break; + case SEQ_DNA: model_name = "GTR+F+G"; break; + case SEQ_PROTEIN: model_name = "LG+F+G"; break; + case SEQ_CODON: model_name = "GY"; break; // too much computation, thus no +G case SEQ_BINARY: model_name = "GTR2+G"; break; case SEQ_MORPH: model_name = "MK+G"; break; case SEQ_POMO: model_name = "GTR+P"; break; default: ASSERT(0 && "Unprocessed seq_type"); } + cout << "Testing " << model_name << " on supermatrix..." << endl; concat_tree = testOneModel(model_name, params, conaln, model_info, concat_info, models_block, num_threads, BRLEN_OPTIMIZE); concat_info.computeICScores(ssize); @@ -1528,7 +1528,7 @@ void testPartitionModel(Params ¶ms, PhyloSuperTree* in_tree, ModelCheckpoint } model_info.dump(); - cout << "Single model: " << concat_info.name << " / LnL: " << concat_info.logl + cout << concat_info.name << " / LnL: " << concat_info.logl << " / df: " << concat_info.df << " / AIC: " << concat_info.AIC_score << " / AICc: " << concat_info.AICc_score << " / BIC: " << concat_info.BIC_score << endl; delete conaln; @@ -1613,7 +1613,7 @@ void testPartitionModel(Params ¶ms, PhyloSuperTree* in_tree, ModelCheckpoint } double inf_score = computeInformationScore(lhsum, dfsum, ssize, params.model_test_criterion); - cout << "Full partition model " << criterionName(params.model_test_criterion) << " score: " << inf_score << " (lh=" << lhsum << " df=" << dfsum << ")" << endl; + cout << "Full partition model " << criterionName(params.model_test_criterion) << " score: " << inf_score << " (LnL: " << lhsum << " df:" << dfsum << ")" << endl; if (params.model_name.find("LINK") == string::npos && params.model_name.find("MERGE") == string::npos) { in_tree->printBestPartition((string(params.out_prefix) + ".best_scheme.nex").c_str()); @@ -1789,7 +1789,7 @@ void testPartitionModel(Params ¶ms, PhyloSuperTree* in_tree, ModelCheckpoint ASSERT(inf_score <= opt_pair.score + 0.1); cout << "Merging " << opt_pair.set_name << " with " << criterionName(params.model_test_criterion) - << " score: " << inf_score << " (lh=" << lhsum << " df=" << dfsum << ")" << endl; + << " score: " << inf_score << " (LnL: " << lhsum << " df: " << dfsum << ")" << endl; // change entry opt_part1 to merged one gene_sets[opt_pair.part1] = opt_pair.merged_set; lhvec[opt_pair.part1] = opt_pair.logl; diff --git a/model/modelunrest.cpp b/model/modelunrest.cpp index 21250450..75078425 100644 --- a/model/modelunrest.cpp +++ b/model/modelunrest.cpp @@ -15,7 +15,7 @@ ModelUnrest::ModelUnrest(PhyloTree *tree, string model_params) for (int i=0; i< num_params; i++) model_parameters[i] = 1; setRates(); if (model_params != "") { - cerr << "WARNING: Supplying model params to constructor not yet properly implemented -- ignored" << endl; + cout << "WARNING: Supplying model params to constructor not yet properly implemented -- ignored" << endl; // TODO: parse model_params into model_parameters, then call setRates(). } name = "UNREST"; diff --git a/tree/phylokernelnew.h b/tree/phylokernelnew.h index 49e6c40a..20c07ade 100644 --- a/tree/phylokernelnew.h +++ b/tree/phylokernelnew.h @@ -2496,7 +2496,7 @@ void PhyloTree::computeLikelihoodDervGenericSIMD(PhyloNeighbor *dad_branch, Phyl } if (std::isnan(*df) || std::isinf(*df)) { - cerr << "WARNING: Numerical underflow for lh-derivative" << endl; + cout << "WARNING: Numerical underflow for lh-derivative" << endl; *df = *ddf = 0.0; } } @@ -3398,7 +3398,7 @@ void PhyloTree::computeLikelihoodDervMixlenGenericSIMD(PhyloNeighbor *dad_branch } if (std::isnan(df) || std::isinf(df)) { - cerr << "WARNING: Numerical underflow for lh-derivative-mixlen" << endl; + cout << "WARNING: Numerical underflow for lh-derivative-mixlen" << endl; df = ddf = 0.0; } } diff --git a/tree/quartet.cpp b/tree/quartet.cpp index 14f6fb20..35c5ea31 100644 --- a/tree/quartet.cpp +++ b/tree/quartet.cpp @@ -1272,7 +1272,7 @@ void PhyloTree::readLikelihoodMappingGroups(char *filename, QuartetGroups &LMGro for (vector::iterator it = (*i)->taxlist.begin(); it != (*i)->taxlist.end(); it++) { taxid = aln->getSeqID(*it); if (taxid < 0) { - cout << "Warning: unknown sequence name \"" << (*it) << "\"! Will be ignored." << endl; + cout << "WARNING: unknown sequence name \"" << (*it) << "\"! Will be ignored." << endl; } else { LMGroups.GroupX[t] = taxid; // cout << " " << (*it) << " (" << taxid << "," << LMGroups.GroupX[t] << ")" << endl; @@ -1281,7 +1281,7 @@ void PhyloTree::readLikelihoodMappingGroups(char *filename, QuartetGroups &LMGro } } if (numtax != t) { - cout << "Warning: ignored cluster did contain unknown sequence names!" << endl; + cout << "WARNING: ignored cluster did contain unknown sequence names!" << endl; LMGroups.numGrpSeqs[4] = t; } } else { @@ -1309,7 +1309,7 @@ void PhyloTree::readLikelihoodMappingGroups(char *filename, QuartetGroups &LMGro for (vector::iterator it = (*i)->taxlist.begin(); it != (*i)->taxlist.end(); it++) { taxid = aln->getSeqID(*it); if (taxid < 0) { - cout << "Warning: sequence name \"" << (*it) << "\"! Will be ignored." << endl; + cout << "WARNING: sequence name \"" << (*it) << "\"! Will be ignored." << endl; } else { switch(n){ case 0: LMGroups.GroupA[t] = taxid;