nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 boost,
6 bzip2,
7 htslib,
8 llvmPackages,
9 xz,
10 zlib,
11 delly,
12 runCommand,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "delly";
17 version = "1.3.3";
18
19 src = fetchFromGitHub {
20 owner = "dellytools";
21 repo = "delly";
22 rev = "v${finalAttrs.version}";
23 hash = "sha256-e1dGiJeOLMFJ9oO7iMvKZHpg4XtrLJBpy8lECx5/iDE=";
24 };
25
26 postPatch = lib.optionalString stdenv.cc.isClang ''
27 substituteInPlace Makefile \
28 --replace-fail "-std=c++17" "-std=c++14"
29 '';
30
31 buildInputs = [
32 boost
33 bzip2
34 htslib
35 xz
36 zlib
37 ]
38 ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
39
40 makeFlags = [
41 "EBROOTHTSLIB=${htslib}"
42 "PARALLEL=1"
43 ];
44
45 installPhase = ''
46 runHook preInstall
47
48 install -Dm555 src/delly $out/bin/delly
49
50 runHook postInstall
51 '';
52
53 passthru.tests = {
54 simple = runCommand "${finalAttrs.pname}-test" { } ''
55 mkdir $out
56 ${lib.getExe delly} call -g ${delly.src}/example/ref.fa ${delly.src}/example/sr.bam > $out/sr.vcf
57 ${lib.getExe delly} lr -g ${delly.src}/example/ref.fa ${delly.src}/example/lr.bam > $out/lr.vcf
58 ${lib.getExe delly} cnv -g ${delly.src}/example/ref.fa -m ${delly.src}/example/map.fa.gz ${delly.src}/example/sr.bam > cnv.vcf
59 '';
60 };
61
62 meta = with lib; {
63 description = "Structural variant caller for mapped DNA sequenced data";
64 mainProgram = "delly";
65 license = licenses.bsd3;
66 maintainers = with maintainers; [ scalavision ];
67 platforms = platforms.unix;
68 longDescription = ''
69 Delly is an integrated structural variant (SV) prediction method
70 that can discover, genotype and visualize deletions, tandem duplications,
71 inversions and translocations at single-nucleotide resolution in
72 short-read massively parallel sequencing data. It uses paired-ends,
73 split-reads and read-depth to sensitively and accurately delineate
74 genomic rearrangements throughout the genome.
75 '';
76 };
77})