-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thorney work refactored as dataLikelihoodDelegate
- Loading branch information
Showing
47 changed files
with
767 additions
and
1,981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/dr/evomodel/bigfasttree/thorney/BranchLengthLikelihoodDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package dr.evomodel.bigfasttree.thorney; | ||
|
||
|
||
public interface BranchLengthLikelihoodDelegate { | ||
double getLogLikelihood(double mutations, double branchLength); | ||
|
||
double getGradientWrtTime(double mutations, double time); | ||
} |
2 changes: 1 addition & 1 deletion
2
...likelihood/ConstrainableTreeOperator.java → ...ee/thorney/ConstrainableTreeOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ytreelikelihood/ConstrainedTreeModel.java → ...asttree/thorney/ConstrainedTreeModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eelikelihood/ConstrainedTreeOperator.java → ...tree/thorney/ConstrainedTreeOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/dr/evomodel/bigfasttree/thorney/MutationBranchMap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package dr.evomodel.bigfasttree.thorney; | ||
|
||
|
||
import dr.evolution.datatype.DataType; | ||
import dr.evolution.tree.NodeRef; | ||
|
||
public interface MutationBranchMap{ | ||
public DataType getDataType(); | ||
public double getMutations(final NodeRef node); | ||
|
||
|
||
public abstract class AbstractMutationBranchMap implements MutationBranchMap{ | ||
private DataType dataType; | ||
|
||
public AbstractMutationBranchMap(DataType dataType){ | ||
this.dataType = dataType; | ||
} | ||
|
||
public DataType getDataType() { | ||
return dataType; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package dr.evomodel.bigfasttree.thorney; | ||
|
||
import java.util.ArrayList; | ||
|
||
|
||
public interface MutationList{ | ||
public double getMutationCount(); | ||
|
||
|
||
|
||
public class DetailedMutationList implements MutationList{ | ||
|
||
private ArrayList<Mutation> mutations; | ||
|
||
public DetailedMutationList(){ | ||
this.mutations = new ArrayList<>(); | ||
} | ||
|
||
public double getMutationCount(){ | ||
return (double) mutations.size(); | ||
}; | ||
|
||
public int getSite(int mutationIndex){ | ||
return mutations.get(mutationIndex).site; | ||
} | ||
|
||
public int getRef(int mutationIndex){ | ||
return mutations.get(mutationIndex).ref; | ||
} | ||
|
||
public int getAlt(int mutationIndex){ | ||
return mutations.get(mutationIndex).alt; | ||
} | ||
|
||
public void addMutation(Mutation mut){ | ||
this.mutations.add(mut); | ||
} | ||
|
||
public Mutation removeMutation(int mutationIndex){ | ||
return this.mutations.remove(mutationIndex); | ||
} | ||
|
||
|
||
protected class Mutation{ | ||
|
||
final private int alt; | ||
final private int ref; | ||
final private int site; | ||
|
||
protected Mutation(int site, int ref, int alt){ | ||
this.alt= alt; | ||
this.ref = ref; | ||
this.site = site; | ||
} | ||
} | ||
} | ||
|
||
public class SimpleMutationList implements MutationList{ | ||
private double mutations; | ||
public SimpleMutationList(double muts){ | ||
this.mutations = muts; | ||
} | ||
|
||
public double getMutationCount(){ | ||
return this.mutations; | ||
}; | ||
public void setMutationCount(double muts){ | ||
this.mutations=muts; | ||
} | ||
} | ||
} |
37 changes: 14 additions & 23 deletions
37
...oissonBranchLengthLikelihoodDelegate.java → ...oissonBranchLengthLikelihoodDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.