diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lumpy-call.nix | 40 | ||||
-rw-r--r-- | tools/lumpy.nix | 7 |
2 files changed, 47 insertions, 0 deletions
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; +} |