aboutsummaryrefslogtreecommitdiff
path: root/tools/bwa-mem2.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2021-12-06 17:23:47 +1100
committerJustin Bedo <cu@cua0.org>2021-12-06 17:23:47 +1100
commitd75b723281aea944fbafdb28f5b0841a03827b4a (patch)
tree1b3b8a6103ed6547d00b1e3e1b61b08038e08a27 /tools/bwa-mem2.nix
parent18d442a951dc36a352c13c604642cb3d4db5a6b6 (diff)
parameterise RG line as nix attribute set
Allows more seamless transitioning between alingment algorithms
Diffstat (limited to 'tools/bwa-mem2.nix')
-rw-r--r--tools/bwa-mem2.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/bwa-mem2.nix b/tools/bwa-mem2.nix
index 843c5b0..e6237f0 100644
--- a/tools/bwa-mem2.nix
+++ b/tools/bwa-mem2.nix
@@ -3,6 +3,7 @@
, bamOutput ? true
, flags ? null
, indexAttrs ? { }
+, RG ? { }
}:
{ input1
@@ -33,6 +34,7 @@ stage {
fi
bwa-mem2 mem ${optionalString (flags != null) flags} -t $cores ref.fa ${fq input1} \
${optionalString (input2 != null) (fq input2)} \
+ ${optionalString (RG ? ID) "-R'@RG\\t${concatMapAttrsStringsSep "\\t" (k: v: "${k}:${v}") RG}'"} \
${optionalString bamOutput "| samtools view -b"} \
> $out
'';