Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions checkForDependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/CoreGeneFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion lib/TreeFuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/sanitizeString.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions src/db_displayTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/db_getPresenceAbsenceTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion src/db_makeClusterComparisonTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions src/db_makeNeighborhoodTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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__":
Expand Down
2 changes: 1 addition & 1 deletion src/getTreeLeafNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/makeCoreClusterAnalysisTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
2 changes: 1 addition & 1 deletion src/rerootTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import optparse
import sys

from ete2 import Tree
from ete3 import Tree

from TreeFuncs import *

Expand Down
2 changes: 1 addition & 1 deletion test/TestCore.t
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion test/TestTree.t
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down