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

with bionix;
with lib;

input:

stage {
  name = "mosdepth-depth";
  buildInputs = with pkgs; [ mosdepth ];
  buildCommand = ''
    mkdir $out
    ln -s ${input} input.bam
    ln -s ${bionix.samtools.index indexAttrs input} input.bam.bai
    mosdepth -t $NIX_BUILD_CORES ${optionalString (flags != null) flags} $out/out input.bam
  '';
  passthru.multicore = true;
}