本文整理汇总了Java中jebl.evolution.trees.SimpleRootedTree.createInternalNode方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleRootedTree.createInternalNode方法的具体用法?Java SimpleRootedTree.createInternalNode怎么用?Java SimpleRootedTree.createInternalNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jebl.evolution.trees.SimpleRootedTree
的用法示例。
在下文中一共展示了SimpleRootedTree.createInternalNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToJebl
import jebl.evolution.trees.SimpleRootedTree; //导入方法依赖的package包/类
private static Node convertToJebl(Tree tree, NodeRef node, SimpleRootedTree jtree) {
if (tree.isExternal(node)) {
String taxonId = tree.getTaxonId(node.getNumber());
Node externalNode = jtree.createExternalNode(jebl.evolution.taxa.Taxon.getTaxon(taxonId));
jtree.setHeight(externalNode, tree.getNodeHeight(node));
return externalNode;
}
List<Node> jchildren = new ArrayList<Node>();
for (int nc = 0; nc < tree.getChildCount(node); ++nc) {
NodeRef child = tree.getChild(node, nc);
Node node1 = convertToJebl(tree, child, jtree);
jtree.setHeight(node1, tree.getNodeHeight(child));
jchildren.add(node1);
}
return jtree.createInternalNode(jchildren);
}
示例2: convertToJebl
import jebl.evolution.trees.SimpleRootedTree; //导入方法依赖的package包/类
default Node convertToJebl(NodeRef node, SimpleRootedTree jtree) {
if (isExternal(node)) {
String taxonId = getTaxonId(node.getNumber());
Node externalNode = jtree.createExternalNode(jebl.evolution.taxa.Taxon.getTaxon(taxonId));
jtree.setHeight(externalNode, getNodeHeight(node));
return externalNode;
}
List<Node> jchildren = new ArrayList<Node>();
for (int nc = 0; nc < getChildCount(node); ++nc) {
NodeRef child = getChild(node, nc);
Node node1 = convertToJebl(child, jtree);
jtree.setHeight(node1, getNodeHeight(child));
jchildren.add(node1);
}
return jtree.createInternalNode(jchildren);
}