Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(10)  |  Derive(0)  |  Import(5)

src/c/g/cgat-HEAD/CGAT/Tree.py   cgat(Download)
        # branch
        root = Bio.Nexus.Nodes.Node(
            data=Bio.Nexus.Trees.NodeData())            # new root
        self.add(root)                              # add to tree description
        self.root = root.id                           # set as root

src/c/g/CGAT-0.2.0/CGAT/Tree.py   CGAT(Download)
 
        # now we just add both subtrees (outgroup and ingroup) branch for branch
        root=Bio.Nexus.Nodes.Node(data=Bio.Nexus.Trees.NodeData())            # new root    
        self.add(root)                              # add to tree description
        self.root=root.id                           # set as root

src/c/g/cgat-HEAD/CGAT/TreeTools.py   cgat(Download)
        if parent not in map_node2id:
            p = len(tree.chain)
            tree.chain[p] = Bio.Nexus.Nodes.Node(Bio.Nexus.Trees.NodeData())
            map_node2id[parent] = p
            map_id2node.append(parent)
        if child not in map_node2id:
            c = len(tree.chain)
            tree.chain[c] = Bio.Nexus.Nodes.Node(Bio.Nexus.Trees.NodeData())
            map_node2id[child] = c
            map_id2node.append(child)
def add_children(old_tree, new_tree, old_id, new_id):
 
    for n in old_tree.node(old_id).succ:
        nid = new_tree.add(Bio.Nexus.Nodes.Node(old_tree.node(n).data), new_id)
        add_children(old_tree, new_tree, n, nid)
 
    # automatically adds a root, so substitute it
    n = Bio.Nexus.Nodes.Node(tree.node(node_id).data)
    n.id = subtree.root
    subtree.chain[subtree.root] = n

src/c/g/CGAT-0.2.0/CGAT/TreeTools.py   CGAT(Download)
        if parent not in map_node2id:
            p = len(tree.chain)
            tree.chain[p] = Bio.Nexus.Nodes.Node(Bio.Nexus.Trees.NodeData())
            map_node2id[parent] = p
            map_id2node.append( parent )            
        if child not in map_node2id:
            c = len(tree.chain)
            tree.chain[c] = Bio.Nexus.Nodes.Node(Bio.Nexus.Trees.NodeData())
            map_node2id[child] = c
            map_id2node.append( child )                                    
def add_children( old_tree, new_tree, old_id, new_id ):
 
    for n in old_tree.node(old_id).succ:
        nid = new_tree.add( Bio.Nexus.Nodes.Node( old_tree.node(n).data ), new_id )
        add_children( old_tree, new_tree, n, nid )
 
    ## automatically adds a root, so substitute it
    n = Bio.Nexus.Nodes.Node( tree.node(node_id).data )
    n.id = subtree.root
    subtree.chain[subtree.root] = n

src/c/g/cgat-HEAD/scripts/optic/evaluate_trees.py   cgat(Download)
 
from Bio.Nexus import Nexus
from Bio.Nexus.Nodes import Node
 
USAGE = """python %s [OPTIONS] < tree.in > tree.out

src/c/g/cgat-HEAD/scripts/optic/evaluate_bootstrap.py   cgat(Download)
 
from Bio.Nexus import Nexus
from Bio.Nexus.Nodes import Node
 
import CGAT.Experiment as E

src/c/g/cgat-HEAD/scripts/tree_species2genes.py   cgat(Download)
 
from Bio.Nexus import Nexus
from Bio.Nexus.Nodes import Node
 
import CGAT.Experiment as E

src/c/g/cgat-HEAD/scripts/tree_map_leaves.py   cgat(Download)
 
from Bio.Nexus import Nexus
from Bio.Nexus.Nodes import Node
 
 

src/c/g/cgat-HEAD/scripts/tree2patterns.py   cgat(Download)
 
from Bio.Nexus import Nexus
from Bio.Nexus.Nodes import Node
 
import CGAT.Experiment as E