Search in sources :

Example 1 with BeerLikelihoodCore

use of beast.evolution.likelihood.BeerLikelihoodCore in project bacter by tgvaughan.

the class ACGLikelihood method updateCores.

/**
 * Initialize likelihood cores.
 */
private void updateCores() {
    List<Region> regionList = acg.getRegions(locus);
    likelihoodCores.keySet().retainAll(regionList);
    for (Region region : regionList) {
        if (likelihoodCores.containsKey(region))
            continue;
        LikelihoodCore likelihoodCore;
        if (nStates == 4)
            likelihoodCore = new BeerLikelihoodCore4();
        else
            likelihoodCore = new BeerLikelihoodCore(nStates);
        likelihoodCores.put(region, likelihoodCore);
        likelihoodCore.initialize(acg.getNodeCount(), patterns.get(region).elementSet().size(), siteModel.getCategoryCount(), true, useAmbiguitiesInput.get());
        if (scaleFactor > 1.0)
            likelihoodCore.setUseScaling(scaleFactor);
        if (useAmbiguitiesInput.get())
            setPartials(likelihoodCore, patterns.get(region));
        else
            setStates(likelihoodCore, patterns.get(region));
        int intNodeCount = acg.getNodeCount() / 2;
        for (int i = 0; i < intNodeCount; i++) likelihoodCore.createNodePartials(intNodeCount + 1 + i);
    }
}
Also used : BeerLikelihoodCore4(beast.evolution.likelihood.BeerLikelihoodCore4) BeerLikelihoodCore(beast.evolution.likelihood.BeerLikelihoodCore) LikelihoodCore(beast.evolution.likelihood.LikelihoodCore) BeerLikelihoodCore(beast.evolution.likelihood.BeerLikelihoodCore)

Aggregations

BeerLikelihoodCore (beast.evolution.likelihood.BeerLikelihoodCore)1 BeerLikelihoodCore4 (beast.evolution.likelihood.BeerLikelihoodCore4)1 LikelihoodCore (beast.evolution.likelihood.LikelihoodCore)1