diff options
author | Justin Lecher <jlec@gentoo.org> | 2013-06-21 12:44:22 +0200 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2013-06-21 12:44:22 +0200 |
commit | ad839ff3a63cc6f60e38ca234b01d8452c8bb8a0 (patch) | |
tree | 9480e22dd7203d07d4ae7eba8c9f12ebafbd6029 | |
parent | Merge branch 'master' into jlec (diff) | |
download | sci-ad839ff3a63cc6f60e38ca234b01d8452c8bb8a0.tar.gz sci-ad839ff3a63cc6f60e38ca234b01d8452c8bb8a0.tar.bz2 sci-ad839ff3a63cc6f60e38ca234b01d8452c8bb8a0.zip |
Work in progress
Signed-off-by: Justin Lecher <jlec@gentoo.org>
-rw-r--r-- | sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-java.patch (renamed from sci-chemistry/shiftx2/files/gentoo-fixes.patch) | 0 | ||||
-rw-r--r-- | sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-system.patch | 231 | ||||
-rw-r--r-- | sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild | 30 |
3 files changed, 253 insertions, 8 deletions
diff --git a/sci-chemistry/shiftx2/files/gentoo-fixes.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-java.patch index 2baa443c5..2baa443c5 100644 --- a/sci-chemistry/shiftx2/files/gentoo-fixes.patch +++ b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-java.patch diff --git a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-system.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-system.patch new file mode 100644 index 000000000..764f5bab2 --- /dev/null +++ b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-system.patch @@ -0,0 +1,231 @@ + natsorted.py | 1 - + script/combine_cs.py | 2 +- + shiftx2.py | 39 +++++++++++++++++++-------------------- + shiftx2_util.py | 3 +-- + shifty3/shifty3.py | 2 +- + 5 files changed, 22 insertions(+), 25 deletions(-) + +diff --git a/natsorted.py b/natsorted.py +index 415b393..6fc909e 100755 +--- a/natsorted.py ++++ b/natsorted.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + ############################################################ + # functions for performing natural sort + ############################################################ +diff --git a/script/combine_cs.py b/script/combine_cs.py +index 4d1dd4f..5182958 100755 +--- a/script/combine_cs.py ++++ b/script/combine_cs.py +@@ -9,7 +9,7 @@ + # last updated: Jan 06st, 2012 (by Beomsoo Han) + ################################################################################# + import sys, re, os +-from natsorted import * ++from shiftx2.natsorted import * + from math import exp ## add for new combine rule + # from numpy import * + tablerows = {} # a hash table for all rows in the table, mapping from residue number to table entry object +diff --git a/shiftx2.py b/shiftx2.py +index 0a171c8..72ecbfe 100755 +--- a/shiftx2.py ++++ b/shiftx2.py +@@ -14,7 +14,7 @@ + ####################################################################### + import os, sys, getopt, re, fnmatch + from optparse import OptionParser +-from shiftx2_util import * ++from shiftx2.shiftx2util import * + + DEUTERATED = None + NOSHIFTY = None +@@ -26,7 +26,7 @@ CHAINID = None + EXPLICIT = None + SHIFTTYPE = None + +-SHIFTX2ROOT = "" ++SHIFTX2ROOT = "@GENTOO_PORTAGE_EPREFIX@/opt/shiftx2" + + # temporary file name + +@@ -136,8 +136,7 @@ def batch_mode(pattern_str): + print "## Running SHIFTX+ modules ..." ## Add by B HAN + + ## switch os.path.abspath("") with SHIFTX2ROOT (set from sys.path[0]) by B HAN +- cmd_prefix = "java -cp " + SHIFTX2ROOT + "/bin:" + SHIFTX2ROOT + \ +- "/lib/weka.jar ShiftXp -b " + "'" + BATCH + "'" + " -atoms " + options.atoms + \ ++ cmd_prefix = "jshiftx2" + " -b " + "'" + BATCH + "'" + " -atoms " + options.atoms + \ + " -ph " + str(options.ph) + " -temp " + str(options.temp) + if DEUTERATED: + cmd_prefix = cmd_prefix + " -d TRUE" +@@ -154,14 +153,14 @@ def batch_mode(pattern_str): + for infile in pdb_list: + # run SHIFTX + ## cmd_prefix = "modules/shiftx/shiftx 1 " + os.path.abspath("") + "/" + \ +- cmd_prefix = SHIFTX2ROOT + "/modules/shiftx/shiftx 1 " + infile + " " + infile + ".sx" ++ cmd_prefix = "shiftx 1 " + infile + " " + infile + ".sx" + os.system(cmd_prefix) + if VERBOSE: + print cmd_prefix + # convert from table format to CSV + ## cmd_prefix = "python script/shiftx2shiftxp.py " + os.path.abspath("") + "/" + \ + ## infile + ".sx " + os.path.abspath("") + "/" + infile + ".sxp" +- cmd_prefix = "python "+ SHIFTX2ROOT +"/script/shiftx2shiftxp.py " + \ ++ cmd_prefix = "shiftx2shiftxp.py " + \ + infile + ".sx " + infile + ".sxp" + ## switched by B HAN + ## infile + ".sx " + os.path.abspath("") + "/" + infile.split('.')[0] + ".sxp" +@@ -180,7 +179,7 @@ def batch_mode(pattern_str): + ## os.chdir(os.path.abspath("shifty3")) + sys.path.append(SHIFTX2ROOT+"/shifty3") + os.chdir(SHIFTX2ROOT+"/shifty3") +- shifty_cmd = "python shifty3.py -i " + \ ++ shifty_cmd = "shifty3.py -i " + \ + infile + " -o " + infile + ".shifty -c 40 " + if DEUTERATED: + shifty_cmd = shifty_cmd + " -d" +@@ -207,7 +206,7 @@ def batch_mode(pattern_str): + errmsg = "Error: SHIFTX+ cannot make a prediction file." + return errmsg + +- combine_cmd = "python " + SHIFTX2ROOT +"/script/combine_cs.py " + sx_outfile + " " + infile + ".shifty " ++ combine_cmd = "combine_cs.py " + sx_outfile + " " + infile + ".shifty " + if not options.outfile: + combine_cmd = combine_cmd + infile + ".cs" + else: +@@ -248,7 +247,7 @@ def model_batch(pattern_str): + # run shiftx1 or shiftx+ + if not SHIFTX1: + # run SHIFTX+ +- cmd_prefix = "java -cp " + SHIFTX2ROOT + "/bin:" + SHIFTX2ROOT + "/lib/weka.jar ShiftXp -b " + \ ++ cmd_prefix = "jshiftx2 -b " + \ + "'" + pattern_str + "'" + " -atoms " + options.atoms + \ + " -ph " + str(options.ph) + " -temp " + str(options.temp) + if DEUTERATED: +@@ -263,14 +262,14 @@ def model_batch(pattern_str): + else: + for infile in pdb_list: + # run SHIFTX +- cmd_prefix = SHIFTX2ROOT + "/modules/shiftx/shiftx 1 " + infile + \ ++ cmd_prefix = "shiftx 1 " + infile + \ + " " + infile + ".sx" + os.system(cmd_prefix) + if VERBOSE: + print cmd_prefix + + # convert from table format to CSV +- cmd_prefix = "python "+ SHIFTX2ROOT +"/script/shiftx2shiftxp.py " + \ ++ cmd_prefix = "shiftx2shiftxp.py " + \ + infile + ".sx " + infile + ".sxp" + + os.system(cmd_prefix) +@@ -328,7 +327,7 @@ def nmr_mode(infile, obs_cs): + if not NOSHIFTY: + sys.path.append( SHIFTX2ROOT + "/shifty3") + os.chdir(SHIFTX2ROOT + "/shifty3") +- shifty_cmd = "python shifty3.py -i " + infile + \ ++ shifty_cmd = "shifty3.py -i " + infile + \ + " -o " + infile + ".shifty -c 40 " + if DEUTERATED: + shifty_cmd = shifty_cmd + " -d" +@@ -350,7 +349,7 @@ def nmr_mode(infile, obs_cs): + return errmsg + + # combine result +- combine_cmd = "python "+ SHIFTX2ROOT + "/script/combine_cs.py " + infile_prefix + ".sxp " + infile + ".shifty " ++ combine_cmd = "combine_cs.py " + infile_prefix + ".sxp " + infile + ".shifty " + if not options.outfile: + combine_cmd = combine_cmd + infile + ".cs" + ## add by B HAN; if it does not exist, error message will occur +@@ -367,7 +366,7 @@ def nmr_mode(infile, obs_cs): + # should be accomplished in a function + if obs_cs!= None: + # calculate correlation +- cmd = "python " + SHIFTX2ROOT +"/script/model_corr.py " + obs_cs + " " + infile_prefix + ".modelcorr " + ' '.join(model_outfiles) ++ cmd = "model_corr.py " + obs_cs + " " + infile_prefix + ".modelcorr " + ' '.join(model_outfiles) + os.system(cmd) + + # plot correlation graphs, plot line graph but no barplots +@@ -456,7 +455,7 @@ def single_mode(infile, outfile): + + if not SHIFTX1: + # run SHIFTX+ +- cmd_prefix = "java -cp " + SHIFTX2ROOT + "/bin:" + SHIFTX2ROOT + "/lib/weka.jar ShiftXp -i " + inputfile \ ++ cmd_prefix = "jshiftx2 -i " + inputfile \ + + " -atoms " + options.atoms + " -ph " + str(options.ph) + " -temp " + str(options.temp) + if DEUTERATED: + cmd_prefix = cmd_prefix + " -d TRUE" +@@ -476,12 +475,12 @@ def single_mode(infile, outfile): + sys.exit(-1) + else: + # run SHIFTX +- cmd_prefix = SHIFTX2ROOT + "/modules/shiftx/shiftx 1 " + inputfile + " " + sx1_outfile ++ cmd_prefix = "shiftx 1 " + inputfile + " " + sx1_outfile + os.system(cmd_prefix) + if VERBOSE: + print cmd_prefix + # convert from table format to CSV +- cmd_prefix = "python " + SHIFTX2ROOT + "/script/shiftx2shiftxp.py " + sx1_outfile + " " + sxp_outfile ++ cmd_prefix = "shiftx2shiftxp.py " + sx1_outfile + " " + sxp_outfile + os.system(cmd_prefix) + if VERBOSE: + print cmd_prefix +@@ -490,7 +489,7 @@ def single_mode(infile, outfile): + if not NOSHIFTY: + sys.path.append(SHIFTX2ROOT + "/shifty3") + os.chdir(SHIFTX2ROOT +"/shifty3") +- shifty_cmd = "python shifty3.py -i " + inputfile + " -o " + sy_outfile + " -c 40 " ++ shifty_cmd = "shifty3.py -i " + inputfile + " -o " + sy_outfile + " -c 40 " + if DEUTERATED: + shifty_cmd = shifty_cmd + " -d" + if VERBOSE: +@@ -513,7 +512,7 @@ def single_mode(infile, outfile): + return errmsg + + # combine result +- combine_cmd = "python script/combine_cs.py " + sxp_outfile + " " + sy_outfile + " " ++ combine_cmd = "combine_cs.py " + sxp_outfile + " " + sy_outfile + " " + combine_cmd = combine_cmd + outfile # specify output file name + + combine_cmd = add_atom_format_option(combine_cmd) +@@ -543,7 +542,7 @@ def cleanup_tempfiles(files): + if __name__ == '__main__': + print "## SHIFTX2 Ver 1.07 (Released 4 Jan. 2012) ##" + +- SHIFTX2ROOT = sys.path[0] ++ #SHIFTX2ROOT = sys.path[0] + + #if len(sys.argv)<3: + # print "Usage: python shiftx2_main.py [input.pdb] [-atoms: all]" +diff --git a/shiftx2_util.py b/shiftx2_util.py +index d357a8e..6ce5e6c 100755 +--- a/shiftx2_util.py ++++ b/shiftx2_util.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + #################################################################### + # shiftx2_util.py: utility functions supporting shiftx2_main.py + # +@@ -6,7 +5,7 @@ + # date: April 13th, 2011 + #################################################################### + import sys, os +-from natsorted import * ++from shiftx2.natsorted import * + + # FUNCTIONS FOR SPLITING PDB FILE WITH MULTIPLE NMR MODELS + +diff --git a/shifty3/shifty3.py b/shifty3/shifty3.py +index 796af32..9360b87 100755 +--- a/shifty3/shifty3.py ++++ b/shifty3/shifty3.py +@@ -12,7 +12,7 @@ import sys, os, re, datetime, time + ############################################################### + # path for xalign and blast executibles and blast databases + XALIGN_EXE = "xalign_x" # executable for xalign +-BLASTP_EXE = "./blast/bin/blastall -p blastp" # executable for blast ++BLASTP_EXE = "blastall -p blastp" # executable for blast + + BLASTDB = "blastdb" # folder containing the blast database + SHIFTDB = "refdb" # folder containing the BMRB shift database diff --git a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild index 5a19e4b0b..01ebe049d 100644 --- a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild +++ b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild @@ -6,7 +6,7 @@ EAPI=5 PYTHON_COMPAT=( python{2_6,2_7} ) -inherit java-pkg-2 java-pkg-simple python-r1 versionator +inherit java-pkg-2 java-pkg-simple prefix python-r1 versionator MY_PV="$(delete_all_version_separators $(get_version_component_range 1-2))" MY_PATCH="20120106" @@ -25,6 +25,7 @@ CDEPEND="dev-util/weka" RDEPEND="${CDEPEND} dev-lang/R + sci-biology/ncbi-tools sci-chemistry/reduce >=virtual/jre-1.5" DEPEND="${CDEPEND} @@ -35,10 +36,13 @@ S="${WORKDIR}"/${MY_P} QA_PREBUILT="/opt/.*" src_prepare() { - epatch "${FILESDIR}/gentoo-fixes.patch" + epatch \ + "${FILESDIR}"/${P}-java.patch \ + "${FILESDIR}"/${P}-system.patch + rm "${S}"/src/FeatureRanges.java || die - shared=$(echo "/usr/share/${PN}" | sed -e 's/\//\\\//g') + shared=$(echo "${EPREFIX}/usr/share/${PN}" | sed -e 's/\//\\\//g') sed -i -e "s/PUT_GENTOO_SHARE_PATH_HERE/${shared}/g" "${S}/src/ShiftXp.java" || die if use debug; then @@ -52,6 +56,8 @@ src_prepare() { -i modules/*/Makefile || die sed -e '/-o/s:$: -lm:g' -i "${S}/modules/resmf/Makefile" || die + + eprefixify ${PN}.py } src_compile() { @@ -78,7 +84,7 @@ src_compile() { src_install() { java-pkg_dojar "${PN}.jar" - java-pkg_dolauncher ${PN} --main "ShiftXp" --pkg_args "-dir ${EPREFIX}/usr/bin" + java-pkg_dolauncher j${PN} --main "ShiftXp" --pkg_args "-dir ${EPREFIX}/usr/bin" insinto /usr/share/${PN} doins "${S}"/lib/{limitedcshift.dat,RandomCoil.csv,data-header.arff} @@ -89,7 +95,11 @@ src_install() { local instdir="/opt/${PN}" dodoc README 1UBQ.pdb - python_parallel_foreach_impl python_doscript "${S}"/*py + python_parallel_foreach_impl python_newscript ${PN}.py ${PN} + mv shiftx2_util.py shiftx2util.py || die + python_moduleinto ${PN} + touch __init__.py + python_parallel_foreach_impl python_domodule natsorted.py shiftx2util.py __init__.py # other modules dobin \ @@ -98,15 +108,19 @@ src_install() { "${S}"/modules/effects/caleffect # script - python_scriptinto ${instdir}/script python_parallel_foreach_impl python_doscript "${S}"/script/*py exeinto ${instdir}/script doexe "${S}"/script/*.r # shifty3 - python_scriptinto ${instdir}/shifty3 - python_parallel_foreach_impl python_doscript "${S}"/shifty3/*py + python_parallel_foreach_impl python_newscript "${S}"/shifty3/*py shifty3 exeinto ${instdir}/shifty3 doexe "${S}"/shifty3/xalign_x dosym ../${PN}/shifty3/xalign_x /opt/bin/xalign_x + + insinto ${instdir}/shifty3 + doins -r "${S}"/shifty3/{blastdb,refdb,xalign.parms,wt.rbo} + + python_parallel_foreach_impl python_doscript "${S}"/shifty3/utils/*py + dobin "${S}"/shifty3/utils/create_blastdb.sh } |