Skip to content

Commit

Permalink
improves app handling and add prank probcons and kaling checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jhcepas committed Jan 14, 2016
1 parent ccb825a commit 3e89997
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 42 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ global-exclude *.pyo
global-exclude ~*
global-exclude *~
global-exclude #*
global-exclude *.gz
3 changes: 3 additions & 0 deletions ete3/tools/phylobuild.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ dialigntx = built-in, 1
fasttree = built-in, 2
statal = built-in, 1
pmodeltest = built-in, 48
prank = built-in, 1
probcons = built-in, 1
kalign = built-in, 1

# #################
# APPS
Expand Down
19 changes: 7 additions & 12 deletions ete3/tools/phylobuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,23 +642,18 @@ def parse_workflows(names, target_wtype, parse_filters=False):

def _main(arguments):
global BASEPATH, APPSPATH, args
APPSPATH = os.path.expanduser("~/.etetoolkit/ext_apps-latest/")
APPSPATH = BASEPATH
if not pexist(pjoin(APPSPATH, "bin")):
APPSPATH = os.path.expanduser("~/.etetoolkit/ext_apps-latest/")

ETEHOMEDIR = os.path.expanduser("~/.etetoolkit/")

if os.path.exists(pjoin('/etc/etetoolkit/', 'ext_apps-latest')):
# if a copy of apps is part of the ete distro, use if by default
APPSPATH = pjoin('/etc/etetoolkit/', 'ext_apps-latest')
ETEHOMEDIR = '/etc/etetoolkit/'
else:
# if not, try a user local copy
APPSPATH = pjoin(ETEHOMEDIR, 'ext_apps-latest')

if len(arguments) == 1:
if not pexist(APPSPATH):
print(colorify('\nWARNING: external applications directory are not found at %s' %APPSPATH, "yellow"), file=sys.stderr)
print(colorify('Use "ete build install_tools" to install or upgrade tools', "orange"), file=sys.stderr)
print(colorify('\nWARNING: external applications directory could not be found at %s' %APPSPATH, "yellow"), file=sys.stderr)
print(colorify('Use "ete upgrade-external-tools" to install or upgrade tools', "orange"), file=sys.stderr)

elif len(arguments) > 1:
if len(arguments) > 1:
_config_path = pjoin(BASEPATH, 'phylobuild.cfg')

if arguments[1] == "install_tools":
Expand Down
66 changes: 36 additions & 30 deletions ete3/tools/phylobuild_lib/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,23 @@
'clustalo' : "%BIN%/clustalo --threads %CORES%",
'trimal' : "%BIN%/trimal",
'readal' : "%BIN%/readal",
'tcoffee' : "export HOME=/tmp MAFFT_BINARIES=%BIN% TMP_4_TCOFFEE=%TMP% LOCKDIR_4_TCOFFEE=%TMP% && %BIN%/t_coffee",
'tcoffee' : "export HOME=/tmp MAFFT_BINARIES=%BIN% TMP_4_TCOFFEE=%TMP% LOCKDIR_4_TCOFFEE=%TMP% PLUGINS_4_TCOFFEE=%BIN%/ && %BIN%/t_coffee",
'phyml' : "%BIN%/phyml",
'raxml-pthreads' : "%BIN%/raxmlHPC-PTHREADS-SSE3 -T%CORES%", # defaults to SSE3
'raxml' : "%BIN%/raxmlHPC-SSE3", # defaults to SSE3
'raxml-pthreads-sse3': "%BIN%/raxmlHPC-PTHREADS-SSE3 -T%CORES%",
'raxml-sse3' : "%BIN%/raxmlHPC-SSE3",
'raxml-pthreads-avx' : "%BIN%/raxmlHPC-PTHREADS-AVX -T%CORES%",
'raxml-avx' : "%BIN%/raxmlHPC-AVX",
'raxml-pthreads-avx2': "%BIN%/raxmlHPC-PTHREADS-AVX2 -T%CORES%",
'raxml-avx2' : "%BIN%/raxmlHPC-AVX2",
# 'jmodeltest' : "JMODELTEST_HOME=%BASE%/jmodeltest2; cd $JMODELTEST_HOME; java -jar $JMODELTEST_HOME/jModelTest.jar",
'pmodeltest' : "python %BASE%/pmodeltest/pmodeltest.py --nprocs %CORES% --phyml %BIN%/phyml",
'dialigntx' : "%BIN%/dialign-tx %BASE%/DIALIGN-TX_1.0.2/conf",
'usearch' : "%BIN%/usearch",
#'raxml-pthreads-sse3': "%BIN%/raxmlHPC-PTHREADS-SSE3 -T%CORES%",
#'raxml-sse3' : "%BIN%/raxmlHPC-SSE3",
#'raxml-pthreads-avx' : "%BIN%/raxmlHPC-PTHREADS-AVX -T%CORES%",
#'raxml-avx' : "%BIN%/raxmlHPC-AVX",
#'raxml-pthreads-avx2': "%BIN%/raxmlHPC-PTHREADS-AVX2 -T%CORES%",
#'raxml-avx2' : "%BIN%/raxmlHPC-AVX2",
'pmodeltest' : "python %BIN%/pmodeltest.py --nprocs %CORES% --phyml %BIN%/phyml",
'dialigntx' : "%BIN%/dialign-tx %BIN%/dialigntx_conf",
'fasttree' : "export OMP_NUM_THREADS=%CORES%; %BIN%/FastTree",
'statal' : "%BIN%/statal",
'prank' : "%BIN%/prank",
'probcons' : "%BIN%/probcons",
'kalign' : "%BIN%/kalign",
}

app2check = {
Expand All @@ -148,18 +149,20 @@
'phyml' : "--help |grep -i Guindon|wc -l",
'raxml-pthreads' : "-help |grep -i stamatakis|wc -l",
'raxml' : "-help |grep -i stamatakis|wc -l",
'raxml-pthreads-sse3' : "-help |grep -i stamatakis|wc -l",
'raxml-sse3' : "-help |grep -i stamatakis|wc -l",
'raxml-pthreads-avx' : "-help |grep -i stamatakis|wc -l",
'raxml-avx' : "-help |grep -i stamatakis|wc -l",
'raxml-pthreads-avx2' : "-help |grep -i stamatakis|wc -l",
'raxml-avx2' : "-help |grep -i stamatakis|wc -l",
'jmodeltest' : "--help | grep -i posada |wc -l",
#'raxml-pthreads-sse3' : "-help |grep -i stamatakis|wc -l",
#'raxml-sse3' : "-help |grep -i stamatakis|wc -l",
#'raxml-pthreads-avx' : "-help |grep -i stamatakis|wc -l",
#'raxml-avx' : "-help |grep -i stamatakis|wc -l",
#'raxml-pthreads-avx2' : "-help |grep -i stamatakis|wc -l",
#'raxml-avx2' : "-help |grep -i stamatakis|wc -l",
#'jmodeltest' : "--help | grep -i posada |wc -l",
'dialigntx' : "| grep alignment |wc -l",
'usearch' : "| grep -i Edgar|wc -l",
'fasttree' : "| grep 'FastTree ver'|wc -l",
'statal' : "-h | grep -i capella |wc -l ",
'pmodeltest' : "--version|wc -l",
'pmodeltest' : "--version 2>&1|grep 'pmodeltest.py v'",
'prank' : "|grep 'prank v'",
'probcons' : " 2>&1 |grep version",
'kalign' : " 2>&1 |grep Version",
}

app2version = {
Expand All @@ -172,18 +175,19 @@
'phyml' : "--version | grep -i version",
'raxml-pthreads' : "-version| grep -i version",
'raxml' : "-version| grep -i version",
'raxml-pthreads-sse3' : "-version| grep -i version",
'raxml-sse3' : "-version| grep -i version",
'raxml-pthreads-avx' : "-version| grep -i version",
'raxml-avx' : "-version| grep -i version",
'raxml-pthreads-avx2' : "-version| grep -i version",
'raxml-avx2' : "-version| grep -i version",
# 'jmodeltest' : "--help | grep -i posada ",
#'raxml-pthreads-sse3' : "-version| grep -i version",
#'raxml-sse3' : "-version| grep -i version",
#'raxml-pthreads-avx' : "-version| grep -i version",
#'raxml-avx' : "-version| grep -i version",
#'raxml-pthreads-avx2' : "-version| grep -i version",
#'raxml-avx2' : "-version| grep -i version",
'dialigntx' : "/bin/sh |grep -i version",
# 'usearch' : "",
'fasttree' : "2>&1 | grep version",
'statal' : "--version| grep -i statal",
'pmodeltest' : " --version 2>&1|head -n1",
'pmodeltest' : "--version 2>&1|grep 'pmodeltest.py v'",
'prank' : "|grep 'prank v'",
'probcons' : "2>&1 |grep version",
'kalign' : "2>&1 |grep Version",
}


Expand All @@ -192,7 +196,7 @@ def get_call(appname, apps_path, exec_path, cores):
cmd = builtin_apps[appname]
except KeyError:
return None

bin_path = os.path.join(apps_path, "bin")
tmp_path = os.path.join(exec_path, "tmp")
#apps_base = apps_path.rstrip("/x86-64").rstrip("/x86-32")
Expand All @@ -212,6 +216,8 @@ def test_apps(apps):
process = subprocess.Popen(test_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = process.communicate()
out = bytes.decode(out)
#print (process.returncode)
#print (test_cmd)
if out:
print("OK.\t%s" %str(out).strip())
else:
Expand Down

0 comments on commit 3e89997

Please sign in to comment.