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

Add thorney beast support in Beauti #1211

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

Add thorney beast support in Beauti #1211

wants to merge 31 commits into from

Conversation

jtmccr1
Copy link
Contributor

@jtmccr1 jtmccr1 commented Dec 18, 2024

This is a smaller request than the previous one to add support for thorney beast to beauti.

This does not use BigFastIntervals in any way and so we don't wander into the breaking changes discussed elsewhere.

I will comment on other changes below but the two that stick out are:

  1. Warning the user that using hmc clock model with this likelihood is not supported
  2. Creating proxy parameters for the BigFastTree node heights and root height. This means that standard node height operators can be used, and the xml api for BigFastTreeModel and Default TreeModel are similar.

@@ -239,6 +239,23 @@ public void checkOptions() throws GeneratorException {
}
}

//+++++++++++++++++ ThorneyBEAST / clock model Verification ++++++++++++++
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warns the user about using a clock model for which gradients for tb are not implemented

@@ -254,7 +254,11 @@ public List<Parameter> selectParameters(List<Parameter> parameters) {
Set<PartitionSubstitutionModel> substitutionModels = new LinkedHashSet<>();
for (AbstractPartitionData partition : getDataPartitions()) {
if (partition.getPartitionClockModel() == model) {
substitutionModels.add(partition.getPartitionSubstitutionModel());
PartitionSubstitutionModel substitutionModel = partition.getPartitionSubstitutionModel();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataType.Tree partitions don't have substitution models. This ensures we don't add 'null' substitution models t

@@ -557,8 +557,9 @@ public List<Operator> selectOperators(List<Operator> operators) {
List<Operator> ops = new ArrayList<Operator>();

if (options.hasData()) {
if (getDataType().getType() != DataType.TREE) {
if (getDataType().getType() != DataType.TREE || getPartitionTreeModel().isUsingThorneyBEAST()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TB analyses have clock models

private boolean isNewick = true;

private boolean hasTipCalibrations = false;
private boolean hasNodeCalibrations = false;
public static List<ClockType> thorneyCompatibleClocks = Arrays.asList( ClockType.STRICT_CLOCK, ClockType.UNCORRELATED,
ClockType.FIXED_LOCAL_CLOCK, ClockType.RANDOM_LOCAL_CLOCK, ClockType.FIXED_LOCAL_CLOCK,
ClockType.MIXED_EFFECTS_CLOCK );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List of TB compatible clocks (all others use gradients)

abstract public boolean hasNodeTraits();
abstract public void swapAllTraits(NodeRef node1, NodeRef node2);
abstract public boolean hasRates();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lifting these to the parent class to make it is easier to BigFastTrees and DefaultTrees interchangeably.

@@ -38,7 +39,7 @@
* @author Marc A. Suchard
* @author Xiang Ji
*/
public class NodeHeightProxyParameter extends Parameter.Proxy {
public class NodeHeightProxyParameter extends Parameter.Proxy implements Bounds<Double> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calculating bounds on the fly so we can use these proxy parameters in node heigh operators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant