[med-svn] [giira] 01/01: remove cplex code with patch and force use of glpk instead of cplex

Olivier Sallou osallou at debian.org
Sat Feb 8 08:23:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

osallou pushed a commit to branch master
in repository giira.

commit b56cd9a841999d8720a2818fc0a1c99db1c0aa9e
Author: Olivier Sallou <olivier.sallou at debian.org>
Date:   Sat Feb 8 09:22:59 2014 +0100

    remove cplex code with patch and force use of glpk instead of cplex
---
 debian/changelog                 |   3 +-
 debian/control                   |   2 +-
 debian/patches/remove_cplex_code | 136 +++++++++++++++++++++++++++++++++++++++
 debian/patches/series            |   1 +
 4 files changed, 140 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7245ac5..0cbb461 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ giira (0.0.20131015-1) UNRELEASED; urgency=low
 
   Olivier Sallou Remarks:
 
-  Software needs Cplex to compile. Gonna test to remove references in code to use only glpk.
+  Software needs Cplex to compile. removed references in code to use only glpk.
+  Created a ticket upstream (https://sourceforge.net/p/giira/tickets/1/) to know where CigarParser comes from. It is used but I could not found any local class nor library providing it.
 
  -- Andreas Tille <tille at debian.org>  Fri, 07 Feb 2014 11:38:38 +0100
diff --git a/debian/control b/debian/control
index 6d57998..7d9a19e 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,7 @@ Package: giira
 Architecture: any
 Depends: ${misc:Depends},
          ${java:Depends},
-         glpk,
+         glpk-utils,
          libglpk-java
 Description: RNA-Seq driven gene finding incorporating ambiguous reads 
  GIIRA is a gene prediction method that identifies potential coding
diff --git a/debian/patches/remove_cplex_code b/debian/patches/remove_cplex_code
new file mode 100644
index 0000000..d68b61d
--- /dev/null
+++ b/debian/patches/remove_cplex_code
@@ -0,0 +1,136 @@
+Subject: remove Cplex code
+Description: upstream makes use of Cplex Java library which is not
+ free. Glpk can be used as an alternative.
+ Update code to use glpk as only default option and remove cplex code
+ to allow compilation
+Author: Olivier Sallou <osallou at debian.org>
+Last-Updated: 2014-02-08
+Forwarded: no
+--- a/src/geneFinder/OptimizeAmbis.java
++++ b/src/geneFinder/OptimizeAmbis.java
+@@ -1,7 +1,5 @@
+ package geneFinder;
+ 
+-import ilog.concert.IloException;
+-import ilog.cplex.IloCplex;
+ 
+ import java.io.*;
+ import java.util.HashMap;
+@@ -376,48 +374,7 @@
+ 	 */
+ 	
+ 	public static void solveMaxFlowWithCPLEX(int numMulti){
+-		
+-		try {
+-			System.out.println("Start cplex solve...");
+-			IloCplex cplex = new IloCplex();
+-
+-			cplex.importModel(GeneFinder.pathOut+"resultsRun/input_it" + GeneFinder.iteration + ".lp");
+-			
+-			cplex.setParam(IloCplex.IntParam.RootAlg,IloCplex.Algorithm.Network);
+-			cplex.setParam(IloCplex.DoubleParam.EpGap,0.01);
+-			cplex.setParam(IloCplex.IntParam.Threads,GeneFinder.numberThreads);
+-			
+-			if(numMulti >= 10000000){
+-				
+-				if(GeneFinder.memForCplex != -1){
+-					cplex.setParam(IloCplex.DoubleParam.WorkMem,GeneFinder.memForCplex);
+-				}
+-				
+-				cplex.setParam(IloCplex.StringParam.WorkDir,GeneFinder.pathOut+"resultsRun/");
+-				System.out.println("Directory: " + cplex.getParam(IloCplex.StringParam.WorkDir));
+-				
+-				cplex.setParam(IloCplex.DoubleParam.PolishTime,1000.0);
+-				System.out.println("polish time: " + cplex.getParam(IloCplex.DoubleParam.PolishTime));
+-				
+-				cplex.setParam(IloCplex.IntParam.HeurFreq,-1);
+-				
+-				cplex.setParam(IloCplex.IntParam.NodeFileInd,3);
+-				System.out.println(cplex.getParam(IloCplex.IntParam.NodeFileInd));
+-				
+-				cplex.setParam(IloCplex.BooleanParam.MemoryEmphasis,true);
+-				System.out.println(cplex.getParam(IloCplex.BooleanParam.MemoryEmphasis));
+-				
+-			}
+-			
+-			cplex.solve();
+-
+-			cplex.writeSolution(GeneFinder.pathOut+"resultsRun/solutionCPLEX_it" + GeneFinder.iteration + ".sol");
+-
+-
+-		} catch (IloException e2) {
+-			e2.printStackTrace();
+-		}
+-		
++		System.err.println("CPLEX implementation not available");
+ 	}
+ 	
+ 	/*
+--- a/src/geneFinder/Operon_LP.java
++++ b/src/geneFinder/Operon_LP.java
+@@ -9,8 +9,6 @@
+  *
+  */
+ 
+-import ilog.concert.IloException;
+-import ilog.cplex.IloCplex;
+ 
+ import java.io.*;
+ import java.util.Vector;
+@@ -256,22 +254,7 @@
+ 	 */
+ 
+ 	public static void solveOperonLPWithCPLEX(){
+-
+-		try {
+-			IloCplex cplex = new IloCplex();
+-			cplex.setOut(null);
+-			cplex.importModel(GeneFinder.pathOut+"resultsRun/input_operonLP.lp");
+-			cplex.setParam(IloCplex.IntParam.Threads,GeneFinder.numberThreads);
+-
+-			cplex.solve();
+-
+-			cplex.writeSolution(GeneFinder.pathOut+"resultsRun/solution_operonLP.sol");
+-
+-
+-		} catch (IloException e2) {
+-			e2.printStackTrace();
+-		}
+-
++		System.err.println("CPLEX implementation not available");
+ 	}
+ 
+ 	/*
+--- a/src/geneFinder/ReadInParameters_GeneFinder.java
++++ b/src/geneFinder/ReadInParameters_GeneFinder.java
+@@ -242,9 +242,8 @@
+ 						GeneFinder.useGLPK = true;
+ 						inputText += "Using glpk for ambiguous read optimization.\n";
+ 					} else{
+-						GeneFinder.useCPLEX = true;
+-						GeneFinder.useGLPK = false;
+-						inputText += "Using cplex for ambiguous read optimization.\n";
++						System.err.println("CPLEX implementation not available");
++						return;
+ 					}
+ 				} else if(arg.equals("-mem")){
+ 					GeneFinder.memForCplex = Integer.parseInt(args[i+1]);			
+@@ -376,7 +375,8 @@
+ 			GeneFinder.noAmbiOpti = false;
+ 		}
+ 		if(!foundOptiMethod){
+-			GeneFinder.useCPLEX = true;
++			GeneFinder.useCPLEX = false;
++			GeneFinder.useGLPK = true;
+ 		}
+ 		if(!foundSolveOn){
+ 			GeneFinder.optiSolve = true;
+@@ -458,8 +458,6 @@
+ 				" \n -haveSam [samfileName]: if a sam file already exists, provide the name, else a mapping is performed. NOTE: the sam file has to be sorted according to read names! \n" +
+ 				" \n -nT [numberThreads] : specify the maximal number of threads that are allowed to be used, DEFAULT: 1 \n" +
+ 				" \n -mT [tophat/bwa/bwasw] : specify desired tool for the read mapping, DEFAULT: tophat \n" +
+-				" \n -opti [cplex/glpk] : specify the desired optimization method, either using CPLEX optimizer (cplex, DEFAULT) or glpk solver (glpk) \n" +
+-				" \n -libPath [PATH] : if cplex is the desired optimizer, specify the absolute path to the cplex library Djava.library.path \n" +
+ 				" \n -cp [PATH] : if cplex is the desired optimizer, specify the absolute path to the cplex jar file cplex.jar\n" +
+ 				//" \n -splitRunAndOpti [y/n] : indicates if the optimization and giira shall be run separately, to reduce the memory consumption (y), DEFAULT: n" +
+ 				" \n -mem [int] : specify the amount of memory that cplex is allowed to use \n" +
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..eb35575
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+remove_cplex_code

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/giira.git



More information about the debian-med-commit mailing list