本文整理汇总了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;
}
示例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;
}
示例3: getReturnType
import dr.evomodel.branchratemodel.StrictClockBranchRates; //导入依赖的package包/类
public Class getReturnType() {
return StrictClockBranchRates.class;
}
示例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);
}
示例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);
}