diff --git a/src/beastfx/app/treeannotator/Controller.java b/src/beastfx/app/treeannotator/Controller.java index a861447..4fed4dd 100644 --- a/src/beastfx/app/treeannotator/Controller.java +++ b/src/beastfx/app/treeannotator/Controller.java @@ -150,13 +150,14 @@ public double getPosteriorLimit() { } } - public Target getTargetOption() { - for (Target t : Target.values()) { - if (t.toString().equals(treeType.getValue())) { - return t; - } - } - return null; + public String getTargetOption() { + return treeType.getValue(); +// for (Target t : Target.values()) { +// if (t.toString().equals(treeType.getValue())) { +// return t; +// } +// } +// return null; } public String getHeightsOption() { diff --git a/src/beastfx/app/treeannotator/TAGui.java b/src/beastfx/app/treeannotator/TAGui.java index 92bbf22..a9fd5cd 100644 --- a/src/beastfx/app/treeannotator/TAGui.java +++ b/src/beastfx/app/treeannotator/TAGui.java @@ -9,6 +9,7 @@ import beast.pkgmgmt.BEASTVersion; import beastfx.app.beauti.ThemeProvider; import beastfx.app.treeannotator.TreeAnnotator.Target; +import beastfx.app.treeannotator.services.UserTargetTreeTopologyService; import beastfx.app.util.Console; import javafx.fxml.FXMLLoader; import javafx.scene.control.ButtonType; @@ -101,11 +102,11 @@ public void run() { } double posteriorLimit = controller.getPosteriorLimit(); double hpd2D = 0.80; - Target targetOption = controller.getTargetOption(); + String targetOption = controller.getTargetOption(); String heightsOption = controller.getHeightsOption(); String targetTreeFileName = controller.getTargetFileName(); - if (targetOption == Target.USER_TARGET_TREE && targetTreeFileName == null) { + if (targetOption.equals(UserTargetTreeTopologyService.SERVICE_NAME) && targetTreeFileName == null) { Log.err.println("No target file specified"); return; } @@ -125,6 +126,7 @@ public void run() { try { TreeAnnotator ta = new TreeAnnotator(); + ta.topologyInput.setValue(targetOption, ta); ta.heightInput.setValue(heightsOption, ta); ta.run(burninPercentage, lowMem, diff --git a/src/beastfx/app/treeannotator/TreeAnnotator.java b/src/beastfx/app/treeannotator/TreeAnnotator.java index e74f45c..aef1150 100644 --- a/src/beastfx/app/treeannotator/TreeAnnotator.java +++ b/src/beastfx/app/treeannotator/TreeAnnotator.java @@ -58,7 +58,7 @@ */ public class TreeAnnotator extends beast.base.inference.Runnable { final public Input heightInput = new Input<> ("height", "name of the method for estimating node heights", "CA"); - final public Input burnInPercentageInput = new Input<>("burnin", "percentage of trees to used as burn-in (and will be ignored)", -1); + final public Input burnInPercentageInput = new Input<>("burnin", "percentage of trees to used as burn-in (and will be ignored)", 10); final public Input limitInput = new Input<>("limit", "the minimum posterior probability for a node to be annotated", 0.0); final public Input topologyInput = new Input<> ("topology", "name of the method for determining topology", "MCC"); final public Input targetInput = new Input<> ("target", "target_file_name, specifies a user target tree to be annotated");