diff --git a/checkForDependencies.sh b/checkForDependencies.sh index ebe6ecd..519d1d9 100755 --- a/checkForDependencies.sh +++ b/checkForDependencies.sh @@ -55,16 +55,16 @@ python -c 'import Bio' if [ $? -ne 0 ]; then echo "" echo "ERROR: Unable to find required package Biopython (Bio). This package is needed for many IO and graphics operations in ITEP" - echo "It can be downloaded from http://biopython.org or installed (via setuptools) with sudo easy_install -f http://biopython.org/DIST/ biopython" + echo "It can be downloaded from http://biopython.org or installed (via setuptools) with sudo pip install biopython" echo "" $STATUS=1; fi -python -c 'import ete2' +python -c 'import ete3' if [ $? -ne 0 ]; then echo "" - echo "ERROR: Unable to find required package ETE (ete2). This package is needed for any tree manipulation in ITEP" - echo "It can be downloaded at http://ete.cgenomics.org/ or installed (via setuptools) with sudo easy_install -U ete2" + echo "ERROR: Unable to find required package ETE (ete3). This package is needed for any tree manipulation in ITEP" + echo "It can be downloaded at http://etetoolkit.org/ or installed (via setuptools) with sudo pip install ete3" echo "" $STATUS=1; fi @@ -73,7 +73,7 @@ python -c 'import ruffus' if [ $? -ne 0 ]; then echo "" echo "ERROR: Unable to find required package ruffus (ruffus). This package is needed for parallelizing BLAST and RPSBlast calls" - echo "It can be downlaoded at http://www.ruffus.org.uk/ or installed (via setuptools) with sudo easy_install -U ruffus" + echo "It can be downlaoded at http://www.ruffus.org.uk/ or installed (via setuptools) with sudo pip install ruffus" echo "" $STATUS=1; fi diff --git a/lib/CoreGeneFunctions.py b/lib/CoreGeneFunctions.py index 3bf76c1..6b7faf6 100755 --- a/lib/CoreGeneFunctions.py +++ b/lib/CoreGeneFunctions.py @@ -13,7 +13,7 @@ # import errors (e.g. if you're missing mysql interfaces for phylomedb) tmp = sys.stdout sys.stdout = sys.stderr -from ete2 import TextFace +from ete3.treeview import TextFace sys.stdout = tmp def addCoreDataToTree(ete_tree, runid, sanitized = False, any_org = False, all_org = False, only_org = False, none_org = False, uniq_org = False, color = "Black", compare_to_adj_clade = False): @@ -23,7 +23,7 @@ def addCoreDataToTree(ete_tree, runid, sanitized = False, any_org = False, all_o Optionally (with compare_to_adj_clade) instead of comparing to the organisms in the whole tree, we compare to only the organisms in the sister clade at each node. - See http://packages.python.org/ete2/reference/reference_treeview.html#color-names for a list + See http://etetoolkit.org/docs/latest/reference/reference_treeview.html#color-names for a list of valid color names.''' cl = getClusterOrgsByRun(runid) diff --git a/lib/TreeFuncs.py b/lib/TreeFuncs.py index 9027cc2..f5b5a00 100755 --- a/lib/TreeFuncs.py +++ b/lib/TreeFuncs.py @@ -4,7 +4,8 @@ (common operations used by our scripts)''' from __future__ import print_function -from ete2 import Tree, faces, TreeStyle, NodeStyle, AttrFace, TextFace +from ete3 import Tree +from ete3.treeview import faces, TreeStyle, NodeStyle, AttrFace, TextFace from sanitizeString import * import re import sys diff --git a/lib/sanitizeString.py b/lib/sanitizeString.py index 8d2a2b0..ff5c815 100755 --- a/lib/sanitizeString.py +++ b/lib/sanitizeString.py @@ -44,7 +44,7 @@ def sanitizeByType(container, sanitizeby='tsv', onlycolumns=False): newline=[sanitizeString(item.strip("\r\n"), False) for item in line.split("\t")] print("\t".join(newline)) if sanitizeby=='newick': - from ete2 import Tree + from ete3 import Tree t=Tree("".join(container)) for l in t: l.name=sanitizeString(l.name, False) diff --git a/src/db_displayTree.py b/src/db_displayTree.py index 1377aea..0e291a5 100755 --- a/src/db_displayTree.py +++ b/src/db_displayTree.py @@ -82,7 +82,9 @@ # Import lots of stuff for drawing... #################################### -from ete2 import Tree, faces, TreeStyle, NodeStyle, AttrFace, ClusterTree, ProfileFace +from ete3 import Tree +from ete3.treeview import faces, TreeStyle, NodeStyle, AttrFace, ProfileFace +from ete3.clustering import ClusterTree import fileinput import sqlite3 from TreeFuncs import * @@ -150,7 +152,7 @@ # I could generate this in situ... for now I just have a file I like and run with it. # This doesn't match exactlty becuase I don't have the time or motivation now to mess with QT to do it. # It should be pretty close though... - from ete2 import ImgFace + from ete3 import ImgFace imgloc = os.path.join(locateRootDirectory(), "src", "internal", "Colormap.png") F1 = faces.TextFace("Minimum: %1.1f" %(matrix_min), ftype="Times", fsize=32 ) F2 = faces.ImgFace(imgloc) diff --git a/src/db_getPresenceAbsenceTable.py b/src/db_getPresenceAbsenceTable.py index e3286a6..a6089a7 100755 --- a/src/db_getPresenceAbsenceTable.py +++ b/src/db_getPresenceAbsenceTable.py @@ -32,7 +32,8 @@ (options,args) = parser.parse_args() def treeorder(treefile): - from ete2 import Tree, faces, TreeStyle, NodeStyle, AttrFace + from ete3 import Tree + from ete3.treeview import faces, TreeStyle, NodeStyle, AttrFace t = Tree(treefile) rt = t.get_tree_root() nameorder = [] diff --git a/src/db_makeClusterComparisonTable.py b/src/db_makeClusterComparisonTable.py index 73aa2fc..a85d1c8 100755 --- a/src/db_makeClusterComparisonTable.py +++ b/src/db_makeClusterComparisonTable.py @@ -66,7 +66,7 @@ geneids += list(clusterrun_to_genes[clusterrun]) geneids = set(geneids) elif options.newick: - from ete2 import Tree + from ete3 import Tree from TreeFuncs import * newick_str = "".join( [ line.strip("\r\n") for line in fileinput.input("-") ] ) t = Tree(newick_str) diff --git a/src/db_makeNeighborhoodTree.py b/src/db_makeNeighborhoodTree.py index c52b6b0..7346f90 100755 --- a/src/db_makeNeighborhoodTree.py +++ b/src/db_makeNeighborhoodTree.py @@ -50,8 +50,9 @@ from sanitizeString import * import numpy -from ete2 import Tree, faces, TreeStyle, TextFace, PhyloTree -from ete2 import Phyloxml, phyloxml +from ete3 import Tree, PhyloTree +from ete3.treeview import faces, TreeStyle, TextFace +from ete3 import Phyloxml, phyloxml def regionlength(genelocs): @@ -131,7 +132,7 @@ def draw_tree_regions(clusterrunid, t, ts, cur, greyout=3, tempdir=None, label=F sys.stderr.write("Making region drawing for gene ID %s...\n" %(newname)) imgfileloc = make_region_drawing(genelocs, getcolor, newname, maxwidth, tempdir=tempdir, label=label) imageFace = faces.ImgFace(imgfileloc) - leaf.add_face(imageFace, column=2, position = 'aligned') + leaf.add_face(imageFace, column=1, position = 'aligned') #add legend for clusters ts = treelegend(ts, getcolor, greyout, clusterrunid, cur) @@ -171,7 +172,7 @@ def treelegend(ts, getcolor, greyout, clusterrunid, cur): #drop grey ones if color == '#7f7f7f': #offset the greys - col = (gnum%greycols) + colorcols + 1 + 1 #offset from colors and grey def + col = (gnum%greycols) + colorcols + 1 #offset from colors and grey def gnum += 1 # For gray boxes we don't care what the function is. text = treelegendtext(cluster, color) @@ -182,7 +183,7 @@ def treelegend(ts, getcolor, greyout, clusterrunid, cur): text = treelegendtext(str(cluster) + ": " + samplefunc[0:63], color) #placement of this legend ts.legend.add_face(text, column=col) - ts.legend.add_face(treelegendtext("> %s occurrences < or = %s occurrences " % (greyout, greyout),'#FFFFFF'), column=colorcols + 1) + ts.legend.add_face(treelegendtext("> %s occurrences < or = %s occurrences " % (greyout, greyout),'#FFFFFF'), column=colorcols) return ts if __name__ == "__main__": diff --git a/src/getTreeLeafNames.py b/src/getTreeLeafNames.py index 7774395..cbb0d11 100755 --- a/src/getTreeLeafNames.py +++ b/src/getTreeLeafNames.py @@ -5,7 +5,7 @@ import optparse import sys -from ete2 import Tree +from ete3 import Tree from TreeFuncs import * usage = "%prog < tree.nwk > list_of_leaf_names" diff --git a/src/makeCoreClusterAnalysisTree.py b/src/makeCoreClusterAnalysisTree.py index f296af0..6ee4594 100755 --- a/src/makeCoreClusterAnalysisTree.py +++ b/src/makeCoreClusterAnalysisTree.py @@ -7,7 +7,7 @@ import sys import csv -from ete2 import Tree, TextFace, CircleFace +from ete3 import Tree, TextFace, CircleFace from CoreGeneFunctions import * from ClusterFuncs import * diff --git a/src/rerootTree.py b/src/rerootTree.py index 1d1242a..5820153 100755 --- a/src/rerootTree.py +++ b/src/rerootTree.py @@ -5,7 +5,7 @@ import optparse import sys -from ete2 import Tree +from ete3 import Tree from TreeFuncs import * diff --git a/test/TestCore.t b/test/TestCore.t index b0d96c4..85069f0 100644 --- a/test/TestCore.t +++ b/test/TestCore.t @@ -5,7 +5,7 @@ import unittest from CoreGeneFunctions import * from TreeFuncs import * -from ete2 import Tree +from ete3 import Tree class CoreTester(unittest.TestCase): def setUp(self): diff --git a/test/TestTree.t b/test/TestTree.t index 57c97c3..267e444 100644 --- a/test/TestTree.t +++ b/test/TestTree.t @@ -4,7 +4,7 @@ '''Test suite for tree functions''' import unittest from TreeFuncs import * -from ete2 import Tree, PhyloTree +from ete3 import Tree, PhyloTree class RerootTreeTester(unittest.TestCase): def setUp(self):