about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJustin Bedő <cu@cua0.org>2024-01-08 09:25:31 +1100
committerGitHub <noreply@github.com>2024-01-08 09:25:31 +1100
commit40830f825335d4f5400a5337e9139fe43113a69e (patch)
treeea7f8b318aac63947a483da442d8abf2d63ed36f
parent788cf70bed79b1242cc920fe04f4b3d3006a641b (diff)
parentccef24c817ee461b69aefdae9545988ec06b3956 (diff)
downloadnixlib-40830f825335d4f5400a5337e9139fe43113a69e.tar
nixlib-40830f825335d4f5400a5337e9139fe43113a69e.tar.gz
nixlib-40830f825335d4f5400a5337e9139fe43113a69e.tar.bz2
nixlib-40830f825335d4f5400a5337e9139fe43113a69e.tar.lz
nixlib-40830f825335d4f5400a5337e9139fe43113a69e.tar.xz
nixlib-40830f825335d4f5400a5337e9139fe43113a69e.tar.zst
nixlib-40830f825335d4f5400a5337e9139fe43113a69e.zip
Merge pull request #253179 from Kupac/salmon
salmon: init at 1.10.2
-rw-r--r--pkgs/by-name/li/libgff/package.nix30
-rw-r--r--pkgs/by-name/li/libstaden-read/libstaden-install-config-header.patch12
-rw-r--r--pkgs/by-name/li/libstaden-read/package.nix47
-rw-r--r--pkgs/by-name/sa/salmon/fetch-pufferfish.patch60
-rw-r--r--pkgs/by-name/sa/salmon/package.nix84
5 files changed, 233 insertions, 0 deletions
diff --git a/pkgs/by-name/li/libgff/package.nix b/pkgs/by-name/li/libgff/package.nix
new file mode 100644
index 000000000000..fe3473f2e4df
--- /dev/null
+++ b/pkgs/by-name/li/libgff/package.nix
@@ -0,0 +1,30 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "libgff";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "COMBINE-lab";
+    repo = "libgff";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-ZCb3UyuB/+ykrYFQ9E5VytT65gAAULiOzIEu5IXISTc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "A lightweight GTF/GFF parsers exposing a C++ interface";
+    homepage = "https://github.com/COMBINE-lab/libgff";
+    downloadPage = "https://github.com/COMBINE-lab/libgff/releases";
+    changelog = "https://github.com/COMBINE-lab/libgff/releases/tag/" +
+                "v${finalAttrs.version}";
+    license = lib.licenses.boost;
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.kupac ];
+  };
+})
diff --git a/pkgs/by-name/li/libstaden-read/libstaden-install-config-header.patch b/pkgs/by-name/li/libstaden-read/libstaden-install-config-header.patch
new file mode 100644
index 000000000000..39df97a508a3
--- /dev/null
+++ b/pkgs/by-name/li/libstaden-read/libstaden-install-config-header.patch
@@ -0,0 +1,12 @@
+diff --git a/Makefile.am b/Makefile.am
+index 31286d1..2631af1 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -61,6 +61,7 @@ man_MANS = \
+ 	man/man4/Read.4
+ 
+ pkginclude_HEADERS = \
++        io_lib_config.h \
+ 	io_lib/Read.h \
+ 	io_lib/scf_extras.h \
+ 	io_lib/translate.h \
diff --git a/pkgs/by-name/li/libstaden-read/package.nix b/pkgs/by-name/li/libstaden-read/package.nix
new file mode 100644
index 000000000000..dd2d93ae30a3
--- /dev/null
+++ b/pkgs/by-name/li/libstaden-read/package.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, autoreconfHook
+, fetchFromGitHub
+, bzip2
+, xz
+, zlib
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  # Same name as the Debian library
+  pname = "libstaden-read";
+  version = "1.15.0";
+
+  src = fetchFromGitHub {
+    owner = "jkbonfield";
+    repo = "io_lib";
+    rev = "io_lib-" + builtins.replaceStrings ["."] ["-"] finalAttrs.version;
+    fetchSubmodules = true;
+    hash = "sha256-2Dlx+MXmqar81/Xmf0oE+6lWX461EDYijiZsZf/VD28=";
+  };
+
+  patches = [
+    # Needed so that the lib can be detected
+    ./libstaden-install-config-header.patch
+  ];
+
+  buildInputs = [ bzip2 xz zlib ];
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # autoreconfHook does not descend into htscodecs folder
+  preAutoreconf = ''
+    pushd ./htscodecs
+    autoreconf --install --force --verbose
+    pushd
+  '';
+
+  meta = {
+    description = "C library for reading/writing various DNA sequence formats";
+    homepage = "https://staden.sourceforge.net";
+    downloadPage = "https://github.com/jkbonfield/io_lib/releases";
+    changelog = "https://github.com/jkbonfield/io_lib/blob/${finalAttrs.src.rev}/CHANGES";
+    license = with lib.licenses; [ bsd3 free ];
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.kupac ];
+  };
+})
diff --git a/pkgs/by-name/sa/salmon/fetch-pufferfish.patch b/pkgs/by-name/sa/salmon/fetch-pufferfish.patch
new file mode 100644
index 000000000000..7010a1a69fac
--- /dev/null
+++ b/pkgs/by-name/sa/salmon/fetch-pufferfish.patch
@@ -0,0 +1,60 @@
+diff --git a/scripts/fetchPufferfish.sh b/scripts/fetchPufferfish.sh
+index bf2574e0..42582806 100755
+--- a/scripts/fetchPufferfish.sh
++++ b/scripts/fetchPufferfish.sh
+@@ -11,10 +11,6 @@ CURR_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+ EXTERNAL_DIR=${CURR_DIR}/../external
+ INSTALL_DIR=${CURR_DIR}/../external/install
+ 
+-if [ -d ${EXTERNAL_DIR}/pufferfish ] ; then
+-    rm -fr ${EXTERNAL_DIR}/pufferfish
+-fi
+-
+ if [ -d ${INSTALL_DIR}/include/pufferfish ] ; then
+     rm -fr ${INSTALL_DIR}/include/pufferfish
+ fi
+@@ -23,42 +19,10 @@ if [ -d ${INSTALL_DIR}/src/pufferfish ] ; then
+     rm -fr ${INSTALL_DIR}/src/pufferfish
+ fi
+ 
+-SVER=salmon-v1.10.2
+-#SVER=develop
+-#SVER=sketch-mode
+-
+-EXPECTED_SHA256=f225b74833f71dcf767a565345224357fb091f90ce79717abc836814d9ccd101
+-
+-mkdir -p ${EXTERNAL_DIR}
+-curl -k -L https://github.com/COMBINE-lab/pufferfish/archive/${SVER}.zip -o ${EXTERNAL_DIR}/pufferfish.zip
+-
+-hashcheck=""
+-if exists sha256sum; then
+-	hashcheck="sha256sum"
+-elif exists shasum; then
+-	hashcheck="shasum -a256"
+-else
+-	unset hashcheck
+-fi
+-
+-
+-if [ -z "${hashcheck-}" ]; then
+-    echo "Couldn't find shasum command; can't verify contents of downloaded pufferfish";
+-else
+-
+-    if [[ $SVER != develop && $SVER != onetbb ]]; then
+-        echo "${EXPECTED_SHA256}  ${EXTERNAL_DIR}/pufferfish.zip" | ${hashcheck} -c - || { echo "pufferfish.zip did not match expected SHA1! Exiting."; exit 1; }
+-    else
+-        echo "not testing sha since pulling from develop"
+-    fi
+-fi
+-
+-
+-rm -fr ${EXTERNAL_DIR}/pufferfish
+-unzip ${EXTERNAL_DIR}/pufferfish.zip -d ${EXTERNAL_DIR}
+-mv ${EXTERNAL_DIR}/pufferfish-${SVER} ${EXTERNAL_DIR}/pufferfish
+ 
+ mkdir -p ${INSTALL_DIR}/include/pufferfish
++# This is needed later when pufferfish is compiled for Salmon
++cp -r ${pufferFishSrc} ${EXTERNAL_DIR}/pufferfish
+ 
+ cp ${EXTERNAL_DIR}/pufferfish/include/ProgOpts.hpp ${INSTALL_DIR}/include/pufferfish
+ cp ${EXTERNAL_DIR}/pufferfish/include/BooPHF.hpp ${INSTALL_DIR}/include/pufferfish
diff --git a/pkgs/by-name/sa/salmon/package.nix b/pkgs/by-name/sa/salmon/package.nix
new file mode 100644
index 000000000000..e4442e96fd6f
--- /dev/null
+++ b/pkgs/by-name/sa/salmon/package.nix
@@ -0,0 +1,84 @@
+{ lib
+, stdenv
+, autoreconfHook
+, bash
+, boost
+, bzip2
+, cereal_1_3_2
+, cmake
+, curl
+, fetchFromGitHub
+, jemalloc
+, libgff
+, libiconv
+, libstaden-read
+, pkg-config
+, tbb_2021_8
+, xz
+, zlib
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "salmon";
+  version = "1.10.2";
+
+  pufferFishSrc = fetchFromGitHub {
+    owner = "COMBINE-lab";
+    repo = "pufferfish";
+    rev = "salmon-v${finalAttrs.version}";
+    hash = "sha256-JKbUFBEsqnENl4vFqve1FCd4TI3n9bRi2RNHC8QGQGc=";
+  };
+
+  src = fetchFromGitHub {
+    owner = "COMBINE-lab";
+    repo = "salmon";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-kwqoUmVCqjr/xRxJjQKaFjjCQW+MFASHJ2f9OiAumNU=";
+  };
+
+  patches = [
+    # Use pufferfish source fetched by nix
+    ./fetch-pufferfish.patch
+  ];
+
+  postPatch = "patchShebangs .";
+
+  buildInputs = [
+    (boost.override { enableShared = false; enabledStatic = true; })
+    bzip2
+    cereal_1_3_2
+    curl
+    jemalloc
+    libgff
+    libstaden-read
+    tbb_2021_8
+    xz
+    zlib
+  ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  strictDeps = true;
+
+  meta = {
+    description =
+      "Tool for quantifying the expression of transcripts using RNA-seq data";
+    longDescription = ''
+      Salmon is a tool for quantifying the expression of transcripts
+      using RNA-seq data. Salmon uses new algorithms (specifically,
+      coupling the concept of quasi-mapping with a two-phase inference
+      procedure) to provide accurate expression estimates very quickly
+      and while using little memory. Salmon performs its inference using
+      an expressive and realistic model of RNA-seq data that takes into
+      account experimental attributes and biases commonly observed in
+      real RNA-seq data.
+    '';
+    homepage = "https://combine-lab.github.io/salmon";
+    downloadPage = "https://github.com/COMBINE-lab/salmon/releases";
+    changelog = "https://github.com/COMBINE-lab/salmon/releases/tag/" +
+                "v${finalAttrs.version}";
+    license = lib.licenses.gpl3Only;
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.kupac ];
+  };
+})