From 32122e29bed7c78230d325bef402ab798fb72f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sj=C3=B6din?= Date: Wed, 6 May 2020 12:56:47 +0200 Subject: [PATCH 1/2] Change ete2 import --- CanSNPer/__main__.py | 12 ++++-------- changelog | 4 ++++ setup.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CanSNPer/__main__.py b/CanSNPer/__main__.py index 3936492..37bc7c5 100755 --- a/CanSNPer/__main__.py +++ b/CanSNPer/__main__.py @@ -4,7 +4,7 @@ CanSNPer: A toolkit for SNP-typing using NGS data. Copyright (C) 2016 Adrian Lärkeryd -VERSION 1.0.9 +VERSION 1.0.10 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,11 +35,7 @@ from subprocess import Popen -if version_info[0] < 3: - from ete2 import Tree, faces, AttrFace, TreeStyle, NodeStyle -else: - from ete3 import Tree, faces, AttrFace, TreeStyle, NodeStyle - +import ete2 def parse_arguments(): '''Parses arguments from the command line and sends them to read_config @@ -561,9 +557,9 @@ def tree_to_newick(organism, config, c): def CanSNPer_tree_layout(node): '''Layout style for ETE2 trees.''' - name_face = AttrFace("name") + name_face = ete2.AttrFace("name") # Adds the name face to the image at the top side of the branch - faces.add_face_to_node(name_face, node, column=0, position="branch-top") + ete2.faces.add_face_to_node(name_face, node, column=0, position="branch-top") def draw_ete2_tree(organism, snplist, tree_file_name, config, c): diff --git a/changelog b/changelog index 14c7359..748c17e 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +2020-05-06 Andreas Sjödin + CanSNPer version 1.0.10 + * Changing import of ete2 + 2017-03-29 Emil Hägglund & Andreas Sjödin CanSNPer version 1.0.9 * Added Dockerfile diff --git a/setup.py b/setup.py index 98a1ec3..ac9a3ff 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="CanSNPer", - version="1.0.9", + version="1.0.10", url="https://github.com/adrlar/CanSNPer", description="CanSNPer: A toolkit for SNP-typing using NGS data.", license="GPL'", From 32178898d314e32efb046c8775d6b136e26c484b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sj=C3=B6din?= Date: Thu, 7 May 2020 09:29:50 +0200 Subject: [PATCH 2/2] Some more fixes --- CanSNPer/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CanSNPer/__main__.py b/CanSNPer/__main__.py index 37bc7c5..59ce6a8 100755 --- a/CanSNPer/__main__.py +++ b/CanSNPer/__main__.py @@ -572,11 +572,11 @@ def draw_ete2_tree(organism, snplist, tree_file_name, config, c): ''' newick = tree_to_newick(organism, config, c) - tree = Tree(newick, format=1) + tree = ete2.Tree(newick, format=1) tree_depth = int(tree.get_distance(tree.get_farthest_leaf()[0])) for n in tree.traverse(): # Nodes are set to red colour - nstyle = NodeStyle() + nstyle = ete2.NodeStyle() nstyle["fgcolor"] = "#BE0508" nstyle["size"] = 10 nstyle["vt_line_color"] = "#000000" @@ -605,7 +605,7 @@ def draw_ete2_tree(organism, snplist, tree_file_name, config, c): nstyle["vt_line_type"] = 1 nstyle["hz_line_type"] = 1 n.set_style(nstyle) - ts = TreeStyle() + ts = ete2.TreeStyle() ts.show_leaf_name = False # Do not print(leaf names, they are added in layout) ts.show_scale = False # Do not show the scale ts.layout_fn = CanSNPer_tree_layout # Use the custom layout