From d75b723281aea944fbafdb28f5b0841a03827b4a Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Mon, 6 Dec 2021 17:23:47 +1100 Subject: parameterise RG line as nix attribute set Allows more seamless transitioning between alingment algorithms --- tools/bowtie-align.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/bowtie-align.nix') diff --git a/tools/bowtie-align.nix b/tools/bowtie-align.nix index 8df3dba..cca12a2 100644 --- a/tools/bowtie-align.nix +++ b/tools/bowtie-align.nix @@ -3,6 +3,7 @@ , bamOutput ? true , flags ? null , indexAttrs ? { } +, RG ? { } }: { input1 @@ -29,7 +30,9 @@ stage { fi bowtie2 -x ${bionix.bowtie.index indexAttrs ref}/ref ${optionalString (flags != null) flags} --threads $cores \ ${if input2 != null then "-1 " + fq input1 + " -2 " + fq input2 else "-U " + fq input1} \ - | samtools sort -n \ + ${optionalString (RG ? ID) '' + --rg-id ${RG.ID} ${concatMapAttrsStringsSep " " (k: v: "--rg ${k}:${v}") (filterAttrs (k: _: k != "ID") RG)} \ + ''} \ ${optionalString bamOutput "| samtools view -b"} \ > $out ''; -- cgit v1.2.3