本文整理匯總了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;
}