Package Bio :: Package Phylo :: Module Newick
[hide private]
[frames] | no frames]

Source Code for Module Bio.Phylo.Newick

 1  # Copyright (C) 2009 by Eric Talevich (eric.talevich@gmail.com) 
 2  # This code is part of the Biopython distribution and governed by its 
 3  # license. Please see the LICENSE file that should have been included 
 4  # as part of this package. 
 5   
 6  """Classes corresponding to Newick trees, also used for Nexus trees. 
 7   
 8  See classes in `Bio.Nexus`: Trees.Tree, Trees.NodeData, and Nodes.Chain. 
 9  """ 
10   
11  from Bio.Phylo import BaseTree 
12   
13   
14 -class Tree(BaseTree.Tree):
15 """Newick Tree object.""" 16
17 - def __init__(self, root=None, rooted=False, id=None, name=None, weight=1.0):
18 """Initialize parameters for a Newick tree object.""" 19 BaseTree.Tree.__init__(self, root=root or Clade(), 20 rooted=rooted, id=id, name=name) 21 self.weight = weight
22 23
24 -class Clade(BaseTree.Clade):
25 """Newick Clade (sub-tree) object.""" 26
27 - def __init__(self, branch_length=None, name=None, clades=None, 28 confidence=None, comment=None):
29 """Initialize parameters for a Newick Clade object.""" 30 BaseTree.Clade.__init__(self, branch_length=branch_length, 31 name=name, clades=clades, confidence=confidence) 32 self.comment = comment
33