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

input:

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
  '';
}