本文整理汇总了Java中dr.evolution.alignment.Alignment.getTaxonIndex方法的典型用法代码示例。如果您正苦于以下问题:Java Alignment.getTaxonIndex方法的具体用法?Java Alignment.getTaxonIndex怎么用?Java Alignment.getTaxonIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dr.evolution.alignment.Alignment
的用法示例。
在下文中一共展示了Alignment.getTaxonIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPartialsForGroupSizeOne
import dr.evolution.alignment.Alignment; //导入方法依赖的package包/类
private void getPartialsForGroupSizeOne(Taxon tax, double[] tipPartials)
{
Alignment aln = data.getAlignment();
int sc = aln.getStateCount();
int index = aln.getTaxonIndex(tax);
int j=0;
for(int i=0; i<aln.getSiteCount(); i++){
int s = aln.getState(index, i);
if(s>=sc){
for(int k=0; k<sc; k++)
tipPartials[j + k] = 1.0;
}else
System.arraycopy(internalMatrix, s*sc, tipPartials, j, sc);
j += sc;
}
}
示例2: generateRecombinant
import dr.evolution.alignment.Alignment; //导入方法依赖的package包/类
private String generateRecombinant(final Node node, final Map<Node, Taxon> nodeMap, final Alignment alignment) {
String seq = node.getSequence();
if (seq == null) {
// if the sequence hasn't already been cached, then construct it...
if (node.getParent1() == null && node.getParent2() == null) {
// no parents so must have a sequence
Taxon taxon = nodeMap.get(node);
int index = alignment.getTaxonIndex(taxon);
Sequence sequence = alignment.getSequence(index);
seq = sequence.getSequenceString();
} else {
String part1 = generateRecombinant(node.getParent1(), nodeMap, alignment);
String part2 = generateRecombinant(node.getParent2(), nodeMap, alignment);
int breakPoint = node.getBreakPoint();
seq = part1.substring(0, breakPoint) + part2.substring(breakPoint);
}
// cache the sequence
node.setSequence(seq);
}
return seq;
}