Examples of PhyloTreeNode


Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

   *
   * @param PhyloTree
   */

  public void treeAnalyzer(PhyloTree mytree, StringBuilder xmlPlaceHolder) {
    PhyloTreeNode rootNode = mytree.getRootNode();
    printNodeProperties(rootNode, xmlPlaceHolder);
    List<PhyloTreeNode> firstlevelnodes = rootNode.getChildNodes();

    nodesListParser(firstlevelnodes, xmlPlaceHolder);

  }
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

   */
  public void nodesListParser(List<PhyloTreeNode> nodesList, StringBuilder xmlPlaceHolder) {

    for (int i = 0; i < nodesList.size(); i++) {

      PhyloTreeNode tmpnode = nodesList.get(i);

      nodeAnalyzer(tmpnode, xmlPlaceHolder);

      if (!tmpnode.isLeaf()) {
        printEndTag("Node", xmlPlaceHolder);
      }

    }

View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

    PhyloTree t = (PhyloTree) loadObject(PhyloTree.class);
    RandomList<PhyloTreeNode> nodes = new RandomList<PhyloTreeNode> ();
    nodes.addAll(t.getTreeNodesReadOnly());
   
    while (searchResult == null) {
      PhyloTreeNode a;
      do{ a = nodes.someElement();}
      while (a.getTaxonLabel()==null);
      PhyloTreeNode b;
      do{ b = nodes.someElement();}
      while (b.getTaxonLabel()==null);
      PhyloTreeNode c;
      do{ c = nodes.someElement();}
      while (c.getTaxonLabel()==null);     
     
      searchResult = false;
      if (c.haveABCTopology(a, b)) {
        TaxonVariant as = a.getTaxonLabel().getTaxonVariant();
        TaxonVariant bs = b.getTaxonLabel().getTaxonVariant();
        TaxonVariant cs = c.getTaxonLabel().getTaxonVariant();

        logger.debug("Searching for trees with a=" + as + ", b=" + bs + ", c=" + cs);

        Collection<PhyloTree> trees =
          getFixture().findByTopology3(as, bs, cs);
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

          return null;
      }
      return root.getTaxonLabel() == null ? null : root;  // If it's labelled, return it
    } else { // Otherwise, search downwards
      for (PhyloTreeNode child : children) {
        PhyloTreeNode result = findLabeledLeaf(child);
        if (result != null) return result;
      }
      return null;
    }
  }
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

        // phyloTree.setTreeType(treeType);
        // phyloTree.setTreeAttribute(pNewTreeAttribute);
        // phyloTree.setTreeQuality(pNewTreeQuality);

        int rootIndex = mesqTree.getRoot();
        PhyloTreeNode rootNode = createNode(mesqTree, null, rootIndex);
        phyloTree.addTreeNode(rootNode);
        phyloTree.setRootNode(rootNode);

        treeTraversal(mesqTree, rootIndex, rootNode);
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

    // phyloTree.setTreeType(treeType);
    // phyloTree.setTreeAttribute(pNewTreeAttribute);
    // phyloTree.setTreeQuality(pNewTreeQuality);

    int rootIndex = mesqTree.getRoot();
    PhyloTreeNode rootNode = createNode(mesqTree, null, rootIndex);
    pTree.addTreeNode(rootNode);
    pTree.setRootNode(rootNode);

    treeTraversal(mesqTree, rootIndex, rootNode);
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

    int index = pMesquiteTree.firstDaughterOfNode(pParentNodeIndex);
    if (!pMesquiteTree.nodeExists(index)) {
      return;
    }

    PhyloTreeNode aNode = createNode(pMesquiteTree, pParentNode, index);

    // for sibling nodes:
    int siblingNodeIndex = pMesquiteTree.nextSisterOfNode(index);
    while (siblingNodeIndex > 0) {
      PhyloTreeNode siblingNode = createNode(pMesquiteTree, pParentNode, siblingNodeIndex);

      treeTraversal(pMesquiteTree, siblingNodeIndex, siblingNode);

      siblingNodeIndex = pMesquiteTree.nextSisterOfNode(siblingNodeIndex);
    }
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

   * @param pParentNode
   * @param pNodeIndex
   * @return
   */
  private PhyloTreeNode createNode(Tree pMesquiteTree, PhyloTreeNode pParentNode, int pNodeIndex) {
    PhyloTreeNode aNode = new PhyloTreeNode();
    // PhyloTree tree = pParentNode.getTree();
    // aNode.setTree(tree);

    double branchLength = pMesquiteTree.getBranchLength(pNodeIndex);
    if (MesquiteDouble.unassigned != branchLength) {
      aNode.setBranchLength(branchLength);
    }

    String nodeLabel = pMesquiteTree.getNodeLabel(pNodeIndex);
    if (!TreebaseUtil.isEmpty(nodeLabel)) {

      // Note: the node label is the same as the taxon label name
      // for qualified leave nodes.
      aNode.setName(nodeLabel);

      // TODO: need verify
      List<TaxonLabel> currentTaxa = getCurrentTaxaList();
      Taxa currentTreeTaxa = getCurrentTreeTaxa();

      String taxonLabelName = currentTreeTaxa.getTaxonName(pMesquiteTree
        .taxonNumberOfNode(pNodeIndex));
      aNode.setTaxonLabel(getTaxaLabel(currentTaxa, taxonLabelName));

    }

    // TODO aNode.setNodeDepth();

View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

    PhyloTree tree = new PhyloTree();
    tree.setTitle(newName);
    tree.setLabel(newName);
    tree.setNexusFileName(null);

    PhyloTreeNode rootNode = new PhyloTreeNode();
    tree.addTreeNode(rootNode);
    tree.setRootNode(rootNode);

    PhyloTreeNode node1 = new PhyloTreeNode();
    rootNode.addChildNode(node1);

    PhyloTreeNode node2 = new PhyloTreeNode();
    rootNode.addChildNode(node2);

    PhyloTreeNode node3 = new PhyloTreeNode();
    node1.addChildNode(node3);

    PhyloTreeNode node4 = new PhyloTreeNode();
    node3.addChildNode(node4);

    getFixture().store(tree);

    // force commit immediately, important:
View Full Code Here

Examples of org.cipres.treebase.domain.tree.PhyloTreeNode

    PhyloTree tree = new PhyloTree();
    tree.setTitle(newName);
    tree.setLabel(newName);
    tree.setNexusFileName(null);

    PhyloTreeNode rootNode = new PhyloTreeNode();
    tree.addTreeNode(rootNode);
    tree.setRootNode(rootNode);

    PhyloTreeNode node1 = new PhyloTreeNode();
    rootNode.addChildNode(node1);

    PhyloTreeNode node2 = new PhyloTreeNode();
    rootNode.addChildNode(node2);

    PhyloTreeNode node3 = new PhyloTreeNode();
    node1.addChildNode(node3);

    PhyloTreeNode node4 = new PhyloTreeNode();
    node3.addChildNode(node4);

    // tree2:
    PhyloTree tree2 = new PhyloTree();
    tree2.setLabel(newName + "2");
    PhyloTreeNode node21 = new PhyloTreeNode();
    tree2.addTreeNode(node21);
    tree2.setRootNode(node21);

    // treeblock:
    TreeBlock block = new TreeBlock();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.