From 51dbff37cc69737c47cd4c2c758bb252054497ad Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Mon, 8 Apr 2019 07:27:35 +1000 Subject: bowtie: sort the output to ensure determinism --- tools/bowtie-align.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/bowtie-align.nix b/tools/bowtie-align.nix index 65d0e9f..57b0b01 100644 --- a/tools/bowtie-align.nix +++ b/tools/bowtie-align.nix @@ -20,7 +20,7 @@ let in stage { name = "bowtie2-align"; - buildInputs = with pkgs; [ bowtie2 bc ] ++ optional bamOutput samtools; + buildInputs = with pkgs; [ bowtie2 bc samtools ]; buildCommand = '' cores=$(echo $NIX_BUILD_CORES ${optionalString bamOutput "- 1"} | bc) if [[ $cores -lt 1 ]] ; then @@ -28,6 +28,7 @@ in 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 bamOutput "| samtools view -b"} \ > $out ''; -- cgit v1.2.3