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

with lib;

input:

stdenv.mkDerivation {
  name = "mosdepth-depth";
  buildInputs = [ mosdepth ];
  buildCommand = ''
    mkdir $out
    ln -s ${input} input.bam
    ln -s ${index input} input.bam.bai
    mosdepth -t $NIX_BUILD_CORES ${optionalString (flags != null) flags} $out/out input.bam
  '';
}