Exemplo n.º 1
0
    def __init__(self, newick=None, format=0):

        # ## From ete2.Tree class definition

        self._children = []
        self._up = None
        self._dist = 1.0
        self._support = 1.0
        self._count = 0  # added
        self._gains = 0  # added
        self._losses = 0  # added
        self._change = 0  # added
        self._events = []  # added
        self._taxon_set = None  # added
        self._already_deleted = []  # added

        self.features = set([])

        # Add basic features

        self.add_features(name='NoName')
        self.features.update(['dist', 'support'])

        # Initialize tree

        if newick is not None:
            read_newick(newick, root_node=self, format=format)

        if TREEVIEW:
            self._faces = _FaceAreas()
        for node in self.traverse():
            node._taxon_set = set(node.get_species())
Exemplo n.º 2
0
    def __init__(self, newick=None, format=0):

        # ## From ete2.Tree class definition

        self._children = []
        self._up = None
        self._dist = 1.0
        self._support = 1.0
        self._taxon_set = None  # added
        self._species_subtree = None  # added
        self._index = None  # added

        self.features = set([])

        # Add basic features

        self.add_features(name='NoName')
        self.features.update(['dist', 'support'])

        # Initialize tree

        if newick is not None:
            read_newick(newick, root_node=self, format=format)

        if TREEVIEW:
            self._faces = _FaceAreas()
        for node in self.traverse():
            node._taxon_set = set(node.get_species())

        def nf(name):
            return name

        self.set_species_naming_function(nf)
Exemplo n.º 3
0
    def __init__(self, newick=None, format=0):
        ### From ete2.Tree class definition
        self._children = []
        self._up = None
        self._dist = 1.0
        self._support = 1.0
        self._count = 0             # added
        self._change = 0            # added
        self._fitchset = set([])    # added
        self._sankoff = [None,None] # added
        self._events = []           # added
        self._taxon_set = None      # added

        self.features = set([])
        # Add basic features
        self.add_features(name="NoName")
        self.features.update(["dist", "support"])

        # Initialize tree
        if newick is not None:
            read_newick(newick, root_node = self, format=format)
            
        if TREEVIEW:
            self._faces = _FaceAreas()
        for node in self.traverse():
            node._taxon_set = set(node.get_species())
Exemplo n.º 4
0
    def __init__(self, newick=None, alignment=None, alg_format="fasta", \
                 sp_naming_function=_parse_species, format=0):

        self.nexml_tree = FloatTree()
        self.nexml_tree.set_anyAttributes_({'xsi:type': 'FloatTree'})
        self.nexml_node = TreeNode()
        self.nexml_edge = TreeFloatEdge()
        self.nexml_node.id = "node_%s" % hash(self)
        self.nexml_edge.id = "edge_%s" % hash(self)
        self.nexml_project = None
        self._nexml_support = LiteralMeta(datatype="float",
                                          property="branch_support",
                                          content=1.0)
        self.nexml_edge.length = 0.0
        self.nexml_edge.add_meta(self._nexml_support)

        # Initialize empty PhyloTree
        super(NexmlTree, self).__init__()
        self._children = Children()
        self._children.node = self

        if alignment:
            self.link_to_alignment(alignment, alg_format)
        if newick:
            read_newick(newick, root_node=self, format=format)
            self.set_species_naming_function(sp_naming_function)
Exemplo n.º 5
0
    def __init__(self, newick=None, alignment=None, alg_format="fasta", sp_naming_function=_parse_species, format=0):

        self.nexml_tree = FloatTree()
        self.nexml_tree.set_anyAttributes_({"xsi:type": "FloatTree"})
        self.nexml_node = TreeNode()
        self.nexml_edge = TreeFloatEdge()
        self.nexml_node.id = "node_%s" % hash(self)
        self.nexml_edge.id = "edge_%s" % hash(self)
        self.nexml_project = None
        self._nexml_support = LiteralMeta(datatype="float", property="branch_support", content=1.0)
        self.nexml_edge.length = 0.0
        self.nexml_edge.add_meta(self._nexml_support)

        # Initialize empty PhyloTree
        super(NexmlTree, self).__init__()
        self._children = Children()
        self._children.node = self

        if alignment:
            self.link_to_alignment(alignment, alg_format)
        if newick:
            read_newick(newick, root_node=self, format=format)
            self.set_species_naming_function(sp_naming_function)
Exemplo n.º 6
0
    def __init__(self, newick=None, format=0):

        # ## From ete2.Tree class definition

        self._children = []
        self._up = None
        self._dist = 1.0
        self._support = 1.0
        self.features = set([])
        self._taxon_set = None  # added
        self._species_subtree = None  # added
        self.root = False  # added
        self.duplication = False  # added
        self.speciation = False  # added
        self.ambiguous = False  # added
        self.leaf = False  # added

        # Add basic features

        self.add_features(name="NoName")
        self.features.update(["dist", "support"])

        # Initialize tree

        if newick is not None:
            read_newick(newick, root_node=self, format=format)

        if TREEVIEW:
            self._faces = _FaceAreas()
        for node in self.traverse():
            node._taxon_set = set(node.get_species())

        def nf(name):
            return name

        self.set_species_naming_function(nf)