diff options
author | Justin Bedo <cu@cua0.org> | 2018-09-26 10:53:53 +1000 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2018-09-26 10:53:53 +1000 |
commit | 98672cb1bba7221c5c8ecc363243cb47fcd13f47 (patch) | |
tree | c5c73fc08323a8350a0ba80aae7a7232fed19171 /tools/bwa.nix | |
parent | 45af0256cf75fa28e75b6cf6874df0c48aac38cf (diff) |
refactor, add mosdepth, and fixes for bwa
Diffstat (limited to 'tools/bwa.nix')
-rw-r--r-- | tools/bwa.nix | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/tools/bwa.nix b/tools/bwa.nix index 20a308f..df61cba 100644 --- a/tools/bwa.nix +++ b/tools/bwa.nix @@ -1,34 +1,8 @@ -{ stdenv -, callPackage -, lib -, bwa -, samtools ? null -, ref -, bamOutput ? true -, flags ? null -}: +{ bionix, nixpkgs }: -{ input1 -, input2 ? null -}: +with nixpkgs; -assert bamOutput -> samtools != null; - -with lib; - -let index = callPackage ./bwa-index.nix { inherit bwa stdenv lib; } ref; - -in stdenv.mkDerivation { - name = "bwa-mem"; - buildInputs = [ bwa ] ++ optional bamOutput samtools; - buildCommand = '' - ln -s ${ref} ref.fa - for f in ${index}/* ; do - ln -s $f - done - bwa mem ${optionalString (flags != null) flags} -t $NIX_BUILD_CORES ref.fa ${input1} \ - ${optionalString (input2 != null) input2} \ - ${optionalString bamOutput "| samtools view -b"} \ - > $out - ''; +{ + align = attrs: callPackage ./bwa-mem.nix attrs; + index = attrs: callPackage ./bwa-index.nix attrs; } |