aboutsummaryrefslogtreecommitdiff
path: root/tools/platypus.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2018-09-20 13:57:12 +1000
committerJustin Bedo <cu@cua0.org>2018-09-20 14:34:36 +1000
commit33a121a7bad5b2608cc41ce60ab3d65676541fa6 (patch)
treedbbce4154a85988f3bfd9b13d42ad5d37f04e18a /tools/platypus.nix
parentf0a8a4de59ea79f56e074ddd16eff0ce1782dfe8 (diff)
Wrap some tools and make an example pipeline
Diffstat (limited to 'tools/platypus.nix')
-rw-r--r--tools/platypus.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/platypus.nix b/tools/platypus.nix
new file mode 100644
index 0000000..3e150d2
--- /dev/null
+++ b/tools/platypus.nix
@@ -0,0 +1,33 @@
+{ stdenv
+, callPackage
+, lib
+, platypus
+, ref
+, index ? callPackage ./samtools-faidx.nix {}
+, bamIndex ? callPackage ./samtools-index.nix {}
+, flags ? null
+}:
+
+inputs:
+
+with lib;
+
+let filename = path: last (splitString "/" path);
+
+in stdenv.mkDerivation {
+ name = "platypus";
+ buildInputs = [ platypus ];
+ buildCommand = ''
+ ln -s ${ref} ref.fa
+ ln -s ${index ref} ref.fa.fai
+ ${concatMapStringsSep "\n" (p: "ln -s ${p} ${filename p}.bam") inputs}
+ ${concatMapStringsSep "\n" (p: "ln -s ${bamIndex p} ${filename p}.bai") inputs}
+ ls -l
+ platypus callVariants \
+ --nCPU=$NIX_BUILD_CORES \
+ --refFile=ref.fa \
+ ${optionalString (flags != null) flags} \
+ -o $out \
+ --bamFiles=${concatMapStringsSep "," (p: "${filename p}.bam") inputs}
+ '';
+}