[med-svn] [pirs] 02/02: Find Profiles at Debian install location

Andreas Tille tille at debian.org
Wed Aug 3 06:53:35 UTC 2016


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

tille pushed a commit to branch master
in repository pirs.

commit c6efa5c0b041dde3559038ad41a207e95d7d3401
Author: Andreas Tille <tille at debian.org>
Date:   Wed Aug 3 08:48:09 2016 +0200

    Find Profiles at Debian install location
---
 debian/patches/adjust_profiles_path.patch | 178 ++++++++++++++++++++++++++++++
 debian/patches/series                     |   1 +
 2 files changed, 179 insertions(+)

diff --git a/debian/patches/adjust_profiles_path.patch b/debian/patches/adjust_profiles_path.patch
new file mode 100644
index 0000000..4434e8b
--- /dev/null
+++ b/debian/patches/adjust_profiles_path.patch
@@ -0,0 +1,178 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Tue, 02 Aug 2016 12:12:20 +0200
+Description: Find Profiles at Debian install location
+ Note: The upstream code is a bit unfortunate since it checks for a '/' in
+ the called executable which fails if pirs is simply in the PATH.  These
+ checks needed to be deleted completely.
+ .
+ Also the variables set in Makefile.am seem not to be used and the header
+ file needed patching as well.  This could be done more elegantly but as long
+ as there is non-distributable code inside the software (see debian/copyright)
+ it is at this "works for the moment" base.
+
+--- a/src/pirs/src/Makefile.am
++++ b/src/pirs/src/Makefile.am
+@@ -1,8 +1,8 @@
+-profile1dir=$(prefix)/Profiles/InDel_Profiles
++profile1dir=/usr/share/pirs/Profiles/InDel_Profiles
+ profile1_DATA=Profiles/InDel_Profiles/*
+-profile2dir=$(prefix)/Profiles/Base-Calling_Profiles
++profile2dir=/usr/share/pirs/Profiles/Base-Calling_Profiles
+ profile2_DATA=Profiles/Base-Calling_Profiles/*
+-profile3dir=$(prefix)/Profiles/GC-depth_Profiles
++profile3dir=/usr/share/pirs/Profiles/GC-depth_Profiles
+ profile3_DATA=Profiles/GC-depth_Profiles/*
+ 
+ AUTOMAKE_OPTIONS=gnu
+--- a/src/pirs/src/load_file.cpp
++++ b/src/pirs/src/load_file.cpp
+@@ -138,14 +138,7 @@ void preview_BaseCalling_profile (PARAME
+ 	string matrix_file;
+ 	
+ 	if(InputParameter.BaseCalling_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+-  		string directory_path = exe_path.substr(0,index);
+-  		matrix_file = directory_path + BASE_CALLING_PROFILE;
+-  	}
++  		matrix_file = BASE_CALLING_PROFILE;
+ 	}else{
+ 		matrix_file = InputParameter.BaseCalling_profile;
+ 	}
+@@ -248,14 +241,7 @@ void transform_quality_by_error_rate(PAR
+ 	}
+ 	
+ 	if(InputParameter.BaseCalling_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+-  		string directory_path = exe_path.substr(0,index);
+-  		matrix_file = directory_path + BASE_CALLING_PROFILE;
+-  	}
++                matrix_file = BASE_CALLING_PROFILE;
+ 	}else{
+ 		matrix_file = InputParameter.BaseCalling_profile;
+ 	}
+@@ -377,14 +363,7 @@ void preview_InDel_error_profile (PARAME
+ 	string matrix_file;
+ 	
+ 	if(InputParameter.InDel_error_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+-  		string directory_path = exe_path.substr(0,index);
+-  		matrix_file = directory_path + INDEL_ERROR_PROFILE;
+-  	}
++                matrix_file = INDEL_ERROR_PROFILE;
+ 	}else{
+ 		matrix_file = InputParameter.InDel_error_profile;
+ 	}
+@@ -441,14 +420,7 @@ string load_InDel_error_profile(PARAMETE
+ 	string matrix_file;
+ 	
+ 	if(InputParameter.InDel_error_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+-  		string directory_path = exe_path.substr(0,index);
+-  		matrix_file = directory_path + INDEL_ERROR_PROFILE;
+-  	}
++                matrix_file = INDEL_ERROR_PROFILE;
+ 	}else{
+ 		matrix_file = InputParameter.InDel_error_profile;
+ 	}
+@@ -607,14 +579,7 @@ string load_BaseCalling_profile1(PARAMET
+ {
+ 	string matrix_file;
+ 	if(InputParameter.BaseCalling_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+-  		string directory_path = exe_path.substr(0,index);
+-  		matrix_file = directory_path + BASE_CALLING_PROFILE;
+-  	}
++                matrix_file = BASE_CALLING_PROFILE;
+ 	}else{
+ 		matrix_file = InputParameter.BaseCalling_profile;
+ 	}
+@@ -719,14 +684,7 @@ string load_BaseCalling_profile2(PARAMET
+ {
+ 	string matrix_file;
+ 	if(InputParameter.BaseCalling_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+-  		string directory_path = exe_path.substr(0,index);
+-  		matrix_file = directory_path + BASE_CALLING_PROFILE;
+-  	}
++                matrix_file = BASE_CALLING_PROFILE;
+ 	}else{
+ 		matrix_file = InputParameter.BaseCalling_profile;
+ 	}
+@@ -891,14 +849,7 @@ string load_BaseCalling_profile3(PARAMET
+ {
+ 	string matrix_file;
+ 	if(InputParameter.BaseCalling_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+-  		string directory_path = exe_path.substr(0,index);
+-  		matrix_file = directory_path + BASE_CALLING_PROFILE;
+-  	}
++                matrix_file = BASE_CALLING_PROFILE;
+ 	}else{
+ 		matrix_file = InputParameter.BaseCalling_profile;
+ 	}
+@@ -1032,11 +983,6 @@ string load_GC_depth_profile (PARAMETER
+ 	string depth_file;
+ 	
+ 	if(InputParameter.GC_depth_profile == ""){
+-  	int index = exe_path.find_last_of('/');
+-  	if(index == -1){
+-  		cerr<<"Error: program path wrong!"<<endl;
+-  	}
+-  	else{
+   		//The default GC bias profile are determined based on the twice length of read
+   		string GC_depth_profile_name;
+ 			int window_size = InputParameter.Read_length * 2;
+@@ -1049,9 +995,7 @@ string load_GC_depth_profile (PARAMETER
+     			GC_depth_profile_name = GC_DEPTH200_PROFILE;
+     		}
+     	}
+-  		string directory_path = exe_path.substr(0,index);
+-  		depth_file = directory_path + GC_DEPTH_PROFILE_PATH+GC_depth_profile_name;
+-  	}
++  		depth_file = GC_DEPTH_PROFILE_PATH+GC_depth_profile_name;
+ 	}else{
+ 		depth_file = InputParameter.GC_depth_profile;
+ 	}
+--- a/src/pirs/src/load_file.h
++++ b/src/pirs/src/load_file.h
+@@ -5,9 +5,9 @@
+ 
+ using namespace std;
+ 
+-#define BASE_CALLING_PROFILE "/Profiles/Base-Calling_Profiles/humNew.PE100.matrix.gz"
+-#define INDEL_ERROR_PROFILE "/Profiles/InDel_Profiles/phixv2.InDel.matrix"
+-#define GC_DEPTH_PROFILE_PATH "/Profiles/GC-depth_Profiles/"
++#define BASE_CALLING_PROFILE "/usr/share/pirs/Profiles/Base-Calling_Profiles/humNew.PE100.matrix.gz"
++#define INDEL_ERROR_PROFILE "/usr/share/pirs/Profiles/InDel_Profiles/phixv2.InDel.matrix"
++#define GC_DEPTH_PROFILE_PATH "/usr/share/pirs/Profiles/GC-depth_Profiles/"
+ #define GC_DEPTH100_PROFILE "humNew.gcdep_100.dat"
+ #define GC_DEPTH150_PROFILE "humNew.gcdep_150.dat"
+ #define GC_DEPTH200_PROFILE "humNew.gcdep_200.dat"
diff --git a/debian/patches/series b/debian/patches/series
index 14d3581..afa0e17 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 use_debian_packaged_libgzstream.patch
+adjust_profiles_path.patch

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



More information about the debian-med-commit mailing list