Beispiel #1
0
 def build_tree(self, infile=None, nodefile=None, root='best'):
     '''
     instantiate a tree object and make a time tree
     if infiles are None, the tree is build from scratch. Otherwise
     the tree is loaded from file
     '''
     self.tree = tree(aln=self.seqs.aln, proteins=self.proteins)
     if infile is None:
         self.tree.build(root=root)
     else:
         self.tree.tt_from_file(infile, nodefile=nodefile, root=root)
Beispiel #2
0
 def build_tree(self):
     '''
     (1) instantiate a tree object (process.tree)
     (2) If newick file doesn't exist or isn't valid: build a newick tree (normally RAxML)
     (3) Make a TimeTree
     '''
     self.tree = tree(aln=self.seqs.aln, proteins=self.proteins, verbose=self.config["subprocess_verbosity_level"])
     newick_file = self.output_path + ".newick"
     if self.try_to_restore and os.path.isfile(newick_file) and self.tree.check_newick(newick_file):
         self.log.notify("Newick file \"{}\" can be used to restore".format(newick_file))
     else:
         self.log.notify("Building newick tree.")
         self.tree.build_newick(newick_file, **self.config["newick_tree_options"])
Beispiel #3
0
 def build_tree(self, infile=None):
     self.tree = tree(aln=self.seqs.aln, proteins = self.proteins)
     if infile is None:
         self.tree.build()
     else:
         self.tree.tt_from_file(infile)
     self.tree.timetree(Tc=0.005, infer_gtr=True, n_iqd=3)
     for node in self.tree.tt.tree.get_terminals():
         if hasattr(node, "bad_branch") and node.bad_branch:
             node.numdate = min(2016.15, node.numdate)
     self.tree.add_translations()
     self.remove_outgroup()
     self.tree.refine()
     self.tree.layout()
Beispiel #4
0
 def build_tree(self):
     '''
     (1) instantiate a tree object (process.tree)
     (2) If newick file doesn't exist or isn't valid: build a newick tree (normally RAxML)
     (3) Make a TimeTree
     '''
     # self.log.warn("self.verbose not set")
     self.tree = tree(aln=self.seqs.aln, proteins=self.proteins, verbose=0)
     newick_file = self.output_path + ".newick"
     try:
         assert (self.try_to_restore == True)
         assert (os.path.isfile(newick_file))
         self.tree.check_newick(newick_file)
         self.log.notify(
             "Newick file restored from \"{}\"".format(newick_file))
     except AssertionError:
         self.tree.build_newick(newick_file,
                                **self.config["newick_tree_options"])
Beispiel #5
0
 def build_tree(self, infile=None, nodefile=None, root='best'):
     '''
     instantiate a tree object and make a time tree
     if infiles are None, the tree is build from scratch. Otherwise
     the tree is loaded from file
     '''
     self.tree = tree(aln=self.seqs.aln, proteins = self.proteins)
     if infile is None:
         self.tree.build(root=root)
     else:
         self.tree.tt_from_file(infile, nodefile=nodefile, root=root)
     # if node file is none, no time information is available.
     # hence make a coalescent model time tree and decorate that tree.
     if nodefile is None:
         self.tree.timetree(Tc=0.01, infer_gtr=True)
         self.tree.add_translations()
         self.tree.refine()
         self.tree.layout()