gnu: wfmash: Update to 0.21.0.

* gnu/packages/bioinformatics.scm (wfmash): Update to 0.21.0.
[source]: Use url-fetch.
[arguments]: Do not replace standard check phase. Add fix-cmakelists and
build-check-prerequisites phases.
[inputs]: Remove jemalloc. Add libdeflate.

Change-Id: I664178e9fac7320b9d6e3190e8a3779b2bce2c6b
This commit is contained in:
Arun Isaac 2024-10-22 17:16:17 +01:00
parent b8f8699a1f
commit 789300000c
No known key found for this signature in database
GPG key ID: 2E25EE8B61802BB3

View file

@ -22991,18 +22991,15 @@ based on the pairwise alignment of hidden Markov models (HMMs).")
(define-public wfmash (define-public wfmash
(package (package
(name "wfmash") (name "wfmash")
(version "0.12.5") (version "0.21.0")
(source (source
(origin (origin
;; There are no release tarballs after version 0.10.5. (method url-fetch)
(method git-fetch) (uri (string-append "https://github.com/waveygang/wfmash/releases/download/v"
(uri (git-reference version "/wfmash-v" version ".tar.gz"))
(url "https://github.com/waveygang/wfmash")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"1qh2chnwp7nqgp88afc4xzdkd21vh6cfqq73siqw7vc0qinqadm6")) "0v9giqrqxl9kkcrs6zrfj1y07j6p9r8d82kkwigvndlg1708457w"))
(snippet (snippet
#~(begin #~(begin
(use-modules (guix build utils)) (use-modules (guix build utils))
@ -23017,116 +23014,36 @@ based on the pairwise alignment of hidden Markov models (HMMs).")
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
(list (list
#:configure-flags #:configure-flags
#~(list "-DWFA_PNG_AND_TSV=ON") #~(list "-DWFA_PNG_AND_TSV=ON")
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'check (add-after 'unpack 'fix-cmakelists
;; Adapted from .github/workflows/test_on_push.yml (lambda _
(lambda* (#:key tests? inputs #:allow-other-keys) (substitute* "CMakeLists.txt"
(when tests? ;; Remove broken configure of CTestCustom.cmake.
(let ((samtools (search-input-file inputs "/bin/samtools"))) (("^configure_file[^\n]*") "")
;; This is the easiest way to access the data ;; Do not hard-code wfmash executable.
;; needed for the test suite. (("\\./build/bin/wfmash") "wfmash"))))
(symlink "../source/data" "data") (add-before 'check 'build-check-prerequisites
(and (lambda _
;; This test takes 60 minutes on riscv64-linux. (let ((wfa2-lib #$(string-append "../wfmash-v"
#$@(if (not (target-riscv64?)) version
#~((begin "/src/common/wflign/deps/WFA2-lib")))
;; Test with a subset of the LPA dataset (PAF output) (substitute* (string-append wfa2-lib "/Makefile")
(setenv "ASAN_OPTIONS" "detect_leaks=1:symbolize=1") ;; Remove architecture-specific flags.
(setenv "LSAN_OPTIONS" "verbosity=0:log_threads=1") (("-march=x86-64-v3") ""))
(with-output-to-file "LPA.subset.paf" (substitute* (string-append wfa2-lib "/tests/wfa.utest.sh")
(lambda _ ;; Fix time command.
(invoke "bin/wfmash" (("\\\\time -v") "time"))
"data/LPA.subset.fa.gz" ;; Build wfa2-lib.
"data/LPA.subset.fa.gz" (invoke "make" "-C" wfa2-lib
"-X" "-n" "10" "-T" "wflign_info." #$(string-append "CC=" (cc-for-target)))))))))
"-u" "./")))
(invoke "head" "LPA.subset.paf")))
#~())
;; This test takes about 5 hours on riscv64-linux.
#$@(if (not (target-riscv64?))
#~((begin
;; Test with a subset of the LPA dataset (SAM output)
(setenv "ASAN_OPTIONS" "detect_leaks=1:symbolize=1")
(setenv "LSAN_OPTIONS" "verbosity=0:log_threads=1")
(with-output-to-file "LPA.subset.sam"
(lambda _
(invoke "bin/wfmash"
"data/LPA.subset.fa.gz"
"data/LPA.subset.fa.gz"
"-X" "-N" "-a" "-T" "wflign_info.")))
(with-output-to-file "LPA.subset.sam-view"
(lambda _
(invoke samtools "view" "LPA.subset.sam" "-bS")))
(with-output-to-file "LPA.subset.bam"
(lambda _
(invoke samtools "sort" "LPA.subset.sam-view")))
(invoke samtools "index" "LPA.subset.bam")
;; samtools view LPA.subset.bam | head | cut -f 1-9
;(invoke samtools "view" "LPA.subset.bam")
;; There should be an easier way to do this with pipes.
(with-output-to-file "LPA.subset.bam-incr1"
(lambda _
(invoke samtools "view" "LPA.subset.bam")))
(with-output-to-file "LPA.subset.bam-incr2"
(lambda _
(invoke "head" "LPA.subset.bam-incr1")))
(invoke "cut" "-f" "1-9" "LPA.subset.bam-incr2")))
#~())
;; This test takes 60 minutes on riscv64-linux.
#$@(if (not (target-riscv64?))
#~((begin
;; Test with a subset of the LPA dataset,
;; setting a lower identity threshold (PAF output)
(setenv "ASAN_OPTIONS" "detect_leaks=1:symbolize=1")
(setenv "LSAN_OPTIONS" "verbosity=0:log_threads=1")
(with-output-to-file "LPA.subset.p90.paf"
(lambda _
(invoke "bin/wfmash"
"data/LPA.subset.fa.gz"
"data/LPA.subset.fa.gz"
"-X" "-p" "90" "-n" "10"
"-T" "wflign_info.")))
(invoke "head" "LPA.subset.p90.paf")))
#~())
(begin
;; Test aligning short reads (500 bps) to a reference (SAM output)
(setenv "ASAN_OPTIONS" "detect_leaks=1:symbolize=1")
(setenv "LSAN_OPTIONS" "verbosity=0:log_threads=1")
(with-output-to-file "reads.500bps.sam"
(lambda _
(invoke "bin/wfmash"
"data/reference.fa.gz"
"data/reads.500bps.fa.gz"
"-s" "0.5k" "-N" "-a")))
(with-output-to-file "reads.500bps.sam-view"
(lambda _
(invoke samtools "view" "reads.500bps.sam" "-bS")))
(with-output-to-file "reads.500bps.bam"
(lambda _
(invoke samtools "sort" "reads.500bps.sam-view")))
(invoke samtools "index" "reads.500bps.bam")
(with-output-to-file "reads.500bps.bam-view"
(lambda _
(invoke samtools "view" "reads.500bps.bam")))
(invoke "head" "reads.500bps.bam-view"))
(begin
;; Test with few very short reads (255bps) (PAF output)
(setenv "ASAN_OPTIONS" "detect_leaks=1:symbolize=1")
(setenv "LSAN_OPTIONS" "verbosity=0:log_threads=1")
(with-output-to-file "reads.255bps.paf"
(lambda _
(invoke "bin/wfmash"
"data/reads.255bps.fa.gz"
"-w" "16" "-s" "100" "-L")))
(invoke "head" "reads.255bps.paf"))))))))))
(inputs (inputs
(list atomic-queue (list atomic-queue
gsl gsl
htslib htslib
jemalloc libdeflate
zlib)) zlib))
(native-inputs (native-inputs
(list pkg-config (list pkg-config