Beispiel #1
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     self.tree_count = 0
     self.taxa_count = 0
     self.ultrametric = True
     self.topologically_unique_trees = []
     self.tree_ages = []
Beispiel #2
0
 def __init__(self, rename=None, **kw):
     PhyltrCommand.__init__(self, **kw)
     if rename:
         self.rename = rename
     elif self.opts.filename and self.opts.from_ and self.opts.to_:
         self.read_rename_file(self.opts.filename, self.opts.from_, self.opts.to_)
     else:
         raise ValueError("Must supply renaming dictionary or filename and columns!")
Beispiel #3
0
    def __init__(self, dummy=False, **kw):
        PhyltrCommand.__init__(self, **kw)
        self.dummy = dummy

        if not self.dummy:  # pragma: no cover
            # Setup TreeStyle
            self.ts = TreeStyle()
            self.ts.show_scale = False
            self.ts.show_branch_support = not self.opts.no_support
            self.ts.show_leaf_name = False
Beispiel #4
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     if not (self.opts.taxa or self.opts.filename):
         raise ValueError(
             "Must provide a list of taxa or a file containing such a list!"
         )
     if not self.opts.taxa:
         self.opts.taxa = read_taxa(self.opts.filename,
                                    column=self.opts.column)
     self.opts.taxa = set(self.opts.taxa)
     if len(self.opts.taxa) == 1:
         raise ValueError("Must specify more than one taxon!")
Beispiel #5
0
    def __init__(self, **kw):
        PhyltrCommand.__init__(self, **kw)
        self.annotations = {}

        if self.opts.extract and (self.opts.filename == "-"
                                  or not self.opts.filename):
            # If we're writing an extracted CSV to stdin, we don't want to also
            # serialise the trees, so plumb to null
            self.sink = NullSink

        if not self.opts.extract:
            self.read_annotation_file()
Beispiel #6
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     if not (self.opts.taxa or self.opts.filename):
         raise ValueError(
             "Must provide a list of taxa or a file containing such a list!"
         )
     if not self.opts.taxa:
         self.opts.taxa = read_taxa(self.opts.filename,
                                    column=self.opts.column)
         # FIXME: read_taxa returns a set, we do need an ordered data structure!
     self.opts.taxa = {taxon: t for t, taxon in enumerate(self.opts.taxa)}
     self.median_cache = {}
     if len(self.opts.taxa) == 1:
         raise ValueError("Must specify more than one taxon!")
Beispiel #7
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     ...
Beispiel #8
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     self.condition = selector_from_taxa_spec(self.opts)
Beispiel #9
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     self.trees = []
     self.cp = phyltr.utils.cladeprob.CladeProbabilities()
Beispiel #10
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     self.taxonset = None
Beispiel #11
0
 def __init__(self, **kw):
     PhyltrCommand.__init__(self, **kw)
     self.topologies = {}