aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2018-09-20 14:48:55 +1000
committerJustin Bedo <cu@cua0.org>2018-09-20 14:48:55 +1000
commitb5d974a395cf95db148642b5b4df308963fe18cc (patch)
treec6f86d24f7652acfeca9b12c963387361251005e /tools
parent33a121a7bad5b2608cc41ce60ab3d65676541fa6 (diff)
Add example TNPair
Diffstat (limited to 'tools')
-rw-r--r--tools/strelka.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/strelka.nix b/tools/strelka.nix
new file mode 100644
index 0000000..ec7a764
--- /dev/null
+++ b/tools/strelka.nix
@@ -0,0 +1,40 @@
+{ stdenv
+, callPackage
+, lib
+, strelka
+, ref
+, index ? callPackage ./samtools-faidx.nix {}
+, bamIndex ? callPackage ./samtools-index.nix {}
+, flags ? null
+}:
+
+{normal, tumour}:
+
+with lib;
+
+let
+ filename = path: last (splitString "/" path);
+ inputs = [ normal tumour ];
+
+in stdenv.mkDerivation {
+ name = "strelka";
+ buildInputs = [ strelka ];
+ 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}
+
+ configureStrelkaSomaticWorkflow.py \
+ --normalBam ${filename normal}.bam \
+ --tumourBam ${filename tumour}.bam \
+ --ref ref.fa \
+ --runDir $TMPDIR
+
+ ./runWorkflow.py \
+ -m local \
+ -j $NIX_BUILD_CORES
+
+ cp -r results $out
+ '';
+}