From fc17098fd20b49ce72756b8eb25c7a09f2ed4434 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Fri, 28 Sep 2018 09:57:19 +1000 Subject: Change mosdepth plotting to multisample --- tools/mosdepth-plot.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/mosdepth-plot.nix b/tools/mosdepth-plot.nix index 464e495..e6d2c7d 100644 --- a/tools/mosdepth-plot.nix +++ b/tools/mosdepth-plot.nix @@ -1,15 +1,22 @@ { stdenv +, lib , mosdepth , python , flags ? null}: -input: +with lib; + +{ inputs +, names ? []}: stdenv.mkDerivation { name = "mosdepth-depth"; buildInputs = [ python ]; buildCommand = '' - python ${mosdepth.src}/scripts/plot-dist.py ${input}/*global.dist.txt + python ${mosdepth.src}/scripts/plot-dist.py ${concatMapStringsSep " " (i: "${i}/out.mosdepth.global.dist.txt") inputs} + ${concatStringsSep "\n" (zipListsWith (i: n: "substituteInPlace dist.html --replace ${i}/out ${n}") 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 ''; } -- cgit v1.2.3