2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, zlib
|
|
|
|
, kssd
|
|
|
|
, runCommand
|
|
|
|
}:
|
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 = "kssd";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.21";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yhg926";
|
|
|
|
repo = "public_kssd";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-D/s1jL2oKE0rSdRMVljskYFsw5UPOv1L95Of+K+e17w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
2023-11-16 04:20:00 +00:00
|
|
|
# https://github.com/yhg926/public_kssd/pull/11
|
2022-06-16 17:23:12 +00:00
|
|
|
(fetchpatch {
|
2023-11-16 04:20:00 +00:00
|
|
|
name = "allocate-enough-memory.patch";
|
|
|
|
url = "https://github.com/yhg926/public_kssd/commit/b1e66bbcc04687bc3201301cd742a0b26a87cb5d.patch";
|
|
|
|
hash = "sha256-yFyJetpsGKeu+H6Oxrmn5ea4ESVtblb3YJDja4JEAEM=";
|
2022-06-16 17:23:12 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildInputs = [ zlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -vD kssd $out/bin/kssd
|
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.tests = {
|
|
|
|
simple = runCommand "${finalAttrs.pname}-test" { } ''
|
|
|
|
mkdir $out
|
|
|
|
${lib.getExe kssd} dist -L ${kssd.src}/shuf_file/L3K10.shuf -r ${kssd.src}/test_fna/seqs1 -o $out/reference
|
|
|
|
${lib.getExe kssd} dist -L ${kssd.src}/shuf_file/L3K10.shuf -o $out/query ${kssd.src}/test_fna/seqs2
|
|
|
|
${lib.getExe kssd} dist -r $out/reference -o $out/distout $out/query
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "K-mer substring space decomposition";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://github.com/yhg926/public_kssd";
|
|
|
|
maintainers = with maintainers; [ unode ];
|
2023-11-16 04:20:00 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
mainProgram = "kssd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
})
|