aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-04-08 07:27:35 +1000
committerJustin Bedo <cu@cua0.org>2019-04-08 07:27:35 +1000
commit51dbff37cc69737c47cd4c2c758bb252054497ad (patch)
tree99f43928a640a204618da5f006148c2d6d6aa4ec
parente5a8870358713f4e44e135da913c50230d83d4f1 (diff)
bowtie: sort the output to ensure determinism
-rw-r--r--tools/bowtie-align.nix3
1 files changed, 2 insertions, 1 deletions
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
'';