当前位置: 首页>>代码示例>>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;未经允许,请勿转载。