From 2ad72c4c3d33f685297ecdeb799a91afae2dccb5 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Fri, 21 Jun 2019 10:07:29 +1000 Subject: bwa-mem2: init --- tools/bwa-index2.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/bwa-index2.nix (limited to 'tools/bwa-index2.nix') diff --git a/tools/bwa-index2.nix b/tools/bwa-index2.nix new file mode 100644 index 0000000..f5cc69b --- /dev/null +++ b/tools/bwa-index2.nix @@ -0,0 +1,23 @@ +{ bionix +, flags ? null +}: + +ref: + +with bionix; +with lib; +with types; + +assert (matchFiletype "bwa-index" { fa = _: true; } ref); + +stage { + name = "bwa-index2"; + buildInputs = with pkgs; [ bionix.bwa.app2 ]; + buildCommand = '' + ln -s ${ref} ref.fa + bwa-mem2 index ${optionalString (flags != null) flags} ref.fa + mkdir $out + mv ref.fa.* $out + grep '^>[^ \t]*_alt$' ref.fa | tr -d '^>' > $out/idxbase.alt || true + ''; +} -- cgit v1.2.3