From 8b97c7e8f685dd3c402e172ea15ef9716b529c8e Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Wed, 18 Dec 2019 09:54:54 +1100 Subject: lumpy: init --- tools/lumpy-call.nix | 40 ++++++++++++++++++++++++++++++++++++++++ tools/lumpy.nix | 7 +++++++ 2 files changed, 47 insertions(+) create mode 100644 tools/lumpy-call.nix create mode 100644 tools/lumpy.nix (limited to 'tools') diff --git a/tools/lumpy-call.nix b/tools/lumpy-call.nix new file mode 100644 index 0000000..e5fb7d3 --- /dev/null +++ b/tools/lumpy-call.nix @@ -0,0 +1,40 @@ +{ bionix, flags ? "", faidxAttrs ? { }, indexAttrs ? { } }: + +inputs: + +with bionix; +with lib; +with types; + +let + getref = matchFiletype "manta-call" { bam = x: x.ref; }; + refs = map getref inputs; + ref = head refs; + + renameAndIndex = f: + stage { + name = "rename"; + buildCommand = '' + mkdir $out + ln -s ${f} $out/sample.bam + ln -s ${samtools.index indexAttrs f} $out/sample.bam.bai + ''; + }; + +in assert (length (unique refs) == 1); + +stage { + name = "lumpy"; + buildInputs = with pkgs; [ lumpy ]; + buildCommand = '' + ln -s ${ref} ref.fa + ln -s ${samtools.faidx faidxAttrs ref} ref.fa.fai + lumpyexpress \ + ${ + concatMapStringsSep " " (i: "-B ${renameAndIndex i}/sample.bam") inputs + } \ + ${flags} \ + -o $out + ''; + passthru.filetype = filetype.vcf { ref = ref; }; +} diff --git a/tools/lumpy.nix b/tools/lumpy.nix new file mode 100644 index 0000000..0894054 --- /dev/null +++ b/tools/lumpy.nix @@ -0,0 +1,7 @@ +{ bionix }: + +with bionix; + +{ + call = callBionixE ./lumpy-call.nix; +} -- cgit v1.2.3