aboutsummaryrefslogtreecommitdiff
path: root/tools/bwa-mem.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2018-10-04 12:06:54 +1000
committerJustin Bedo <cu@cua0.org>2018-10-04 12:06:54 +1000
commitfe68926931b280aaf29808566b49b2e704e8556a (patch)
treedad0e9e11852e161c87ea6b7f4f6100a5180b9f2 /tools/bwa-mem.nix
parent51f3817ecd2ad099b951d11e55eb3e2c516174d3 (diff)
Refactor to use bionix tree directly
Diffstat (limited to 'tools/bwa-mem.nix')
-rw-r--r--tools/bwa-mem.nix15
1 files changed, 5 insertions, 10 deletions
diff --git a/tools/bwa-mem.nix b/tools/bwa-mem.nix
index 9af3992..6e83a6d 100644
--- a/tools/bwa-mem.nix
+++ b/tools/bwa-mem.nix
@@ -1,21 +1,16 @@
-{ stdenv
-, callPackage
-, lib
-, bc
-, bwa
-, index ? callPackage ./bwa-index.nix { inherit bwa stdenv lib; }
-, samtools ? null
+{ bionix
+, nixpkgs
, ref
, bamOutput ? true
, flags ? null
+, indexAttrs ? {}
}:
{ input1
, input2 ? null
}:
-assert bamOutput -> samtools != null;
-
+with nixpkgs;
with lib;
stdenv.mkDerivation {
@@ -23,7 +18,7 @@ stdenv.mkDerivation {
buildInputs = [ bwa bc ] ++ optional bamOutput samtools;
buildCommand = ''
ln -s ${ref} ref.fa
- for f in ${index ref}/* ; do
+ for f in ${bionix.bwa.index indexAttrs ref}/* ; do
ln -s $f
done
cores=$(echo $NIX_BUILD_CORES ${optionalString bamOutput "- 1"} | bc)