aboutsummaryrefslogtreecommitdiff
path: root/tools/samtools-index.nix
blob: 4e09dc7b1ebcb692e6767b89228d74d6fc713761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ bionix
, nixpkgs
, flags ? null
}:

input:

with nixpkgs;
with lib;

stdenv.mkDerivation {
  name = "samtools-index";
  buildInputs = [ samtools ];
  buildCommand = ''
    ln -s ${input} input.bam
    samtools index -@ $NIX_BUILD_CORES ${optionalString (flags != null) flags} input.bam
    cp input.bam.bai $out
  '';
}