aboutsummaryrefslogtreecommitdiff
path: root/tools/mosdepth-plot.nix
blob: 87eb67f1c473f68b78e21e76d59437bd783b2fa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ bionix
, what ? "global"
, flags ? null
}:

with bionix;
with lib;

{ inputs
, names ? [ ]
}:

stage {
  name = "mosdepth-plot";
  buildInputs = with pkgs; [ python ];
  buildCommand = ''
    python ${pkgs.mosdepth.src}/scripts/plot-dist.py ${concatMapStringsSep " " (i: "${i}/out.mosdepth.${what}.dist.txt") inputs}
    ${concatStringsSep "\n" (zipListsWith (i: n: "sed -i 's|${i}[^ ]*|${n}|' dist.html") inputs names)}
    substituteInPlace dist.html --replace "x: 0.1" "x: 0.9"
    substituteInPlace dist.html --replace "y: 0.1" "y: 0.9"
    mv dist.html $out
  '';
}