From 9de0e998ef5fe8f53412a77f99862bc9f5c15f24 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Wed, 26 Sep 2018 14:58:34 +1000 Subject: move bwa index to parameters --- tools/bwa-mem.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/bwa-mem.nix b/tools/bwa-mem.nix index 5a2772e..9af3992 100644 --- a/tools/bwa-mem.nix +++ b/tools/bwa-mem.nix @@ -3,6 +3,7 @@ , lib , bc , bwa +, index ? callPackage ./bwa-index.nix { inherit bwa stdenv lib; } , samtools ? null , ref , bamOutput ? true @@ -17,14 +18,12 @@ assert bamOutput -> samtools != null; with lib; -let index = callPackage ./bwa-index.nix { inherit bwa stdenv lib; } ref; - -in stdenv.mkDerivation { +stdenv.mkDerivation { name = "bwa-mem"; buildInputs = [ bwa bc ] ++ optional bamOutput samtools; buildCommand = '' ln -s ${ref} ref.fa - for f in ${index}/* ; do + for f in ${index ref}/* ; do ln -s $f done cores=$(echo $NIX_BUILD_CORES ${optionalString bamOutput "- 1"} | bc) -- cgit v1.2.3