diff --git a/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/ReadCountModel.java b/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/LikelihoodReadCountModel.java similarity index 99% rename from phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/ReadCountModel.java rename to phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/LikelihoodReadCountModel.java index d9d6f10..b25d428 100644 --- a/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/ReadCountModel.java +++ b/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/LikelihoodReadCountModel.java @@ -14,7 +14,7 @@ import java.util.Random; -public class ReadCountModel extends Distribution { +public class LikelihoodReadCountModel extends Distribution { public Input alignmentInput = new Input<>("alignment", "alignment"); public Input readCountInput = new Input<>("readCount", "nucleotide read counts"); diff --git a/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/TreeLikelihoodWithReadCounts.java b/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/TreeLikelihoodWithReadCounts.java index 46dd079..fed6373 100644 --- a/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/TreeLikelihoodWithReadCounts.java +++ b/phylonco-beast/src/main/java/phylonco/beast/evolution/readcountmodel/TreeLikelihoodWithReadCounts.java @@ -17,12 +17,12 @@ public class TreeLikelihoodWithReadCounts extends TreeLikelihood { // public Input epsilonInput = new Input<>("epsilon", "sequencing error"); // public Input deltaInput = new Input<>("delta", "allelic dropout probability"); - public Input readCountModelInput = new Input<>("readCountModel", "read count model"); + public Input readCountModelInput = new Input<>("readCountModel", "read count model"); public Input readCountdataInput = new Input<>("readcount", "read count data for the beast.tree", Input.Validate.REQUIRED); - private ReadCountModel readCountModel; + private LikelihoodReadCountModel likelihoodReadCountModel; @Override public void initAndValidate() { @@ -135,7 +135,7 @@ protected int traverse(final Node node) { int state = genotypeAlignment.getPattern(taxonIndex, patternIndex); // update the leaf partials using read count model int[] states = genotypeAlignment.getDataType().getStatesForCode(state); - readCountModel.calculateLogPLeaf(node, states); + likelihoodReadCountModel.calculateLogPLeaf(node, states); } } return update; diff --git a/phylonco-beast/src/test/java/phylonco/beast/evolution/readcountmodel/ReadCountModelTest.java b/phylonco-beast/src/test/java/phylonco/beast/evolution/readcountmodel/LikelihoodReadCountModelTest.java similarity index 84% rename from phylonco-beast/src/test/java/phylonco/beast/evolution/readcountmodel/ReadCountModelTest.java rename to phylonco-beast/src/test/java/phylonco/beast/evolution/readcountmodel/LikelihoodReadCountModelTest.java index a047f22..96561c9 100644 --- a/phylonco-beast/src/test/java/phylonco/beast/evolution/readcountmodel/ReadCountModelTest.java +++ b/phylonco-beast/src/test/java/phylonco/beast/evolution/readcountmodel/LikelihoodReadCountModelTest.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; -public class ReadCountModelTest { +public class LikelihoodReadCountModelTest { final double DELTA = 1e-10; @@ -45,7 +45,7 @@ public void testAlignment() { */ @Test public void testReadCountModel() throws IOException { - ReadCountModel readCountModel = new ReadCountModel(); + LikelihoodReadCountModel likelihoodReadCountModel = new LikelihoodReadCountModel(); // read from file Double epsilon = 0.06; @@ -66,20 +66,20 @@ public void testReadCountModel() throws IOException { RealParameter sParam = new RealParameter(s); // init params - readCountModel.setInputValue("alignment", alignment); - readCountModel.setInputValue("readCount", readCounts); - readCountModel.setInputValue("epsilon", epsilon.toString()); - readCountModel.setInputValue("delta", delta.toString()); - readCountModel.setInputValue("t", t.toString()); - readCountModel.setInputValue("v", v.toString()); - readCountModel.setInputValue("s", sParam); - readCountModel.setInputValue("w", w.toString()); + likelihoodReadCountModel.setInputValue("alignment", alignment); + likelihoodReadCountModel.setInputValue("readCount", readCounts); + likelihoodReadCountModel.setInputValue("epsilon", epsilon.toString()); + likelihoodReadCountModel.setInputValue("delta", delta.toString()); + likelihoodReadCountModel.setInputValue("t", t.toString()); + likelihoodReadCountModel.setInputValue("v", v.toString()); + likelihoodReadCountModel.setInputValue("s", sParam); + likelihoodReadCountModel.setInputValue("w", w.toString()); // ... - readCountModel.initAndValidate(); + likelihoodReadCountModel.initAndValidate(); - double observedLogP = readCountModel.calculateLogP(); + double observedLogP = likelihoodReadCountModel.calculateLogP(); double expectedLogP = -35.6331962985386; assertEquals(expectedLogP, observedLogP, DELTA); diff --git a/phylonco-beast/version.xml b/phylonco-beast/version.xml index c4f7778..0d32010 100644 --- a/phylonco-beast/version.xml +++ b/phylonco-beast/version.xml @@ -35,7 +35,7 @@ - +