Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #27 from druvus/1.0.10
Browse files Browse the repository at this point in the history
Change ete2 import
  • Loading branch information
druvus authored May 7, 2020
2 parents adab489 + 3217889 commit bc4bdc8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 7 additions & 11 deletions CanSNPer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -576,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"
Expand Down Expand Up @@ -609,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
Expand Down
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-05-06 Andreas Sjödin <[email protected]>
CanSNPer version 1.0.10
* Changing import of ete2

2017-03-29 Emil Hägglund <[email protected]> & Andreas Sjödin <[email protected]>
CanSNPer version 1.0.9
* Added Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down

0 comments on commit bc4bdc8

Please sign in to comment.