2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, perl
|
|
|
|
, python3
|
|
|
|
, tbb
|
|
|
|
, zlib
|
|
|
|
, runCommand
|
|
|
|
, bowtie2
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "bowtie2";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2.5.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "BenLangmead";
|
2023-11-16 04:20:00 +00:00
|
|
|
repo = "bowtie2";
|
|
|
|
rev = "refs/tags/v${finalAttrs.version}";
|
|
|
|
fetchSubmodules = true;
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-ZbmVOItfAgKdsMrvQIXgKiPtoQJZYfGblCGDoNPjvTU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# because of this flag, gcc on aarch64 cannot find the Threads
|
|
|
|
# Could NOT find Threads (missing: Threads_FOUND)
|
|
|
|
# TODO: check with other distros and report upstream
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "-m64" ""
|
|
|
|
'';
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
buildInputs = [ tbb zlib python3 perl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
cmakeFlags = lib.optional (!stdenv.hostPlatform.isx86) ["-DCMAKE_CXX_FLAGS=-I${finalAttrs.src}/third_party"];
|
|
|
|
|
|
|
|
# ctest fails because of missing dependencies between tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
ctest = runCommand "${finalAttrs.pname}-test" { } ''
|
|
|
|
mkdir $out
|
|
|
|
${lib.getExe bowtie2} -x ${finalAttrs.src}/example/index/lambda_virus ${finalAttrs.src}/example/reads/longreads.fq -u 10
|
|
|
|
${bowtie2}/bin/bowtie2-build-s -c GGGCGGCGACCTCGCGGGTTTTCGCTA $out/small
|
|
|
|
${bowtie2}/bin/bowtie2-inspect-s $out/small
|
|
|
|
${bowtie2}/bin/bowtie2-build-l -c GGGCGGCGACCTCGCGGGTTTTCGCTA $out/large
|
|
|
|
${bowtie2}/bin/bowtie2-inspect-l $out/large
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences";
|
2023-11-16 04:20:00 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://bowtie-bio.sf.net/bowtie2";
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/BenLangmead/bowtie2/releases/tag/${finalAttrs.src.rev}";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ rybern ];
|
|
|
|
platforms = platforms.all;
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "bowtie2";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
})
|