diff options
-rw-r--r-- | default.nix | 1 | ||||
-rw-r--r-- | tools/picard-markDuplicates.nix | 33 | ||||
-rw-r--r-- | tools/picard.nix | 7 |
3 files changed, 41 insertions, 0 deletions
diff --git a/default.nix b/default.nix index 450118d..54d0215 100644 --- a/default.nix +++ b/default.nix @@ -27,6 +27,7 @@ let mosdepth = callBionix ./tools/mosdepth.nix {}; mutect = callBionix ./tools/mutect.nix {}; minimap2 = callBionix ./tools/minimap2.nix {}; + picard = callBionix ./tools/picard.nix {}; platypus = callBionix ./tools/platypus.nix {}; ref = callBionix ./lib/references.nix {}; samtools = callBionix ./tools/samtools.nix {}; diff --git a/tools/picard-markDuplicates.nix b/tools/picard-markDuplicates.nix new file mode 100644 index 0000000..957a05e --- /dev/null +++ b/tools/picard-markDuplicates.nix @@ -0,0 +1,33 @@ +{ bionix +, flags ? null +} : + +inputBam : + +with bionix; +with lib; +with types; + +assert (matchFiletype "picard-markDuplicates" { bam = _: true; } inputBam); +assert (matchFileSorting + "picard-markDuplicates" + { coord = _: true; name = _: true; } + inputBam); + +# Note that picard markDuplicates has different behaviour depending on whether the input +# is name-sorted or coordinate-sorted. + +stage { + name = "picard-markDuplicates"; + buildInputs = with pkgs; + [ picard-tools ]; + outputs = [ "out" "metrics" ]; + buildCommand = '' + picard MarkDuplicates \ + I=${inputBam} \ + O=$out \ + M=$metrics \ + ${optionalString (flags != null) flags} + ''; + passthru.filetype = inputBam.filetype; +} diff --git a/tools/picard.nix b/tools/picard.nix new file mode 100644 index 0000000..551995f --- /dev/null +++ b/tools/picard.nix @@ -0,0 +1,7 @@ +{ bionix }: + +with bionix; + +{ + markDuplicates = callBionixE ./picard-markDuplicates.nix; +}
\ No newline at end of file |