[Debian-med-packaging] Bug#995406: bbmap: package does not ship resource files
Robert
heinro at umich.edu
Thu Sep 30 18:22:23 BST 2021
Package: bbmap
Version: 38.93+dfsg-1
Severity: normal
Tags: patch
X-Debbugs-Cc: heinro at umich.edu
Dear Maintainer,
The bbmap package does not ship the needed resource files which causes some of
the included tools not to work, e.g. bbduk when trying to process some fastq
data, crashes with output like [1].
I don't have a census which other bbtools require resource files to be usable,
but bbduk is not usable at all in the current state.
My suggested fix (see patch [2]) puts the resource files to the root of
the built jar file. This is were dna.Data.findPath() will indeed find
these files, which can be seen when looking at the verbose output [3]
for findPath() (by setting vb=true in current/dna.Data.java near line
1204). By contrast, the current packaging tries (but also fails) to put
the files under resources/. I don't see a way to trick jh_build with
the JH_JAR_EXTRA mechanism to do what is needed (without changes to
jh_build). The patch applies agaiinst the bbmap source package's
current git master branch and the package builds and run for me on
bullseye.
thanks
(Robert)
[1] error message of bbduk tool:
$ pwd
/tmp/bbduk_test
$ ls
fwd.fastq rev.fastq
$ bbduk.sh in1=fwd.fastq in2=rev.fastq ktrim=r k=21 mink=8 hdist=2 ftm=5 tpe tbo threads=48 out=out.fastq
java -ea -Xmx76702m -Xms76702m -cp /usr/share/java/bbmap.jar jgi.BBDuk in1=fwd.fastq in2=rev.fastq ktrim=r k=21 mink=8 hdist=2 ftm=5 tpe tbo threads=48 out=out.fastq
Executing jgi.BBDuk [in1=fwd.fastq, in2=rev.fastq, ktrim=r, k=21, mink=8, hdist=2, ftm=5, tpe, tbo, threads=48, out=out.fastq]
Version 38.90
Set threads to 48
maskMiddle was disabled because useShortKmers=true
Warning! Cannot find primes.txt.gz /tmp/bbduk_test/file:/usr/share/java/bbmap.jar!/primes.txt.gz
java.lang.Exception
at dna.Data.findPath(Data.java:1247)
at dna.Data.findPath(Data.java:1194)
at shared.Primes.fetchPrimes(Primes.java:167)
at shared.Primes.<clinit>(Primes.java:177)
at kmer.ScheduleMaker.<clinit>(ScheduleMaker.java:155)
at jgi.BBDuk.<init>(BBDuk.java:964)
at jgi.BBDuk.main(BBDuk.java:78)
Exception in thread "main" java.lang.ExceptionInInitializerError
at kmer.ScheduleMaker.<clinit>(ScheduleMaker.java:155)
at jgi.BBDuk.<init>(BBDuk.java:964)
at jgi.BBDuk.main(BBDuk.java:78)
Caused by: java.lang.NullPointerException
at fileIO.ByteFile.<init>(ByteFile.java:43)
at fileIO.ByteFile1.<init>(ByteFile1.java:98)
at fileIO.ByteFile1.<init>(ByteFile1.java:94)
at shared.Primes.fetchPrimes(Primes.java:169)
at shared.Primes.<clinit>(Primes.java:177)
... 3 more
[2] proposed patch
diff --git a/debian/rules b/debian/rules
index a44c8e7..479739f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,6 @@ PKGSHAREDIR := debian/$(DEB_SOURCE)/usr/share/$(DEB_SOURCE)
export JAVA_HOME := /usr/lib/jvm/default-java
DEBJAR := /usr/share/java
export CLASSPATH := $(DEBJAR)/mpi.jar
-export JH_JAR_EXTRA := resources/*
%:
dh $@ --with javahelper
@@ -23,7 +22,8 @@ override_dh_clean:
override_dh_auto_build:
cd jni && make -f makefile.linux
- JH_JAR_EXTRA=`$(CURDIR)/resources/*` jh_build $(DEB_SOURCE).jar current
+ jh_build $(DEB_SOURCE).jar current
+ cd $(CURDIR)/resources && jar uf $(CURDIR)/$(DEB_SOURCE).jar $(subst resources/,,$(wildcard resources/*))
override_dh_install:
dh_install
[3] bbduk output like [1] but with proposed patch and verbose output for findPath() applied:
$ bbduk.sh in1=fwd.fastq in2=rev.fastq ktrim=r k=21 mink=8 hdist=2 ftm=5 tpe tbo threads=48 out=out.fastq
java -ea -Xmx76702m -Xms76702m -cp /usr/share/java/bbmap.jar jgi.BBDuk in1=fwd.fastq in2=rev.fastq ktrim=r k=21 mink=8 hdist=2 ftm=5 tpe tbo threads=48 out=out.fastq
Executing jgi.BBDuk [in1=fwd.fastq, in2=rev.fastq, ktrim=r, k=21, mink=8, hdist=2, ftm=5, tpe, tbo, threads=48, out=out.fastq]
Version 38.93
Set threads to 48
maskMiddle was disabled because useShortKmers=true
Did not find primes.txt.gz at /tmp/bbduk_test/file:/usr/share/java/bbmap.jar!/primes.txt.gz
Did not find primes.txt.gz at /tmp/bbduk_test/file:/usr/share/java/resources/primes.txt.gz
Considering fixing /tmp/bbduk_test/file:/usr/share/java/bbmap.jar!/primes.txt.gz
true
Did not find primes.txt.gz at file:/usr/share/java/bbmap.jar!/primes.txt.gz
Considering getResource
Found URL jar:file:/usr/share/java/bbmap.jar!/primes.txt.gz
Found primes.txt.gz at jar:file:/usr/share/java/bbmap.jar!/primes.txt.gz
0.032 seconds.
Initial:
Memory: max=80429m, total=80429m, free=80346m, used=83m
...
-- System Information:
Debian Release: 11.0
APT prefers stable-security
APT policy: (990, 'stable-security'), (990, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.15.0-132-generic (SMP w/96 CPU threads)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages bbmap depends on:
ii libmpj-java 0.44+dfsg-4
Versions of packages bbmap recommends:
ii pigz 2.6-1
bbmap suggests no packages.
-- no debconf information
More information about the Debian-med-packaging
mailing list