public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: sci-chemistry/shiftx2/, sci-chemistry/shiftx2/files/
@ 2015-10-23 10:32 Justin Lecher
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Lecher @ 2015-10-23 10:32 UTC (permalink / raw
  To: gentoo-commits

commit:     5923310384f4106c3980b94e82fb9e90e96ea3c0
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 23 10:32:52 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Fri Oct 23 10:32:52 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=59233103

sci-chemistry/shiftx2: Fix for using glibc internal namings and format-security

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../shiftx2-1.07_p20120106-format-security.patch   | 16 ++++++++++++++
 .../shiftx2-1.07_p20120106-internal-name.patch     | 25 ++++++++++++++++++++++
 .../shiftx2/shiftx2-1.07_p20120106.ebuild          |  6 ++++--
 3 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-format-security.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-format-security.patch
new file mode 100644
index 0000000..fc4a61e
--- /dev/null
+++ b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-format-security.patch
@@ -0,0 +1,16 @@
+ modules/resmf/libc/misc.lib.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/resmf/libc/misc.lib.c b/modules/resmf/libc/misc.lib.c
+index 0ef12a4..1e22424 100755
+--- a/modules/resmf/libc/misc.lib.c
++++ b/modules/resmf/libc/misc.lib.c
+@@ -71,7 +71,7 @@ void show_msg(msg)
+ char	*msg;
+ {
+ 
+-	fprintf(stdout, msg);
++	fprintf(stdout, "%s", msg);
+ 
+ }	/* show_msg */
+ 

diff --git a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-internal-name.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-internal-name.patch
new file mode 100644
index 0000000..4fa5447
--- /dev/null
+++ b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-internal-name.patch
@@ -0,0 +1,25 @@
+ modules/resmf/hydropho_cal.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/resmf/hydropho_cal.c b/modules/resmf/hydropho_cal.c
+index 1fde394..a889d08 100755
+--- a/modules/resmf/hydropho_cal.c
++++ b/modules/resmf/hydropho_cal.c
+@@ -184,7 +184,7 @@ float hydroscore(Hydroscale *scale, char residue){
+ }
+ 
+ /* function for copying string */
+-char * strndup (const char *s, size_t n)
++char * new_strndup (const char *s, size_t n)
+ {
+   char *result;
+   size_t len = strlen (s);
+@@ -206,7 +206,7 @@ char* substring(const char* str, size_t begin, size_t len)
+ {
+   if (str == 0 || strlen(str) == 0 || strlen(str) < begin || strlen(str) < (begin+len))
+     return 0;
+-  return (char *) strndup(str + begin, len);
++  return (char *) new_strndup(str + begin, len);
+ }
+ 
+ /* calculate the average value from begin to end in the given array */

diff --git a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild
index 9baabd4..b56d269 100644
--- a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild
+++ b/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -41,7 +41,9 @@ QA_PREBUILT="/opt/.*"
 src_prepare() {
 	epatch \
 		"${FILESDIR}"/${P}-java.patch \
-		"${FILESDIR}"/${P}-system.patch
+		"${FILESDIR}"/${P}-system.patch \
+		"${FILESDIR}"/${P}-internal-name.patch \
+		"${FILESDIR}"/${P}-format-security.patch
 
 	rm "${S}"/src/FeatureRanges.java || die
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-chemistry/shiftx2/, sci-chemistry/shiftx2/files/
@ 2020-09-28  8:58 Horea Christian
  0 siblings, 0 replies; 3+ messages in thread
From: Horea Christian @ 2020-09-28  8:58 UTC (permalink / raw
  To: gentoo-commits

commit:     0c41dce4e820d00f5ec7ada1bd8a796c9849c2f4
Author:     Horea Christian <chr <AT> chymera <DOT> eu>
AuthorDate: Mon Sep 28 08:45:07 2020 +0000
Commit:     Horea Christian <horea.christ <AT> gmail <DOT> com>
CommitDate: Mon Sep 28 08:45:07 2020 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=0c41dce4

sci-chemistry/shiftx2: removed discontinued package

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Horea Christian <chr <AT> chymera.eu>

 .../shiftx2-1.07_p20120106-format-security.patch   |  16 --
 .../shiftx2-1.07_p20120106-internal-name.patch     |  25 ---
 .../files/shiftx2-1.07_p20120106-java.patch        | 227 --------------------
 .../files/shiftx2-1.07_p20120106-system.patch      | 231 ---------------------
 sci-chemistry/shiftx2/metadata.xml                 |  42 ----
 .../shiftx2/shiftx2-1.07_p20120106.ebuild          | 130 ------------
 6 files changed, 671 deletions(-)

diff --git a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-format-security.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-format-security.patch
deleted file mode 100644
index fc4a61eb5..000000000
--- a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-format-security.patch
+++ /dev/null
@@ -1,16 +0,0 @@
- modules/resmf/libc/misc.lib.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/resmf/libc/misc.lib.c b/modules/resmf/libc/misc.lib.c
-index 0ef12a4..1e22424 100755
---- a/modules/resmf/libc/misc.lib.c
-+++ b/modules/resmf/libc/misc.lib.c
-@@ -71,7 +71,7 @@ void show_msg(msg)
- char	*msg;
- {
- 
--	fprintf(stdout, msg);
-+	fprintf(stdout, "%s", msg);
- 
- }	/* show_msg */
- 

diff --git a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-internal-name.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-internal-name.patch
deleted file mode 100644
index 4fa5447db..000000000
--- a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-internal-name.patch
+++ /dev/null
@@ -1,25 +0,0 @@
- modules/resmf/hydropho_cal.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules/resmf/hydropho_cal.c b/modules/resmf/hydropho_cal.c
-index 1fde394..a889d08 100755
---- a/modules/resmf/hydropho_cal.c
-+++ b/modules/resmf/hydropho_cal.c
-@@ -184,7 +184,7 @@ float hydroscore(Hydroscale *scale, char residue){
- }
- 
- /* function for copying string */
--char * strndup (const char *s, size_t n)
-+char * new_strndup (const char *s, size_t n)
- {
-   char *result;
-   size_t len = strlen (s);
-@@ -206,7 +206,7 @@ char* substring(const char* str, size_t begin, size_t len)
- {
-   if (str == 0 || strlen(str) == 0 || strlen(str) < begin || strlen(str) < (begin+len))
-     return 0;
--  return (char *) strndup(str + begin, len);
-+  return (char *) new_strndup(str + begin, len);
- }
- 
- /* calculate the average value from begin to end in the given array */

diff --git a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-java.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-java.patch
deleted file mode 100644
index ea64cea2d..000000000
--- a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-java.patch
+++ /dev/null
@@ -1,227 +0,0 @@
-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();
-@@ -41,7 +41,7 @@ public class ShiftXp {
-         buf.append("Detail information: http://www.shiftx2.ca or http://redpoll.pharmacy.ualberta.ca\n");
-         buf.append("--------------------------------------------------------------------------------\n\n");
- 
--        buf.append("SYNOPSIS\n\t java -Xmx1500m -cp <SHIFTX+ dir>/bin:<SHIFTX+ dir>/lib/weka.jar ShiftXp [options]\n");
-+        buf.append("SYNOPSIS\n\t jshiftx2 [options]\n");
- 
-         buf.append("OPTIONS:\n");
-         buf.append("\t -i [<directory/> infile.pdb | ALLPDB]\n");
-@@ -54,10 +54,10 @@ public class ShiftXp {
-         buf.append("\t -temp <number>        Temperature, default=298\n");
-         buf.append("\t -d [TRUE | FALSE]  Deuterated pdb, default=FALSE \n"); 
-         buf.append("\t -r [TRUE | FALSE]  Print randon coild shift (only for CSV format), default=FALSE \n"); 
--        buf.append("\t -dir <SHIFTX+ directory>  The installed directory of SHIFTX+/SHIFTX2\n\n");
-+//        buf.append("\t -dir <SHIFTX+ directory>  The installed directory of SHIFTX+/SHIFTX2\n\n");
- 
-         buf.append("EXAMPLE:\n");
--        buf.append("\t java -Xmx1500m -cp ~/shiftx2/bin:~/shiftx2/lib/weka.jar ShiftXp -i 1ubq.pdb\n\n");
-+        buf.append("\t jshiftx2 -i 1ubq.pdb\n\n");
-         buf.append("\n");
- 
-         System.out.println( buf );
-@@ -138,20 +138,6 @@ 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() )  )  {
--
--           System.err.println("\n********************************************************************************");
--           System.err.println("[Error]\t Required: When the SHIFTX2 execute on other directory,\n"
--                             +"\t it should be set as a parameter. Use '-dir' option.");
--           System.err.println("> Current directory: "+System.getProperty("user.dir"));
--           System.err.println("********************************************************************************\n");
--
--           usage();
--        }
--
-         if ( inPDBFile == null || inPDBFile.length() < 1)  {
-            System.err.println("\n********************************************************************************");
-            System.err.println("[Error] Required: There is no input PDB filename.");

diff --git a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-system.patch b/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-system.patch
deleted file mode 100644
index 7625f7442..000000000
--- a/sci-chemistry/shiftx2/files/shiftx2-1.07_p20120106-system.patch
+++ /dev/null
@@ -1,231 +0,0 @@
- 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 -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 -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 -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/metadata.xml b/sci-chemistry/shiftx2/metadata.xml
deleted file mode 100644
index e35d2bc02..000000000
--- a/sci-chemistry/shiftx2/metadata.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-	<maintainer type="project">
-		<email>sci-chemistry@gentoo.org</email>
-		<name>Gentoo Chemistry Project</name>
-	</maintainer>
-	<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
deleted file mode 100644
index 2b7a478af..000000000
--- a/sci-chemistry/shiftx2/shiftx2-1.07_p20120106.ebuild
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-PYTHON_COMPAT=( python2_7 )
-
-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"
-MY_P="${PN}-v${MY_PV}-linux"
-
-DESCRIPTION="Predicts of backbone and side chain 1H, 13C and 15N CS 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"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-CDEPEND="dev-util/weka ${PYTHON_DEPS}"
-
-RDEPEND="${CDEPEND}
-	${PYTHON_DEPS}
-	dev-lang/R
-	sci-biology/ncbi-tools
-	sci-chemistry/reduce
-	>=virtual/jre-1.5"
-DEPEND="${CDEPEND}
-	>=virtual/jdk-1.5"
-
-S="${WORKDIR}"/${MY_P}
-
-QA_PREBUILT="/opt/.*"
-
-src_prepare() {
-	epatch \
-		"${FILESDIR}"/${P}-java.patch \
-		"${FILESDIR}"/${P}-system.patch \
-		"${FILESDIR}"/${P}-internal-name.patch \
-		"${FILESDIR}"/${P}-format-security.patch
-
-	rm "${S}"/src/FeatureRanges.java || die
-
-	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
-		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
-
-	eprefixify ${PN}.py
-}
-
-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 j${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_foreach_impl python_newscript ${PN}.py ${PN}
-	mv shiftx2_util.py shiftx2util.py || die
-	python_moduleinto ${PN}
-	touch __init__.py
-	python_foreach_impl python_domodule natsorted.py shiftx2util.py __init__.py
-
-	# other modules
-	dobin \
-		"${S}"/modules/angles/{get_angles,phipsi} \
-		"${S}"/modules/resmf/resmf \
-		"${S}"/modules/effects/caleffect
-
-	# script
-	python_foreach_impl python_doscript "${S}"/script/*py
-	exeinto ${instdir}/script
-	doexe "${S}"/script/*.r
-
-	# shifty3
-	python_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_foreach_impl python_doscript "${S}"/shifty3/utils/*py
-	dobin "${S}"/shifty3/utils/create_blastdb.sh
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-chemistry/shiftx2/, sci-chemistry/shiftx2/files/
@ 2013-06-16 17:23 Justin Lecher
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Lecher @ 2013-06-16 17:23 UTC (permalink / raw
  To: gentoo-commits

commit:     a5dea0ab4d52cd3e3c205d4bdb9ad1e8fe48f662
Author:     Johann Schmitz <johann <AT> j-schmitz <DOT> net>
AuthorDate: Sun Jun 16 16:55:30 2013 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> 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<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
index 8fb55f2..947e346 100644
--- a/sci-chemistry/shiftx2/metadata.xml
+++ b/sci-chemistry/shiftx2/metadata.xml
@@ -1,28 +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. 
+	<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>
+		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
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
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-28  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-23 10:32 [gentoo-commits] proj/sci:master commit in: sci-chemistry/shiftx2/, sci-chemistry/shiftx2/files/ Justin Lecher
  -- strict thread matches above, loose matches on Subject: below --
2020-09-28  8:58 Horea Christian
2013-06-16 17:23 Justin Lecher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox