Skip to content

Commit

Permalink
sync beast2 issue 554
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Mar 12, 2018
1 parent acc1a52 commit fb4ff4f
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/snap/AncestralTreeHeightLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void init(PrintStream out) {
}

@Override
public void log(int nSample, PrintStream out) {
public void log(long nSample, PrintStream out) {
for (Node node : tree.getNodesAsArray()) {
out.append(node.getHeight() + "\t");
}
Expand Down
2 changes: 1 addition & 1 deletion src/snap/CoalescentUnitTreeLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void init(PrintStream out) {
}

@Override
public void log(int nSample, PrintStream out) {
public void log(long nSample, PrintStream out) {
// make sure we get the current version of the inputs
coalescenceRate = (RealParameter) ((StateNode) coalescenceRate).getCurrent();
// write out the log tree with meta data
Expand Down
3 changes: 0 additions & 3 deletions src/snap/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,15 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import beast.app.beauti.Beauti;
import beast.core.Description;
import beast.core.Input;
import beast.core.Input.Validate;
import beast.core.util.Log;
import beast.evolution.alignment.Sequence;
import beast.evolution.alignment.Taxon;
import beast.evolution.alignment.TaxonSet;
import beast.evolution.datatype.Binary;
import beast.evolution.datatype.DataType;
import beast.evolution.datatype.IntegerData;
import beast.evolution.datatype.IntegerData2;
import beast.evolution.datatype.Nucleotide;
import beast.evolution.datatype.StandardData;

Expand Down
4 changes: 2 additions & 2 deletions src/snap/MCMC.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void run() throws SAXException, IOException, ParserConfigurationException
operatorSchedule.setStateFileName(stateFileName);

int nBurnIn = burnInInput.get();
int nChainLength = chainLengthInput.get();
long nChainLength = chainLengthInput.get();
int nStateBurnin = m_oStateBurnIn.get();
if (restoreFromFile) {
state.restoreFromFile();
Expand Down Expand Up @@ -161,7 +161,7 @@ public void run() throws SAXException, IOException, ParserConfigurationException


boolean bStayAlive = true;
for (int iSample = -nBurnIn; iSample <= nChainLength && bStayAlive; iSample++) {
for (long iSample = -nBurnIn; iSample <= nChainLength && bStayAlive; iSample++) {

//State proposedState = state.copy();
state.store(iSample);
Expand Down
4 changes: 2 additions & 2 deletions src/snap/ML.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void run() throws IOException {
state.setEverythingDirty(true);

int nBurnIn = burnInInput.get();
int nChainLength = chainLengthInput.get();
long nChainLength = chainLengthInput.get();
//int nStateBurnin = m_oStateBurnIn.get();

System.err.println("Start state:");
Expand Down Expand Up @@ -121,7 +121,7 @@ public void run() throws IOException {
state.setEverythingDirty(true);
double fOldLogLikelihood = calc();
System.err.println("Start likelihood: = " + fOldLogLikelihood);
for (int iSample = -nBurnIn; iSample <= nChainLength; iSample++) {
for (long iSample = -nBurnIn; iSample <= nChainLength; iSample++) {

//State proposedState = state.copy();
state.store(iSample);
Expand Down
2 changes: 1 addition & 1 deletion src/snap/ThetaLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void init(PrintStream out) {
}

@Override
public void log(int nSample, PrintStream out) {
public void log(long nSample, PrintStream out) {
RealParameter var = (RealParameter) m_coalescenceRate.get();
int nValues = var.getDimension();
for (int iValue = 0; iValue < nValues; iValue++) {
Expand Down
2 changes: 1 addition & 1 deletion src/snap/TreeLengthLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void init(PrintStream out) {
}

@Override
public void log(int nSample, PrintStream out) {
public void log(long nSample, PrintStream out) {
Tree tree = (Tree) m_tree.get();
double heightsum = tree.getRoot().getHeight();
heightsum += heightSum(tree.getRoot());
Expand Down
2 changes: 1 addition & 1 deletion src/snap/TreeNodeLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void initLog(PrintStream out, Node node) {
}

@Override
public void log(int nSample, PrintStream out) {
public void log(long nSample, PrintStream out) {
final Tree tree = m_tree.get();
logTree(out, tree.getRoot());
}
Expand Down
2 changes: 1 addition & 1 deletion src/snap/likelihood/NormalisedDistributionLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void init(PrintStream out) {
}

@Override
public void log(final int nSample, final PrintStream out) {
public void log(final long nSample, final PrintStream out) {
out.print(distribution.getCurrentLogP() - treeLikelihood.getAscSitesLogP() + "\t");
}

Expand Down
2 changes: 1 addition & 1 deletion src/snap/likelihood/SnAPTreeLikelihood.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public void init(PrintStream out) {
}

@Override
public void log(int nSample, PrintStream out) {
public void log(long nSample, PrintStream out) {
super.log(nSample, out);
if (!m_bUsenNonPolymorphic) {
out.append(m_fP0 + "\t");
Expand Down

0 comments on commit fb4ff4f

Please sign in to comment.