aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2021-02-23 08:21:32 +1100
committerJustin Bedo <cu@cua0.org>2021-02-23 08:21:32 +1100
commit6a4e278ef941a687d704261c903b95d4b63cf334 (patch)
treea6ae99d9be226840bf6a3231728820e884810747
parent64f8b0cb124445620b30e10e268fd7670ccb3189 (diff)
samtools-view: support specifying outfmt via strings
-rw-r--r--tools/samtools-view.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/samtools-view.nix b/tools/samtools-view.nix
index e1ca0a8..35a3fcb 100644
--- a/tools/samtools-view.nix
+++ b/tools/samtools-view.nix
@@ -13,7 +13,7 @@ with types;
assert (matchFiletype "samtools-view" { bam = _: true; sam = _: true; cram = _: true; } input);
let
- outfmtR = if outfmt != null then outfmt input else input.filetype;
+ outfmtR = if outfmt != null then (if builtins.typeOf outfmt == "string" then { "bam" = toBam; "cram" = toCram; "sam" = toSam; }."${outfmt}" else outfmt) input else input.filetype;
fa = ref: matchFiletype "samtools-view-ref" { fa = _: ref; } ref;
outfmtFlags = matchFiletype "samtools-view-outfmt" { bam = _: "-O BAM"; sam = _: "-O SAM"; cram = x: "-O CRAM -T ${fa x.ref}"; } {filetype = outfmtR;};
in stage {