Search in sources :

Example 11 with AbstractPartitionData

use of dr.app.beauti.options.AbstractPartitionData in project beast-mcmc by beast-dev.

the class AncestralStatesComponentGenerator method usesInsertionPoint.

public boolean usesInsertionPoint(InsertionPoint point) {
    AncestralStatesComponentOptions component = (AncestralStatesComponentOptions) options.getComponentOptions(AncestralStatesComponentOptions.class);
    boolean reconstructAtNodes = false;
    boolean reconstructAtMRCA = false;
    boolean countingStates = false;
    boolean dNdSRobustCounting = false;
    for (AbstractPartitionData partition : options.getDataPartitions()) {
        if (component.reconstructAtNodes(partition))
            reconstructAtNodes = true;
        if (component.reconstructAtMRCA(partition))
            reconstructAtMRCA = true;
        if (component.isCountingStates(partition))
            countingStates = true;
        if (component.dNdSRobustCounting(partition))
            dNdSRobustCounting = true;
    }
    if (!reconstructAtNodes && !reconstructAtMRCA && !countingStates && !dNdSRobustCounting) {
        return false;
    }
    switch(point) {
        case IN_FILE_LOG_PARAMETERS:
            return countingStates || dNdSRobustCounting;
        case IN_TREE_LIKELIHOOD:
            return countingStates;
        case IN_TREES_LOG:
            return reconstructAtNodes || countingStates || dNdSRobustCounting;
        case AFTER_OPERATORS:
            return dNdSRobustCounting;
        case AFTER_TREES_LOG:
            return reconstructAtMRCA || dNdSRobustCounting;
        case AFTER_MCMC:
            return dNdSRobustCounting;
        default:
            return false;
    }
}
Also used : AbstractPartitionData(dr.app.beauti.options.AbstractPartitionData)

Aggregations

AbstractPartitionData (dr.app.beauti.options.AbstractPartitionData)11 Attribute (dr.util.Attribute)6 SequenceErrorType (dr.app.beauti.types.SequenceErrorType)4 PartitionTreeModel (dr.app.beauti.options.PartitionTreeModel)2 Taxon (dr.evolution.util.Taxon)2 HashSet (java.util.HashSet)2 PartitionSubstitutionModel (dr.app.beauti.options.PartitionSubstitutionModel)1 EmptyBorder (javax.swing.border.EmptyBorder)1