当前位置: 首页>>代码示例>>Java>>正文


Java SimpleRootedTree.setHeight方法代码示例

本文整理汇总了Java中jebl.evolution.trees.SimpleRootedTree.setHeight方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleRootedTree.setHeight方法的具体用法?Java SimpleRootedTree.setHeight怎么用?Java SimpleRootedTree.setHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jebl.evolution.trees.SimpleRootedTree的用法示例。


在下文中一共展示了SimpleRootedTree.setHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:18,代码来源:TreeUtils.java

示例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);
}
 
开发者ID:armanbilge,项目名称:B3,代码行数:18,代码来源:Tree.java

示例3: asJeblTree

import jebl.evolution.trees.SimpleRootedTree; //导入方法依赖的package包/类
/**
 * Convert from beast tree to JEBL tree.
 * Note that currently only topology and branch lengths are preserved.
 * Can add attributes later if needed.
 *
 * @return jebl tree
 */
default SimpleRootedTree asJeblTree() {
    SimpleRootedTree jtree = new SimpleRootedTree();

    convertToJebl(getRoot(), jtree);
    jtree.setHeight(jtree.getRootNode(), getNodeHeight(getRoot()));
    return jtree;
}
 
开发者ID:armanbilge,项目名称:B3,代码行数:15,代码来源:Tree.java

示例4: asJeblTree

import jebl.evolution.trees.SimpleRootedTree; //导入方法依赖的package包/类
/**
 * Convert from beast tree to JEBL tree.
 * Note that currently only topology and branch lengths are preserved.
 * Can add attributes later if needed.
 *
 * @param tree beast
 * @return jebl tree
 */
static public SimpleRootedTree asJeblTree(Tree tree) {
    SimpleRootedTree jtree = new SimpleRootedTree();

    convertToJebl(tree, tree.getRoot(), jtree);
    jtree.setHeight(jtree.getRootNode(), tree.getNodeHeight(tree.getRoot()));
    return jtree;
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:16,代码来源:TreeUtils.java


注:本文中的jebl.evolution.trees.SimpleRootedTree.setHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。