Skip to content

Commit

Permalink
Merge pull request #9 from NicolaDM/master
Browse files Browse the repository at this point in the history
now using name decenttree.cpp
  • Loading branch information
bqminh authored May 7, 2024
2 parents c665a53 + ca6f98b commit e924d5c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions model/modelunrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

#include "modelunrest.h"
#include <stdlib.h>
#include <string.h>

ModelUnrest::ModelUnrest(PhyloTree *tree, string model_params, StateFreqType freq_type, string freq_params)
: ModelMarkov(tree, false)
Expand All @@ -16,6 +18,7 @@ ModelUnrest::ModelUnrest(PhyloTree *tree, string model_params, StateFreqType fre
for (int i=0; i <= num_params; i++) {
rates[i] = 1.0;
}

if (model_params != "") {
//cout << "WARNING: Supplying model params to constructor not yet properly implemented -- ignored" << endl;
// TODO: parse model_params into model_parameters, then call setRates().
Expand Down Expand Up @@ -54,6 +57,23 @@ ModelUnrest::ModelUnrest(PhyloTree *tree, string model_params, StateFreqType fre
ModelMarkov::init(FREQ_ESTIMATE);
}

void ModelUnrest::writeInfo(ostream &out) {
out << "UNREST rate values:";
out << " A-C: " << rates[0];
out << " A-G: " << rates[1];
out << " A-T: " << rates[2];
out << " C-A: " << rates[3];
out << " C-G: " << rates[4];
out << " C-T: " << rates[5];
out << " G-A: " << rates[6];
out << " G-C: " << rates[7];
out << " G-T: " << rates[8];
out << " T-A: " << rates[9];
out << " T-C: " << rates[10];
out << " T-G: " << rates[11];
out << endl;
}

/* static */ bool ModelUnrest::validModelName(string model_name) {
return (model_name == "UNREST");
}
Expand All @@ -68,6 +88,8 @@ void ModelUnrest::setBounds(double *lower_bound, double *upper_bound, bool *boun
}
}



/*
void ModelUnrest::setRates() {
// For UNREST, parameters are simply the off-diagonal rate matrix entries
Expand Down
1 change: 1 addition & 0 deletions model/modelunrest.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class ModelUnrest: public ModelMarkov {
virtual void restoreCheckpoint();

protected:
void writeInfo(ostream &out);
virtual void setRates();
};

Expand Down

0 comments on commit e924d5c

Please sign in to comment.