From 99ee99c490cc109b78986181ee1be4ce1cd0c0ed Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Thu, 25 Oct 2018 08:02:20 +1100 Subject: Improve type safety of samtools-merge --- tools/samtools-merge.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tools/samtools-merge.nix') diff --git a/tools/samtools-merge.nix b/tools/samtools-merge.nix index 6d072b0..eacf520 100644 --- a/tools/samtools-merge.nix +++ b/tools/samtools-merge.nix @@ -10,13 +10,11 @@ with nixpkgs; with lib; let - inherit (bionix.types) matchFiletype option-sort; - inputIsSorted = input: matchFiletype "samtools-merge" { - bam = _: true; #{sorting, ...}: sorting == option-sort.some (bionix.types.sorting.coord {}); - } input; + inherit (bionix.types) matchFiletype matchSorting; + inputIsHomogenous = length (unique (map (matchFiletype "samtools-merge" {bam = x: x // {sorting = matchSorting "samtools-merge" {coord = _: "coord";} x;};}) inputs)) == 1; in -assert (all inputIsSorted inputs); +assert inputIsHomogenous; stdenv.mkDerivation { name = "samtools-merge"; -- cgit v1.2.3