aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2013-06-16 19:22:53 +0200
committerJustin Lecher <jlec@gentoo.org>2013-06-16 19:22:53 +0200
commit1e83a4dec123f72a098067d9b7fc003f45aeabbe (patch)
treed59da2b2019ab7e93315009a423a8ae4016b3fb4 /sci-chemistry
parentsci-chemistry/pymol-plugins-psico: Bump to EAPI=5 and distutils-r1.eclass (diff)
parentsci-chemistry/shiftx2: Respect FLAGS (diff)
downloadsci-1e83a4dec123f72a098067d9b7fc003f45aeabbe.tar.gz
sci-1e83a4dec123f72a098067d9b7fc003f45aeabbe.tar.bz2
sci-1e83a4dec123f72a098067d9b7fc003f45aeabbe.zip
Merge branch 'ercpe'
* ercpe: sci-chemistry/shiftx2: Respect FLAGS Enhanced the sci-chemistry/shiftx ebuild. Still needs some love for the emake part (portage complains about LDFLAGS not respected), but should work. broken ebuild for java fixing Signed-off-by: Justin Lecher <jlec@gentoo.org>
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/shiftx2/ChangeLog8
-rw-r--r--sci-chemistry/shiftx2/Manifest1
-rw-r--r--sci-chemistry/shiftx2/files/gentoo-fixes.patch194
-rw-r--r--sci-chemistry/shiftx2/metadata.xml39
-rw-r--r--sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild112
5 files changed, 354 insertions, 0 deletions
diff --git a/sci-chemistry/shiftx2/ChangeLog b/sci-chemistry/shiftx2/ChangeLog
new file mode 100644
index 000000000..5aafaf3ca
--- /dev/null
+++ b/sci-chemistry/shiftx2/ChangeLog
@@ -0,0 +1,8 @@
+# ChangeLog for sci-chemistry/shiftx2
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 16 Jun 2013; Justin Lecher <jlec@gentoo.org> shiftx2-1.07_p20120106.ebuild,
+ metadata.xml:
+ Respect FLAGS
+
diff --git a/sci-chemistry/shiftx2/Manifest b/sci-chemistry/shiftx2/Manifest
new file mode 100644
index 000000000..94fd67e47
--- /dev/null
+++ b/sci-chemistry/shiftx2/Manifest
@@ -0,0 +1 @@
+DIST shiftx2-v107-linux-20120106.tgz 114164215 SHA256 47bd11f00c824967738f72a02387b47eafc60a10697aa157e27163f2edbf9927 SHA512 b1fa6ce19e988a938e6645fdbd14f7903b4db13754a476c67da0bf74909675e07b7cec4df63be30d7190ea645e8822eef551e6dd26625172e585da279f1f7396 WHIRLPOOL 20fc5ea052106e2f6f708ba61da2ad9310a50a1c85dfb46d947c919d665835cc43180267094c057b7ce542b59659a1b44940c762c4c8e190cdbb7727dc30c865
diff --git a/sci-chemistry/shiftx2/files/gentoo-fixes.patch b/sci-chemistry/shiftx2/files/gentoo-fixes.patch
new file mode 100644
index 000000000..2baa443c5
--- /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<String, Classifier> hsmap_predmodel = new HashMap<String, Classifier>();
+
+@@ -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
new file mode 100644
index 000000000..80444f44b
--- /dev/null
+++ b/sci-chemistry/shiftx2/metadata.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci</herd>
+ <longdescription>
+ 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.
+ </longdescription>
+ <use>
+ <flag name="debug">Enables debug output in the shiftx2 java part</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild
new file mode 100644
index 000000000..5a19e4b0b
--- /dev/null
+++ b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit java-pkg-2 java-pkg-simple python-r1 versionator
+
+MY_PV="$(delete_all_version_separators $(get_version_component_range 1-2))"
+MY_PATCH="20120106"
+MY_P="${PN}-v${MY_PV}-linux"
+
+DESCRIPTION="Predicts both the backbone and side chain 1H, 13C and 15N chemical shifts for proteins"
+HOMEPAGE="http://shiftx2.wishartlab.com/"
+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="debug"
+
+CDEPEND="dev-util/weka"
+
+RDEPEND="${CDEPEND}
+ dev-lang/R
+ sci-chemistry/reduce
+ >=virtual/jre-1.5"
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.5"
+
+S="${WORKDIR}"/${MY_P}
+
+QA_PREBUILT="/opt/.*"
+
+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 \
+ -e '/-o/s:$(GCC):$(GCC) $(LDFLAGS):g' \
+ -e '/-o/s:$(CC):$(CC) $(LDFLAGS):g' \
+ -i modules/*/Makefile || die
+
+ sed -e '/-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")
+ jar cf "${PN}.jar" -C "${S}"/build . || die
+
+ 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}" CC=$(tc-getCC) LINK="${LDFLAGS}" all
+}
+
+src_install() {
+ 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 "${S}"/*py
+
+ # other modules
+ dobin \
+ "${S}"/modules/angles/{get_angles,phipsi} \
+ "${S}"/modules/resmf/resmf \
+ "${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
+ exeinto ${instdir}/shifty3
+ doexe "${S}"/shifty3/xalign_x
+ dosym ../${PN}/shifty3/xalign_x /opt/bin/xalign_x
+}