Search in sources :

Example 1 with AncestralSequenceTrait

use of dr.app.bss.test.AncestralSequenceTrait in project beast-mcmc by beast-dev.

the class Utils method annotatedTreeModelToString.

// END: partitionDataListToString
// TODO: doesn't work
public static String annotatedTreeModelToString(TreeModel treeModel, LinkedHashMap<NodeRef, int[]> sequencesMap, DataType dataType) {
    StringBuffer buffer = new StringBuffer();
    NumberFormat format = NumberFormat.getNumberInstance(Locale.ENGLISH);
    boolean useTipLabels = true;
    AncestralSequenceTrait ancestralSequence = new AncestralSequenceTrait(sequencesMap, dataType);
    TreeTraitProvider[] treeTraitProviders = new TreeTraitProvider[] { ancestralSequence };
    // 
    TreeUtils.newick(// 
    treeModel, // 
    treeModel.getRoot(), // 
    useTipLabels, // 
    TreeUtils.BranchLengthType.LENGTHS_AS_TIME, // 
    format, // 
    null, // 
    treeTraitProviders, null, buffer);
    return buffer.toString();
}
Also used : AncestralSequenceTrait(dr.app.bss.test.AncestralSequenceTrait) TreeTraitProvider(dr.evolution.tree.TreeTraitProvider) NumberFormat(java.text.NumberFormat)

Aggregations

AncestralSequenceTrait (dr.app.bss.test.AncestralSequenceTrait)1 TreeTraitProvider (dr.evolution.tree.TreeTraitProvider)1 NumberFormat (java.text.NumberFormat)1