diff mbox series

[bug#71146] gnu: kallisto: Update to 0.50.1

Message ID 171645804083.6.7508412953776945309.337355746@mawumag.com
State New
Headers show
Series [bug#71146] gnu: kallisto: Update to 0.50.1 | expand

Commit Message

ashish.is--- via Guix-patches" via May 23, 2024, 9:53 a.m. UTC
Updated kallisto to 0.50.1, it now supports more single-cell technologies (e.g. SPLiT-seq).

I had to modify the 'do-not-use-bundled-htslib snippet to make one regex more selective---in this new version it the previous regex was mistakenly modifying parts of CMakeLists.txt other than the intended one.

Comments

Ricardo Wurmus June 1, 2024, 7:13 p.m. UTC | #1
Ricardo Wurmus <rekado@elephly.net> writes:

>> I had to modify the 'do-not-use-bundled-htslib snippet to make one
>> regex more selective---in this new version it the previous regex was
>> mistakenly modifying parts of CMakeLists.txt other than the intended
>> one.
>
> It looks like this might not be working as intended.  I used:
>
>     guix gc -R $(./pre-inst-env guix build kallisto)
>
> and it shows me that the newly built kallisto does not link with our
> htslib.  Perhaps it used the static library?

Turns out it's not actually using htslib at all, because USE_BAM is not
set.  It uses a bundled copy of bifrost instead.  If we want to build
kallisto with bifrost only then we should remove htslib from the inputs,
package bifrost (https://github.com/pmelsted/bifrost) and unbundle it
from kallisto, linking with the shared library.

Does this sound like a good plan or should we use htslib instead?
Ricardo Wurmus June 1, 2024, 7:13 p.m. UTC | #2
Thank you for the patch!

> I had to modify the 'do-not-use-bundled-htslib snippet to make one
> regex more selective---in this new version it the previous regex was
> mistakenly modifying parts of CMakeLists.txt other than the intended
> one.

It looks like this might not be working as intended.  I used:

    guix gc -R $(./pre-inst-env guix build kallisto)

and it shows me that the newly built kallisto does not link with our
htslib.  Perhaps it used the static library?
ashish.is--- via Guix-patches" via June 4, 2024, 3:36 p.m. UTC | #3
> Ricardo Wurmus rekado@elephly.net writes:
> 
> Turns out it's not actually using htslib at all, because USE_BAM is not
> set. It uses a bundled copy of bifrost instead. If we want to build
> kallisto with bifrost only then we should remove htslib from the inputs,
> package bifrost (https://github.com/pmelsted/bifrost) and unbundle it
> from kallisto, linking with the shared library.
> 
> Does this sound like a good plan or should we use htslib instead?

My initial attempt was to unbundle bifrost from kallisto, but I had two concerns:

- I was not able to determine the exact version of bifrost that was bundled with kallisto (it is definitely not the latest one, as the relevant ext/bifrost directory in kallisto is older).
This is also a problem with htslib, I am sure whoever packaged kallisto 0.48.0 was careful to choose the correct version, but I would not know how to verify this.
This has the potential to lead to mismatches (or even bugs) between the guix version and the official one compiled from their sources.

- Some header files of bifrost appear to be included in kallisto source code directly, but it was not clear to me how to include bifrost in guix in a way that exports its libraries and headers.

Especially for the first reason, I would actually propose to use the bundled htslib and bifrost for kallisto. Both are bundled as source code and are compiled during the build process, so this should not pose a concern (bifrost is released under BSD 2-Clause License, like kallisto, while htslib is released under expat).

Please let me know what you think.

Cheers,
Marco
diff mbox series

Patch

From 9bec1c5bf14b644ef7147b1bc66acaea6a903830 Mon Sep 17 00:00:00 2001
Message-ID: <9bec1c5bf14b644ef7147b1bc66acaea6a903830.1716457241.git.guix@mawumag.com>
From: Marco Baggio <guix@mawumag.com>
Date: Thu, 23 May 2024 08:52:06 +0200
Subject: [PATCH] gnu: kallisto: Update to 0.50.1

Change-Id: I1b048be328f6d1d5034dfe29688a44f2af0b026a
---
 gnu/packages/bioinformatics.scm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index b7e8e54de2..8dee300320 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14820,7 +14820,7 @@  (define-public segemehl
 (define-public kallisto
   (package
     (name "kallisto")
-    (version "0.48.0")
+    (version "0.50.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -14829,7 +14829,7 @@  (define-public kallisto
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0wx1ndmhndsd60952piaa925lk8bjr59d2yr1m2hcsqcb6cdjwpn"))
+                "0zfs79mv75599cf9d7d3c5a3s8idgz9qvl4qfzhvhbd87y3dv7p0"))
               (modules '((guix build utils)))
               (snippet
                '(delete-file-recursively "ext/htslib/"))))
@@ -14841,16 +14841,16 @@  (define-public kallisto
          (add-after 'unpack 'do-not-use-bundled-htslib
            (lambda _
              (substitute* "CMakeLists.txt"
-               (("^ExternalProject_Add" m)
+               (("^ExternalProject_Add\\(htslib[^\\)]*\\)" m)
                 (string-append "if (NEVER)\n" m))
-               (("^\\)")
-                (string-append ")\nendif(NEVER)"))
                (("include_directories\\(\\$\\{htslib_PREFIX.*" m)
                 (string-append "# " m)))
              (substitute* "src/CMakeLists.txt"
                (("target_link_libraries\\(kallisto kallisto_core pthread \
-\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/../ext/htslib/libhts.a\\)")
-                "target_link_libraries(kallisto kallisto_core pthread hts)")
+\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/../ext/htslib/libhts.a \
+\\$\\{install_dir\\}/build/src/libbifrost.a\\)")
+                "target_link_libraries(kallisto kallisto_core pthread hts \
+${install_dir}/build/src/libbifrost.a)")
                (("include_directories\\(\\.\\./ext/htslib\\)") "")))))))
     (inputs
      (list hdf5 htslib-1.9 zlib))

base-commit: 3597c736588c45efde3c22d533ea8774c3fdd235
-- 
2.41.0