aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-12-18 09:54:54 +1100
committerJustin Bedo <cu@cua0.org>2019-12-18 09:56:28 +1100
commit8b97c7e8f685dd3c402e172ea15ef9716b529c8e (patch)
tree3f42658a22d79800e7597e30f6f0c44edac29147 /tools
parent123d38340bd38524f0c53a52ccb3d57d43e6fb6d (diff)
lumpy: init
Diffstat (limited to 'tools')
-rw-r--r--tools/lumpy-call.nix40
-rw-r--r--tools/lumpy.nix7
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;
+}