8 from ete2
import TreeStyle
34 self._style.show_leaf_name =
True
35 self._style.show_branch_length =
False
36 self._style.scale = 80
37 self._style.branch_vertical_margin = 15
38 self._style.rotation = 90
39 self._style.arc_start = -180
40 self._style.arc_span = 180
51 self.
_storageDir = os.path.dirname(options[
"alignment_file"])
52 self.
_filePrefix = os.path.basename(options[
"alignment_file"])
55 out_formats = options[
'out_form'].split(
',')
56 for form
in out_formats:
57 if form == OutputForm.NEWICK:
59 elif form == OutputForm.IMAGE_PNG:
60 self._formatingMethods.append(self.
savePNG)
61 elif form == OutputForm.IMAGE_SVG:
62 self._formatingMethods.append(self.
saveSVG)
63 elif form == OutputForm.GUI:
64 self._formatingMethods.append(self.
showGUI)
65 elif form == OutputForm.PRINT:
68 raise RuntimeError(
"Unknown output format: " + form)
69 if options[
'tree_type'] == TreeType.CIRC:
70 self._style.mode =
'c'
71 elif options[
'tree_type'] == TreeType.RECT:
72 self._style.mode =
'r'
74 raise RuntimeError(
"Unknown tree type: " + options[
'tree_type'])
83 with codecs.open(file_path,
"w",
"utf-8")
as outfile:
84 outfile.write(self._tree.write(format=5))
92 self._tree.render(file_path, tree_style=self.
_style, dpi=300)
101 self._tree.render(file_path, tree_style=self.
_style, dpi=300)
108 self._tree.show(tree_style=self.
_style)