Search in sources :

Example 6 with AncestralStatesComponentOptions

use of dr.app.beauti.components.ancestralstates.AncestralStatesComponentOptions in project beast-mcmc by beast-dev.

the class BeautiOptions method updateTraitParameters.

private void updateTraitParameters(AbstractPartitionData partition) {
    if (partition.isCreatedFromTrait()) {
        ContinuousComponentOptions comp = (ContinuousComponentOptions) getComponentOptions(ContinuousComponentOptions.class);
        comp.createParameters(this);
        DiscreteTraitsComponentOptions comp2 = (DiscreteTraitsComponentOptions) getComponentOptions(DiscreteTraitsComponentOptions.class);
        comp2.createParameters(this);
        AncestralStatesComponentOptions comp3 = (AncestralStatesComponentOptions) getComponentOptions(AncestralStatesComponentOptions.class);
        comp3.setReconstructAtNodes(partition, true);
        comp3.setReconstructAtMRCA(partition, false);
    }
}
Also used : DiscreteTraitsComponentOptions(dr.app.beauti.components.discrete.DiscreteTraitsComponentOptions) ContinuousComponentOptions(dr.app.beauti.components.continuous.ContinuousComponentOptions) AncestralStatesComponentOptions(dr.app.beauti.components.ancestralstates.AncestralStatesComponentOptions)

Example 7 with AncestralStatesComponentOptions

use of dr.app.beauti.components.ancestralstates.AncestralStatesComponentOptions in project beast-mcmc by beast-dev.

the class DiscreteTraitsComponentGenerator method writeTreeLikelihoodReferences.

private void writeTreeLikelihoodReferences(XMLWriter writer) {
    for (AbstractPartitionData partition : options.dataPartitions) {
        if (partition.getTraits() != null) {
            AncestralStatesComponentOptions ancestralStatesOptions = (AncestralStatesComponentOptions) options.getComponentOptions(AncestralStatesComponentOptions.class);
            String treeLikelihoodTag = TreeLikelihoodParser.ANCESTRAL_TREE_LIKELIHOOD;
            if (ancestralStatesOptions.isCountingStates(partition)) {
                treeLikelihoodTag = MarkovJumpsTreeLikelihoodParser.MARKOV_JUMP_TREE_LIKELIHOOD;
            }
            TraitData trait = partition.getTraits().get(0);
            String prefix = partition.getName() + ".";
            if (trait.getTraitType() == TraitData.TraitType.DISCRETE) {
                writer.writeIDref(treeLikelihoodTag, prefix + TreeLikelihoodParser.TREE_LIKELIHOOD);
            }
        }
    }
}
Also used : AncestralStatesComponentOptions(dr.app.beauti.components.ancestralstates.AncestralStatesComponentOptions)

Aggregations

AncestralStatesComponentOptions (dr.app.beauti.components.ancestralstates.AncestralStatesComponentOptions)7 Attribute (dr.util.Attribute)3 ContinuousComponentOptions (dr.app.beauti.components.continuous.ContinuousComponentOptions)1 DiscreteTraitsComponentOptions (dr.app.beauti.components.discrete.DiscreteTraitsComponentOptions)1 SequenceErrorModelComponentOptions (dr.app.beauti.components.sequenceerror.SequenceErrorModelComponentOptions)1 PartitionSubstitutionModel (dr.app.beauti.options.PartitionSubstitutionModel)1 XMLWriter (dr.app.beauti.util.XMLWriter)1 Alignment (dr.evolution.alignment.Alignment)1 DataType (dr.evolution.datatype.DataType)1 Microsatellite (dr.evolution.datatype.Microsatellite)1 Taxa (dr.evolution.util.Taxa)1 Taxon (dr.evolution.util.Taxon)1 TaxonList (dr.evolution.util.TaxonList)1 Pair (dr.util.Pair)1 BufferedWriter (java.io.BufferedWriter)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1