當前位置: 首頁>>代碼示例>>Java>>正文


Java StrictClockBranchRates類代碼示例

本文整理匯總了Java中dr.evomodel.branchratemodel.StrictClockBranchRates的典型用法代碼示例。如果您正苦於以下問題:Java StrictClockBranchRates類的具體用法?Java StrictClockBranchRates怎麽用?Java StrictClockBranchRates使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StrictClockBranchRates類屬於dr.evomodel.branchratemodel包,在下文中一共展示了StrictClockBranchRates類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAncestralStateBeagleTreeLikelihoods

import dr.evomodel.branchratemodel.StrictClockBranchRates; //導入依賴的package包/類
private static AncestralStateBeagleTreeLikelihood[] getAncestralStateBeagleTreeLikelihoods(List<? extends SubstitutionModel> subsModels,
                                                                                           List<? extends SiteRateModel> siteModels,
                                                                                           SitePatterns[] p,
                                                                                           StrictClockBranchRates branchRates,
                                                                                           TreeModel treeModel) {
    AncestralStateBeagleTreeLikelihood[] treeLikelihoods = new AncestralStateBeagleTreeLikelihood[3];
    try {
        beagleLock.lock();
        for (int i = 0; i < 3; i++) {
            treeLikelihoods[i] = new AncestralStateBeagleTreeLikelihood(p[i],
                    treeModel,
                    new HomogeneousBranchModel(subsModels.get(i), subsModels.get(i).getFrequencyModel()),
                    siteModels.get(i),
                    branchRates,
                    null,  // Tip states model
                    false, // Use ambiguities?
                    PartialsRescalingScheme.DELAYED,
                    null,  // Partials restrictions
                    Nucleotides.INSTANCE,
                    String.format("CP%d.states", i + 1),
                    false, // Use MAP?
                    true); // Use ML?
        }
    } finally {
        beagleLock.unlock();
    }
    return treeLikelihoods;
}
 
開發者ID:cmccoy,項目名稱:startreerenaissance,代碼行數:29,代碼來源:StarTreeRenaissance.java

示例2: processTree

import dr.evomodel.branchratemodel.StrictClockBranchRates; //導入依賴的package包/類
private Tree processTree(Tree tree) {

        // Remake tree to fix node ordering - Marc

        GammaSiteRateModel siteModel = loadSiteModel(tree);

        SimpleAlignment alignment = new SimpleAlignment();
        alignment.setDataType(siteModel.getSubstitutionModel().getDataType());
        if(siteModel.getSubstitutionModel().getDataType().getClass().equals(Codons.class)) {
            //System.out.println("trololo");
            alignment.setDataType(Nucleotides.INSTANCE);
        }
        //System.out.println("BOO BOO " + siteModel.getSubstitutionModel().getDataType().getClass().getName()+"\t" + Codons.UNIVERSAL.getClass().getName() + "\t" + alignment.getDataType().getClass().getName());


        // Get sequences
        String[] sequence = new String[tree.getNodeCount()];
        for (int i = 0; i < tree.getNodeCount(); i++) {
            NodeRef node = tree.getNode(i);
            sequence[i] = (String) tree.getNodeAttribute(node, SEQ_STRING);
            if (tree.isExternal(node)) {
                Taxon taxon = tree.getNodeTaxon(node);
                alignment.addSequence(new Sequence(taxon, sequence[i]));
                //System.out.println("seq " + sequence[i]);
            }
        }

        // Make evolutionary model

        BranchRateModel rateModel = new StrictClockBranchRates(new Parameter.Default(1.0));
        FlexibleTree flexTree;
        if(siteModel.getSubstitutionModel().getDataType().getClass().equals(Codons.class)) {
            ConvertAlignment convertAlignment  = new ConvertAlignment(siteModel.getSubstitutionModel().getDataType(), ((Codons) siteModel.getSubstitutionModel().getDataType()).getGeneticCode(), alignment);
            flexTree = sampleTree(tree, convertAlignment, siteModel, rateModel);
            //flexTree = sampleTree(tree, alignment, siteModel, rateModel);
        }
        else {
            flexTree = sampleTree(tree, alignment, siteModel, rateModel);
        }
        introduceGaps(flexTree, tree);

        return flexTree;
    }
 
開發者ID:beast-dev,項目名稱:beast-mcmc,代碼行數:44,代碼來源:AncestralSequenceAnnotator.java

示例3: getReturnType

import dr.evomodel.branchratemodel.StrictClockBranchRates; //導入依賴的package包/類
public Class getReturnType() {
    return StrictClockBranchRates.class;
}
 
開發者ID:beast-dev,項目名稱:beast-mcmc,代碼行數:4,代碼來源:StrictClockBranchRatesParser.java

示例4: parseXMLObject

import dr.evomodel.branchratemodel.StrictClockBranchRates; //導入依賴的package包/類
public Object parseXMLObject(XMLObject xo) throws XMLParseException {

        Parameter rateParameter = (Parameter) xo.getElementFirstChild(RATE);

        Logger.getLogger("dr.evomodel").info("\nUsing strict molecular clock model.");

        return new StrictClockBranchRates(rateParameter);
    }
 
開發者ID:beast-dev,項目名稱:beast-mcmc,代碼行數:9,代碼來源:StrictClockBranchRatesParser.java

示例5: parseXMLObject

import dr.evomodel.branchratemodel.StrictClockBranchRates; //導入依賴的package包/類
public Object parseXMLObject(XMLObject xo) throws XMLParseException {

        Parameter rateParameter = (Parameter) xo.getElementFirstChild(RATE);

        Logger.getLogger("dr.evomodel").info("Using strict molecular clock model.");

        return new StrictClockBranchRates(rateParameter);
    }
 
開發者ID:whdc,項目名稱:ieo-beast,代碼行數:9,代碼來源:StrictClockBranchRatesParser.java


注:本文中的dr.evomodel.branchratemodel.StrictClockBranchRates類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。