From e26bc12c9da9007c763d73726a20c795b331b701 Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Mon, 9 Dec 2024 16:16:24 +0100 Subject: [PATCH 1/2] adding easyconfigs: purge_dups-1.2.6-foss-2023b.eb --- .../purge_dups/purge_dups-1.2.6-foss-2023b.eb | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 easybuild/easyconfigs/p/purge_dups/purge_dups-1.2.6-foss-2023b.eb diff --git a/easybuild/easyconfigs/p/purge_dups/purge_dups-1.2.6-foss-2023b.eb b/easybuild/easyconfigs/p/purge_dups/purge_dups-1.2.6-foss-2023b.eb new file mode 100644 index 00000000000..6848c4131d1 --- /dev/null +++ b/easybuild/easyconfigs/p/purge_dups/purge_dups-1.2.6-foss-2023b.eb @@ -0,0 +1,85 @@ +easyblock = 'PythonBundle' + +name = 'purge_dups' +version = '1.2.6' + +homepage = 'https://github.com/dfguan/purge_dups' +description = "purge haplotigs and overlaps in an assembly based on read depth" + +toolchain = {'name': 'foss', 'version': '2023b'} + +builddependencies = [ + ('pybind11', '2.11.1'), +] + +dependencies = [ + ('zlib', '1.2.13'), + ('bzip2', '1.0.8'), + ('Python', '3.11.5'), + ('matplotlib', '3.8.2'), + ('minimap2', '2.28'), +] + +use_pip = True + +default_easyblock = 'MakeCp' + +components = [ + (name, version, { + 'source_urls': ['https://github.com/dfguan/purge_dups/archive'], + 'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}], + 'checksums': ['75b20df834d28410858ccd4e2d65b6c70849f3cbe5fc05959f38bfc2d041c704'], + 'start_dir': 'purge_dups-%(version)s', + 'prebuildopts': "cd src && ", + 'buildopts': 'CC="$CC" CFLAGS="$CFLAGS"', + 'files_to_copy': ['bin', 'scripts'], + }), + ('KMC', '20190629', { + 'source_urls': ['https://github.com/dfguan/KMC/archive'], + 'sources': [{'download_filename': 'c05a5f9.tar.gz', 'filename': SOURCE_TAR_GZ}], + 'patches': [{ + 'name': 'KMC_use_EB_pybind11_and_libs.patch', + 'sourcepath': 'KMC-c05a5f9fd94683248ebe04484a60f86792cf328f', + }], + 'checksums': [ + '7251941f4b1913bfdd68759d9292b419d95fe7c63815056e15ecb097a12a0bc4', + '2f54971aae26787777d0e4b638a9682bd4bc22cbf3fda170c7baf4c610808ac9', + ], + 'prebuildopts': 'cd KMC-* && ', + 'buildopts': 'CC="$CXX"', + 'files_to_copy': [(['KMC-*/bin/*kmc*'], 'bin'), 'KMC-*/spectra.py'], + }), +] + +exts_list = [ + ('runner', '20191220', { + 'preinstallopts': "sed -i 's/0.0.0/%(version)s/g' setup.py && ", + 'sources': [{ + 'git_config': { + 'url': 'https://github.com/dfguan/', + 'repo_name': 'runner', + 'commit': '73a4d11', + }, + 'filename': 'runner-%(version)s.tar.gz', + }], + 'checksums': [None], + }), +] + +sanity_check_paths = { + 'files': ['bin/kmc', 'bin/purge_dups'], + 'dirs': ['scripts'], +} + +sanity_check_commands = [ + "purge_dups -h 2>&1 | grep 'Program: purge_dups'", + "kmc --help", + "run_purge_dups.py -h", + "hist_plot.py -h", +] + +sanity_pip_check = True + +modextrapaths = {'PATH': 'scripts'} + +moduleclass = 'bio' From 7b618299a721907a13fe315099a5343b8676b8ed Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Mon, 9 Dec 2024 16:19:15 +0100 Subject: [PATCH 2/2] purge_dups: Add KMC patch to use EB pybind11 and libs --- .../KMC_use_EB_pybind11_and_libs.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 easybuild/easyconfigs/p/purge_dups/KMC_use_EB_pybind11_and_libs.patch diff --git a/easybuild/easyconfigs/p/purge_dups/KMC_use_EB_pybind11_and_libs.patch b/easybuild/easyconfigs/p/purge_dups/KMC_use_EB_pybind11_and_libs.patch new file mode 100644 index 00000000000..465979ce64b --- /dev/null +++ b/easybuild/easyconfigs/p/purge_dups/KMC_use_EB_pybind11_and_libs.patch @@ -0,0 +1,39 @@ +Use pybind11 from EasyBuild install +Required to use Python != 3.10 +Also use zlib and bzip2 from EB install + +Åke Sandgren, 2024-12-09 +diff --git a/makefile b/makefile +index 09f4de3..918dcae 100644 +--- a/makefile ++++ b/makefile +@@ -36,9 +36,7 @@ $(KMC_MAIN_DIR)/raduls_sse41.o \ + $(KMC_MAIN_DIR)/raduls_avx2.o \ + $(KMC_MAIN_DIR)/raduls_avx.o + +-KMC_LIBS = \ +-$(KMC_MAIN_DIR)/libs/libz.a \ +-$(KMC_MAIN_DIR)/libs/libbz2.a ++KMC_LIBS = -lz -lbz2 + + KMC_DUMP_OBJS = \ + $(KMC_DUMP_DIR)/nc_utils.o \ +@@ -64,9 +62,7 @@ $(KMC_TOOLS_DIR)/fastq_reader.o \ + $(KMC_TOOLS_DIR)/fastq_writer.o \ + $(KMC_TOOLS_DIR)/percent_progress.o + +-KMC_TOOLS_LIBS = \ +-$(KMC_TOOLS_DIR)/libs/libz.a \ +-$(KMC_TOOLS_DIR)/libs/libbz2.a ++KMC_TOOLS_LIBS = -lz -lbz2 + + $(KMC_OBJS) $(KMC_DUMP_OBJS) $(KMC_API_OBJS): %.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ +@@ -102,7 +98,6 @@ py_kmc_api: $(PY_KMC_API_OBJS) $(PY_KMC_API_OBJS) + -mkdir -p $(KMC_BIN_DIR) + $(CC) -fPIC -Wall -shared -std=c++11 -O3 $(PY_KMC_API_DIR)/py_kmc_api.cpp $(PY_KMC_API_OBJS) \ + -I $(KMC_API_DIR) \ +- -I $(PY_KMC_API_DIR)/libs/pybind11/include \ + -I `python3 -c "import sysconfig;print(sysconfig.get_paths()['include'])"` \ + -o $(KMC_BIN_DIR)/$@`python3-config --extension-suffix` +