aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2018-09-26 14:58:34 +1000
committerJustin Bedo <cu@cua0.org>2018-09-26 14:58:34 +1000
commit9de0e998ef5fe8f53412a77f99862bc9f5c15f24 (patch)
tree18e6e3f43bc6d7d5d3a5b8a7375c903d4c70eb19 /tools
parentb4da5a5b3564e644975c90dad0ef32073b6513a9 (diff)
move bwa index to parameters
Diffstat (limited to 'tools')
-rw-r--r--tools/bwa-mem.nix7
1 files changed, 3 insertions, 4 deletions
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)