Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
some cleanup and set the default model LG+F+G for partition model sel…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
bqminh committed Dec 22, 2017
1 parent 2b452db commit ded1ef3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions alignment/alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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");
Expand Down
14 changes: 7 additions & 7 deletions main/phylotesting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,19 +1497,19 @@ void testPartitionModel(Params &params, 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);
Expand All @@ -1528,7 +1528,7 @@ void testPartitionModel(Params &params, 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;
Expand Down Expand Up @@ -1613,7 +1613,7 @@ void testPartitionModel(Params &params, 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());
Expand Down Expand Up @@ -1789,7 +1789,7 @@ void testPartitionModel(Params &params, 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;
Expand Down
2 changes: 1 addition & 1 deletion model/modelunrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions tree/phylokernelnew.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
6 changes: 3 additions & 3 deletions tree/quartet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ void PhyloTree::readLikelihoodMappingGroups(char *filename, QuartetGroups &LMGro
for (vector<string>::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;
Expand All @@ -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 {
Expand Down Expand Up @@ -1309,7 +1309,7 @@ void PhyloTree::readLikelihoodMappingGroups(char *filename, QuartetGroups &LMGro
for (vector<string>::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;
Expand Down

0 comments on commit ded1ef3

Please sign in to comment.