From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6D34D138200 for ; Sun, 16 Jun 2013 17:24:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EED0DE08F9; Sun, 16 Jun 2013 17:23:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 41EB4E0908 for ; Sun, 16 Jun 2013 17:23:59 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2AE6E33E3BC for ; Sun, 16 Jun 2013 17:23:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id C6F7EE5459 for ; Sun, 16 Jun 2013 17:23:56 +0000 (UTC) From: "Justin Lecher" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Justin Lecher" Message-ID: <1371401730.a5dea0ab4d52cd3e3c205d4bdb9ad1e8fe48f662.jlec@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/shiftx2/, sci-chemistry/shiftx2/files/ X-VCS-Repository: proj/sci X-VCS-Files: sci-chemistry/shiftx2/files/gentoo-fixes.patch sci-chemistry/shiftx2/metadata.xml sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild X-VCS-Directories: sci-chemistry/shiftx2/ sci-chemistry/shiftx2/files/ X-VCS-Committer: jlec X-VCS-Committer-Name: Justin Lecher X-VCS-Revision: a5dea0ab4d52cd3e3c205d4bdb9ad1e8fe48f662 X-VCS-Branch: master Date: Sun, 16 Jun 2013 17:23:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 450a5bb9-a888-4c22-bd76-96aeac7007cd X-Archives-Hash: de92872002809936d7f9890f3063be06 commit: a5dea0ab4d52cd3e3c205d4bdb9ad1e8fe48f662 Author: Johann Schmitz j-schmitz net> AuthorDate: Sun Jun 16 16:55:30 2013 +0000 Commit: Justin Lecher gentoo org> CommitDate: Sun Jun 16 16:55:30 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=a5dea0ab Enhanced the sci-chemistry/shiftx ebuild. Still needs some love for the emake part (portage complains about LDFLAGS not respected), but should work. --- sci-chemistry/shiftx2/files/gentoo-fixes.patch | 194 +++++++++++++++++++++ sci-chemistry/shiftx2/metadata.xml | 57 +++--- .../shiftx2/shiftx2-1.07_p20120106.ebuild | 56 ++++-- 3 files changed, 271 insertions(+), 36 deletions(-) diff --git a/sci-chemistry/shiftx2/files/gentoo-fixes.patch b/sci-chemistry/shiftx2/files/gentoo-fixes.patch new file mode 100644 index 0000000..2baa443 --- /dev/null +++ b/sci-chemistry/shiftx2/files/gentoo-fixes.patch @@ -0,0 +1,194 @@ +diff --git a/shiftx2-v107-linux/src/LimitedCShift.java b/shiftx2-v107-linux/src/LimitedCShift.java +index cd27fbf..9e72208 100755 +--- a/shiftx2-v107-linux/src/LimitedCShift.java ++++ b/shiftx2-v107-linux/src/LimitedCShift.java +@@ -13,8 +13,8 @@ public class LimitedCShift { + public void loadLimitedCShift () { + // System.out.println("SHIFTX2_DIR: "+ShiftXp.SHIFTX2_DIR); + +- String filename = ShiftXp.SHIFTX2_DIR + "/lib/limitedcshift.dat"; +- String objFilename = ShiftXp.SHIFTX2_DIR + "/lib/limitedcshift.osf"; ++ String filename = ShiftXp.GENTOO_SHARE_PATH + "/limitedcshift.dat"; ++ String objFilename = ShiftXp.GENTOO_SHARE_PATH + "/limitedcshift.osf"; + + File f = new File(objFilename); + if (f.exists()) { +@@ -44,7 +44,7 @@ public class LimitedCShift { + br.close(); + + // save object into object file format for speed up +- saveObjectFile(objFilename, limshift); ++ //saveObjectFile(objFilename, limshift); + + } catch(IOException ex){ + ex.printStackTrace(); +diff --git a/shiftx2-v107-linux/src/ModuleExecutor.java b/shiftx2-v107-linux/src/ModuleExecutor.java +index 36cfeb1..704451f 100755 +--- a/shiftx2-v107-linux/src/ModuleExecutor.java ++++ b/shiftx2-v107-linux/src/ModuleExecutor.java +@@ -22,12 +22,12 @@ public class ModuleExecutor { + // private static final String WORKING_DIR = "./wkdir/"; + private static String WORKING_DIR = ""; + +- private static final String RESMF_EXE = "/modules/resmf/resmf"; +- private static final String EFFECTS_EXE = "/modules/effects/caleffect"; +- private static final String ANGLES_EXE = "/modules/angles/get_angles"; +- private static final String ANGLES_REDUCE_DIR = "/modules/angles"; ++ private static final String RESMF_EXE = "resmf"; ++ private static final String EFFECTS_EXE = "caleffect"; ++ private static final String ANGLES_EXE = "get_angles"; ++ private static final String ANGLES_REDUCE_DIR = "angles"; + +- private static String SHIFTXP_DIR = ShiftXp.SHIFTX2_DIR; ++// private static String SHIFTXP_DIR = ShiftXp.SHIFTX2_DIR; + + private static final String REDUCE_FLAG = "1"; // 1 or 0 + +@@ -80,8 +80,8 @@ public class ModuleExecutor { + if(DEBUG) System.out.println("> Processing [Major Features] with " + pdbfile); + // Update: add pdbdir both input pdbfile and output result, pdbId (2011.03.17) + // cmd = RESMF_EXE + " -f " + pdbdir +"/"+ pdbfile + " -o " + WORKING_DIR + pdbId + ".resmf"; +- cmd = SHIFTXP_DIR + RESMF_EXE + " -f " + pdbdir + pdbfile + " -o " + WORKING_DIR + pdbId + ".resmf" +- + " -d " + SHIFTXP_DIR + "/modules/resmf/lib"; ++ cmd = RESMF_EXE + " -f " + pdbdir + pdbfile + " -o " + WORKING_DIR + pdbId + ".resmf" ++ + " -d " + ShiftXp.GENTOO_SHARE_PATH + "/vader"; + + if(DEBUG){ System.out.println("\t"+cmd); } + execCode = execute_command(cmd); +@@ -93,7 +93,7 @@ public class ModuleExecutor { + + /* call effects for calculating ring current calculator */ + if(DEBUG) System.out.println("> processing [Effects] with " + pdbfile); +- cmd = SHIFTXP_DIR + EFFECTS_EXE + " 1 " + pdbdir + pdbfile + " " + WORKING_DIR + pdbfile + ".dummy"; ++ cmd = EFFECTS_EXE + " 1 " + pdbdir + pdbfile + " " + WORKING_DIR + pdbfile + ".dummy"; + + if(DEBUG){ System.out.println("\t"+cmd); } + execCode = execute_command(cmd); +@@ -106,7 +106,7 @@ public class ModuleExecutor { + /* call angle calculator : output must be redirected to file using PrintStream */ + if(DEBUG) System.out.println("> Processing [Angle] with " + pdbfile); + // cmd = ANGLES_EXE + " " + ANGLES_REDUCE_DIR + " " + pdbfile ; +- cmd = SHIFTXP_DIR + ANGLES_EXE + " " + SHIFTXP_DIR + ANGLES_REDUCE_DIR + " " + pdbdir + pdbfile + " "+ REDUCE_FLAG; ++ cmd = ANGLES_EXE + " " + ShiftXp.GENTOO_SHARE_PATH + " " + pdbdir + pdbfile + " "+ REDUCE_FLAG; + String outpath = WORKING_DIR + pdbId + ".angles"; + + if(DEBUG){ System.out.println("\t"+cmd); } +diff --git a/shiftx2-v107-linux/src/PredictionModels.java b/shiftx2-v107-linux/src/PredictionModels.java +index a77d1cb..fb84666 100755 +--- a/shiftx2-v107-linux/src/PredictionModels.java ++++ b/shiftx2-v107-linux/src/PredictionModels.java +@@ -13,9 +13,7 @@ public class PredictionModels { + private final static String MODEL_FILE_SIDECHAIN_ONLY = "predmodels_sidechain.sobj"; + + private final static String OBJECT_MODEL_DIRECTORY = "/lib"; +- private final static String MODEL_DIRECTORY = "/lib/predmodels"; +- +- private static String SHIFTXP_DIR = ShiftXp.SHIFTX2_DIR; ++ private final static String MODEL_DIRECTORY = "predmodels"; + + HashMap hsmap_predmodel = new HashMap(); + +@@ -36,7 +34,7 @@ public class PredictionModels { + // System.out.println("SHIFTXP_DIR:" + SHIFTXP_DIR+"\n\n"); + // System.out.println("SHIFTX2_DIR:" + ShiftXp.SHIFTX2_DIR+"\n\n"); + +- String headerfilename = ShiftXp.SHIFTX2_DIR + "/lib/data-header.arff"; ++ String headerfilename = ShiftXp.GENTOO_SHARE_PATH + "/data-header.arff"; + + try { + // assigned instance header from data-header.arff +@@ -150,7 +148,7 @@ public class PredictionModels { + // if option is not sidechain only, put backbone models into modeling file + if ( ! this.prediction_type.equals("SIDECHAIN") ) { + for(int i=0; i < BACKBONE_MODEL_LENGTH; i++) { +- ois = new ObjectInputStream( new BufferedInputStream( new FileInputStream( ShiftXp.SHIFTX2_DIR + MODEL_DIRECTORY + "/" + modelFileArray[i]) )); ++ ois = new ObjectInputStream( new BufferedInputStream( new FileInputStream( ShiftXp.GENTOO_SHARE_PATH + "/" + MODEL_DIRECTORY + "/" + modelFileArray[i]) )); + classifier = (Classifier) ois.readObject(); + hsmap_predmodel.put(atomNameArray[i],classifier); + ois.close(); +@@ -160,7 +158,7 @@ public class PredictionModels { + // if option is not backbone only, put/append sidechain models into modeling file + if ( ! this.prediction_type.equals("BACKBONE") ) { + for(int i=BACKBONE_MODEL_LENGTH; i < (BACKBONE_MODEL_LENGTH + SIDECHAIN_MODEL_LENGTH); i++) { +- ois = new ObjectInputStream( new BufferedInputStream( new FileInputStream( ShiftXp.SHIFTX2_DIR + MODEL_DIRECTORY + "/" + modelFileArray[i]) )); ++ ois = new ObjectInputStream( new BufferedInputStream( new FileInputStream( ShiftXp.GENTOO_SHARE_PATH + "/" + MODEL_DIRECTORY + "/" + modelFileArray[i]) )); + classifier = (Classifier) ois.readObject(); + hsmap_predmodel.put(atomNameArray[i], classifier); + ois.close(); +@@ -185,11 +183,11 @@ public class PredictionModels { + */ + + if ( this.prediction_type.equals("ALL") == true) { +- model_file = ShiftXp.SHIFTX2_DIR + OBJECT_MODEL_DIRECTORY + "/" + MODEL_FILE_ALLATOMS; ++ model_file = ShiftXp.GENTOO_SHARE_PATH + "/" + MODEL_FILE_ALLATOMS; + } else if ( this.prediction_type.equals("BACKBONE") == true) { +- model_file = ShiftXp.SHIFTX2_DIR + OBJECT_MODEL_DIRECTORY + "/" + MODEL_FILE_BACKBONE_ONLY; ++ model_file = ShiftXp.GENTOO_SHARE_PATH + "/" + MODEL_FILE_BACKBONE_ONLY; + } else if ( this.prediction_type.equals("SIDECHAIN") == true) { +- model_file = ShiftXp.SHIFTX2_DIR + OBJECT_MODEL_DIRECTORY + "/" + MODEL_FILE_SIDECHAIN_ONLY; ++ model_file = ShiftXp.GENTOO_SHARE_PATH + "/" + MODEL_FILE_SIDECHAIN_ONLY; + } + + File f = new File( model_file ); +@@ -198,7 +196,7 @@ public class PredictionModels { + readHashObjectPredModelFile( model_file ); + } else { + setHashMap(); +- saveHashObjectPredModelFile( model_file ); ++// saveHashObjectPredModelFile( model_file ); + } + } + +diff --git a/shiftx2-v107-linux/src/RandomCoil.java b/shiftx2-v107-linux/src/RandomCoil.java +index 25a8999..7442938 100755 +--- a/shiftx2-v107-linux/src/RandomCoil.java ++++ b/shiftx2-v107-linux/src/RandomCoil.java +@@ -33,11 +33,9 @@ public class RandomCoil { + public void loadRandomCoil() { + + // change path as absolute path +- String SHIFTXP_DIR = ShiftXp.SHIFTX2_DIR; +- +- String filename = SHIFTXP_DIR + "/lib/RandomCoil.csv"; +- String objFilename = SHIFTXP_DIR + "/lib/RandomCoil.osf"; +- String objAtomListname = SHIFTXP_DIR + "/lib/RCoilAtomlist.osf"; ++ String filename = ShiftXp.GENTOO_SHARE_PATH + "/RandomCoil.csv"; ++ String objFilename = ShiftXp.GENTOO_SHARE_PATH + "/RandomCoil.osf"; ++ String objAtomListname = ShiftXp.GENTOO_SHARE_PATH + "/RCoilAtomlist.osf"; + + + File f = new File(objFilename); +@@ -85,8 +83,8 @@ public class RandomCoil { + br.close(); + + // save object into object file format for speed up +- saveObjectFile(objFilename, rcoil); +- saveObjectFile(objAtomListname, restypeAtomStringList); ++// saveObjectFile(objFilename, rcoil); ++// saveObjectFile(objAtomListname, restypeAtomStringList); + + } catch(IOException ex){ + ex.printStackTrace(); +diff --git a/shiftx2-v107-linux/src/ShiftXp.java b/shiftx2-v107-linux/src/ShiftXp.java +index 505a3f6..920f420 100755 +--- a/shiftx2-v107-linux/src/ShiftXp.java ++++ b/shiftx2-v107-linux/src/ShiftXp.java +@@ -27,7 +27,7 @@ public class ShiftXp { + static final boolean DEBUG = false; + static boolean RCOIL_PRINTOUT = false; + static String SHIFTX2_DIR = "."; // to support running on other directory +- ++ public static final String GENTOO_SHARE_PATH = "PUT_GENTOO_SHARE_PATH_HERE"; + // Loading only one time, that's why these are here + static RandomCoil rcoil = new RandomCoil(); + static LimitedCShift chkcshift = new LimitedCShift(); +@@ -140,8 +140,7 @@ public class ShiftXp { + + // check execute directory + // 2011.08.31 changed shiftx2_main.py --> shiftx2.py +- if ( !( new File( SHIFTX2_DIR + "/shiftx2.py").exists() +- && new File(SHIFTX2_DIR + "/lib/weka.jar").exists() ) ) { ++ if (!new File(SHIFTX2_DIR + "/shiftx2.py").exists()) { + + System.err.println("\n********************************************************************************"); + System.err.println("[Error]\t Required: When the SHIFTX2 execute on other directory,\n" diff --git a/sci-chemistry/shiftx2/metadata.xml b/sci-chemistry/shiftx2/metadata.xml index 8fb55f2..947e346 100644 --- a/sci-chemistry/shiftx2/metadata.xml +++ b/sci-chemistry/shiftx2/metadata.xml @@ -1,28 +1,39 @@ -sci - - SHIFTX2 predicts both the backbone and side chain 1H, 13C and 15N chemical - shifts for proteins using their structural (PDB) coordinates as input. - SHIFTX2 combines ensemble machine learning methods with sequence - alignment-based methods to calculate protein chemical shifts for backbone - and side chain atoms. SHIFTX2 has been trained on a carefully selected set of - 197 proteins and tested on a separate set of 61 proteins. Both the training - and testing sets consisted of high resolution X-ray structures (less 2.1A) - with carefully verified chemical shifts assignments. SHIFTX2 is able to attain - correlation coefficients between experimentally observed and predicted - backbone chemical shifts of 0.9800 (15N), 0.9959 (13CA), 0.9992 (13CB), - 0.9676 (13CO), 0.9714 (1HN), 0.9744 (1HA) and RMS errors of 1.1169, 0.4412, - 0.5163, 0.5330, 0.1711, and 0.1231 ppm, respectively. Comparisons to other - chemical shift predictors using the same testing data set indicates that - SHIFTX2 is substantially more accurate (up to 26% better by correlation - coefficient with an RMS error that is up to 3.3X smaller) than any other - program. + sci + + SHIFTX2 predicts both the backbone and side chain 1H, 13C and 15N chemical + shifts for proteins using their structural (PDB) coordinates as input. + SHIFTX2 combines ensemble machine learning methods with sequence + alignment-based methods to calculate protein chemical shifts for + backbone + and side chain atoms. SHIFTX2 has been trained on a carefully selected + set of + 197 proteins and tested on a separate set of 61 proteins. Both the + training + and testing sets consisted of high resolution X-ray structures (less + 2.1A) + with carefully verified chemical shifts assignments. SHIFTX2 is able to + attain + correlation coefficients between experimentally observed and predicted + backbone chemical shifts of 0.9800 (15N), 0.9959 (13CA), 0.9992 (13CB), + 0.9676 (13CO), 0.9714 (1HN), 0.9744 (1HA) and RMS errors of 1.1169, 0.4412, + 0.5163, 0.5330, 0.1711, and 0.1231 ppm, respectively. Comparisons to + other + chemical shift predictors using the same testing data set indicates that + SHIFTX2 is substantially more accurate (up to 26% better by + correlation + coefficient with an RMS error that is up to 3.3X smaller) than any other + program. - Please cite the following: Beomsoo Han, Yifeng Liu, Simon Ginzinger, and - David Wishart. (2011) SHIFTX2: significantly improved protein chemical shift - prediction. Journal of Biomolecular NMR, Volume 50, Number 1, 43-57. - doi: 10.1007/s10858-011-9478-4. - + Please cite the following: Beomsoo Han, Yifeng Liu, Simon Ginzinger, and + David Wishart. (2011) SHIFTX2: significantly improved protein chemical + shift + prediction. Journal of Biomolecular NMR, Volume 50, Number 1, 43-57. + doi: 10.1007/s10858-011-9478-4. + + + Enables debug output in the shiftx2 java part + diff --git a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild index b13677b..e9cb4c7 100644 --- a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild +++ b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild @@ -19,7 +19,7 @@ SRC_URI="http://shiftx2.wishartlab.com/download/${MY_P}-${MY_PATCH}.tgz" SLOT="0" LICENSE="all-rights-reserved" KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" -IUSE="" +IUSE="debug" CDEPEND="dev-util/weka" @@ -31,44 +31,74 @@ DEPEND="${CDEPEND} S="${WORKDIR}"/${MY_P} +src_prepare() { + epatch "${FILESDIR}/gentoo-fixes.patch" + rm "${S}"/src/FeatureRanges.java || die + + shared=$(echo "/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 + sed -i -e 's/DEBUG = false/DEBUG = true/g' "${S}/src/ShiftXp.java" || die + fi + + # hack alert! + sed '/-o/s:$: -lm:g' -i "${S}/modules/resmf/Makefile" || die +} + src_compile() { mkdir "${S}"/build || die - ejavac -classpath "$(java-pkg_getjars weka)" -nowarn -d "${S}"/build $(find src/ -name "*.java") + ejavac -classpath "$(java-pkg_getjars weka)" -nowarn \ + -d "${S}"/build $(find src/ -name "*.java") jar cf "${PN}.jar" -C "${S}"/build . || die - ejavac -cp $(java-pkg_getjars weka):. -Xlint ShiftXp.java - + einfo "Building module angles" cd "${S}"/modules/angles || die emake clean emake CFLAGS="${CFLAGS}" GCC=$(tc-getCC) LINK="${LDFLAGS}" get_angles phipsi + einfo "Building module resmf" + cd "${S}"/modules/resmf || die + emake clean + emake CFLAGS="${CFLAGS}" GCC=$(tc-getCC) LINK="${LDFLAGS}" resmf + + einfo "Building module effects" + cd "${S}"/modules/effects || die + emake clean + emake CFLAGS="${CFLAGS}" GCC=$(tc-getCC) LINK="${LDFLAGS}" all } src_install() { - java-pkg_dolauncher ${PN} --main "ShiftXp" + java-pkg_dojar "${PN}.jar" + java-pkg_dolauncher ${PN} --main "ShiftXp" --pkg_args "-dir ${EPREFIX}/usr/bin" + insinto /usr/share/${PN} + doins "${S}"/lib/{limitedcshift.dat,RandomCoil.csv,data-header.arff} + doins -r "${S}"/lib/predmodels + + insinto /usr/share/${PN}/vader + doins -r "${S}"/modules/resmf/lib/* local instdir="/opt/${PN}" dodoc README 1UBQ.pdb - python_parallel_foreach_impl python_doscript *py + python_parallel_foreach_impl python_doscript "${S}"/*py # modules/angles cd "${S}"/modules/angles || die dobin get_angles phipsi + # other modules + dobin "${S}"/modules/resmf/resmf "${S}"/modules/effects/caleffect # script python_scriptinto ${instdir}/script - python_parallel_foreach_impl python_doscript script/*py + python_parallel_foreach_impl python_doscript "${S}"/script/*py exeinto ${instdir}/script - doexe script/*.r - + doexe "${S}"/script/*.r # shifty3 - insinto ${instdir} - doins -r shifty3 python_scriptinto ${instdir}/shifty3 - python_parallel_foreach_impl python_doscript shifty3/*py + python_parallel_foreach_impl python_doscript "${S}"/shifty3/*py exeinto ${instdir}/shifty3 - doexe shifty3/xalign_x + doexe "${S}"/shifty3/xalign_x }