Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

now using name decenttree.cpp #9

Merged
merged 7 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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