[med-svn] r18902 - trunk/packages/spades/trunk/debian/patches
Andreas Tille
tille at moszumanska.debian.org
Wed Mar 4 08:51:09 UTC 2015
Author: tille
Date: 2015-03-04 08:51:09 +0000 (Wed, 04 Mar 2015)
New Revision: 18902
Added:
trunk/packages/spades/trunk/debian/patches/0003_accept-system-bwa.patch
trunk/packages/spades/trunk/debian/patches/0101_cmake_ignore_removed_python-yaml.patch
trunk/packages/spades/trunk/debian/patches/0102_cmake_ignore_removed_python-joblib.patch
Modified:
trunk/packages/spades/trunk/debian/patches/0001_use_debian_packaged_python-yaml.patch
trunk/packages/spades/trunk/debian/patches/0002_use_debian_packaged_python-joblib.patch
trunk/packages/spades/trunk/debian/patches/series
Log:
Try to create patches acceptable by upstream
Modified: trunk/packages/spades/trunk/debian/patches/0001_use_debian_packaged_python-yaml.patch
===================================================================
--- trunk/packages/spades/trunk/debian/patches/0001_use_debian_packaged_python-yaml.patch 2015-03-04 08:46:36 UTC (rev 18901)
+++ trunk/packages/spades/trunk/debian/patches/0001_use_debian_packaged_python-yaml.patch 2015-03-04 08:51:09 UTC (rev 18902)
@@ -7,17 +7,6 @@
The patch is non-intrusive since it conserves the original code and uses
Debian pyyaml only if the original method fails.
---- a/ext/src/CMakeLists.txt
-+++ b/ext/src/CMakeLists.txt
-@@ -4,8 +4,6 @@ add_subdirectory(jemalloc)
- add_subdirectory(nlopt)
- add_subdirectory(python_libs/joblib2)
- add_subdirectory(python_libs/joblib3)
--add_subdirectory(python_libs/pyyaml2)
--add_subdirectory(python_libs/pyyaml3)
- add_subdirectory(yaml-cpp)
- add_subdirectory(ConsensusCore)
- add_subdirectory(bamtools)
--- a/spades.py
+++ b/spades.py
@@ -32,10 +32,13 @@ import hammer_logic
Modified: trunk/packages/spades/trunk/debian/patches/0002_use_debian_packaged_python-joblib.patch
===================================================================
--- trunk/packages/spades/trunk/debian/patches/0002_use_debian_packaged_python-joblib.patch 2015-03-04 08:46:36 UTC (rev 18901)
+++ trunk/packages/spades/trunk/debian/patches/0002_use_debian_packaged_python-joblib.patch 2015-03-04 08:51:09 UTC (rev 18902)
@@ -49,14 +49,3 @@
# CONSTANTS
READS_PER_THREAD = 25000
READS_PER_BATCH = READS_PER_THREAD * options_storage.threads # e.g. 100000 for 4 threads
---- a/ext/src/CMakeLists.txt
-+++ b/ext/src/CMakeLists.txt
-@@ -2,8 +2,6 @@
-
- add_subdirectory(jemalloc)
- add_subdirectory(nlopt)
--add_subdirectory(python_libs/joblib2)
--add_subdirectory(python_libs/joblib3)
- add_subdirectory(yaml-cpp)
- add_subdirectory(ConsensusCore)
- add_subdirectory(bamtools)
Added: trunk/packages/spades/trunk/debian/patches/0003_accept-system-bwa.patch
===================================================================
--- trunk/packages/spades/trunk/debian/patches/0003_accept-system-bwa.patch (rev 0)
+++ trunk/packages/spades/trunk/debian/patches/0003_accept-system-bwa.patch 2015-03-04 08:51:09 UTC (rev 18902)
@@ -0,0 +1,95 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Changed: Tue, 03 Mar 2015 20:55:53 +0100
+Description: Enable using Debian packaged bwa instead of bwa-spades
+ Users might have installed a local version of bwa which is used independently
+ from SPAdes. This is specifically true on Debian systems where the
+ dependency system ensures the installation of bwa. This patch uses the
+ local installed bwa as fallback if bwa-spades is not found.
+ .
+ The patch is non-intrusive since it conserves the original code and uses
+ Debian bwa only if bwa-spades is not available.
+ .
+ Note: The duplicated which() in two files is for sure not the best solution.
+ In case you consider taking over the patch I'd suggest to take it over into
+ some common import file.
+
+--- a/src/spades_pipeline/support.py
++++ b/src/spades_pipeline/support.py
+@@ -56,6 +56,22 @@ def warning(warn_str, log=None, prefix="
+ sys.stdout.write("\n\n" + prefix + " " + warn_str + "\n\n\n")
+ sys.stdout.flush()
+
++def which(program):
++ def is_exe(fpath):
++ return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
++
++ fpath, fname = os.path.split(program)
++ if fpath:
++ if is_exe(program):
++ return program
++ else:
++ for path in os.environ["PATH"].split(os.pathsep):
++ path = path.strip('"')
++ exe_file = os.path.join(path, program)
++ if is_exe(exe_file):
++ return exe_file
++
++ return None
+
+ def check_python_version():
+ if sys.version[0:3] not in options_storage.SUPPORTED_PYTHON_VERSIONS:
+@@ -73,8 +89,14 @@ def check_binaries(binary_dir, log):
+ for binary in ["hammer", "ionhammer", "spades", "bwa-spades", "dipspades"]:
+ binary_path = os.path.join(binary_dir, binary)
+ if not os.path.isfile(binary_path):
+- error("SPAdes binaries not found: " + binary_path + "\n" + get_spades_binaries_info_message(), log)
+-
++ if binary == "bwa-spades":
++ localbwa = which('bwa')
++ if localbwa:
++ warning("Spades is using local bwa at %s." % localbwa, log)
++ else:
++ error("SPAdes binaries not found: " + binary_path + "\nThere is also no local bwa installation available\n" + get_spades_binaries_info_message(), log)
++ else:
++ error("SPAdes binaries not found: " + binary_path + "\n" + get_spades_binaries_info_message(), log)
+
+ def check_file_existence(filename, message="", log=None, dipspades=False):
+ filename = os.path.abspath(filename)
+--- a/spades.py
++++ b/spades.py
+@@ -141,6 +141,22 @@ def print_used_values(cfg, log):
+ print_value(cfg, "common", "max_memory", "Memory limit (in Gb)", " ")
+ log.info("")
+
++def which(program):
++ def is_exe(fpath):
++ return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
++
++ fpath, fname = os.path.split(program)
++ if fpath:
++ if is_exe(program):
++ return program
++ else:
++ for path in os.environ["PATH"].split(os.pathsep):
++ path = path.strip('"')
++ exe_file = os.path.join(path, program)
++ if is_exe(exe_file):
++ return exe_file
++
++ return None
+
+ def fill_cfg(options_to_parse, log):
+ try:
+@@ -382,7 +398,11 @@ def fill_cfg(options_to_parse, log):
+ if (not options_storage.only_error_correction) and options_storage.mismatch_corrector:
+ cfg["mismatch_corrector"] = empty_config()
+ cfg["mismatch_corrector"].__dict__["skip-masked"] = None
+- cfg["mismatch_corrector"].__dict__["bwa"] = os.path.join(bin_home, "bwa-spades")
++ if which("bwa-spades"):
++ cfg["mismatch_corrector"].__dict__["bwa"] = os.path.join(bin_home, "bwa-spades")
++ else:
++ # as far as I can see it is checked later if this exists
++ cfg["mismatch_corrector"].__dict__["bwa"] = which("bwa")
+ cfg["mismatch_corrector"].__dict__["threads"] = options_storage.threads
+ cfg["mismatch_corrector"].__dict__["output-dir"] = options_storage.output_dir
+
Added: trunk/packages/spades/trunk/debian/patches/0101_cmake_ignore_removed_python-yaml.patch
===================================================================
--- trunk/packages/spades/trunk/debian/patches/0101_cmake_ignore_removed_python-yaml.patch (rev 0)
+++ trunk/packages/spades/trunk/debian/patches/0101_cmake_ignore_removed_python-yaml.patch 2015-03-04 08:51:09 UTC (rev 18902)
@@ -0,0 +1,17 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Changed: Tue, 03 Mar 2015 20:55:53 +0100
+Description: Since we are using Debian packaged python-yaml
+ (see 0001_use_debian_packaged_python-yaml.patch) the dir needs to be
+ excluded
+
+--- a/ext/src/CMakeLists.txt
++++ b/ext/src/CMakeLists.txt
+@@ -4,8 +4,6 @@ add_subdirectory(jemalloc)
+ add_subdirectory(nlopt)
+ add_subdirectory(python_libs/joblib2)
+ add_subdirectory(python_libs/joblib3)
+-add_subdirectory(python_libs/pyyaml2)
+-add_subdirectory(python_libs/pyyaml3)
+ add_subdirectory(yaml-cpp)
+ add_subdirectory(ConsensusCore)
+ add_subdirectory(bamtools)
Added: trunk/packages/spades/trunk/debian/patches/0102_cmake_ignore_removed_python-joblib.patch
===================================================================
--- trunk/packages/spades/trunk/debian/patches/0102_cmake_ignore_removed_python-joblib.patch (rev 0)
+++ trunk/packages/spades/trunk/debian/patches/0102_cmake_ignore_removed_python-joblib.patch 2015-03-04 08:51:09 UTC (rev 18902)
@@ -0,0 +1,17 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Changed: Tue, 03 Mar 2015 20:55:53 +0100
+Description: Since we are using Debian packaged python-joblib
+ (see 0002_use_debian_packaged_python-joblib.patch) the dir needs to be
+ excluded
+
+--- a/ext/src/CMakeLists.txt
++++ b/ext/src/CMakeLists.txt
+@@ -2,8 +2,6 @@
+
+ add_subdirectory(jemalloc)
+ add_subdirectory(nlopt)
+-add_subdirectory(python_libs/joblib2)
+-add_subdirectory(python_libs/joblib3)
+ add_subdirectory(yaml-cpp)
+ add_subdirectory(ConsensusCore)
+ add_subdirectory(bamtools)
Modified: trunk/packages/spades/trunk/debian/patches/series
===================================================================
--- trunk/packages/spades/trunk/debian/patches/series 2015-03-04 08:46:36 UTC (rev 18901)
+++ trunk/packages/spades/trunk/debian/patches/series 2015-03-04 08:51:09 UTC (rev 18902)
@@ -1,7 +1,10 @@
0001_use_debian_packaged_python-yaml.patch
0002_use_debian_packaged_python-joblib.patch
-do_not_install_third_party_libs.patch
-adapt_to_debian_pathes.patch
+0003_accept-system-bwa.patch
+0101_cmake_ignore_removed_python-yaml.patch
+0102_cmake_ignore_removed_python-joblib.patch
+#do_not_install_third_party_libs.patch
+#adapt_to_debian_pathes.patch
use-debian-packaged-bwa.patch
# use-debian-packaged-samtools.patch
# bamtools-cmake.patch
More information about the debian-med-commit
mailing list