aboutsummaryrefslogtreecommitdiff
path: root/tools/strelka-call.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2018-10-05 16:16:20 +1000
committerJustin Bedo <cu@cua0.org>2018-10-05 16:19:06 +1000
commit871ef64f3c43199dfa01216ac86db56650c2c8a2 (patch)
tree7053b4533d7306b3fc0eed8f9bc25e8e2abb6d6e /tools/strelka-call.nix
parentdd3666f6a069105e61f8889665cf55eed9a14e51 (diff)
implement types
Diffstat (limited to 'tools/strelka-call.nix')
-rw-r--r--tools/strelka-call.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/strelka-call.nix b/tools/strelka-call.nix
index ecdea84..bcbb6d1 100644
--- a/tools/strelka-call.nix
+++ b/tools/strelka-call.nix
@@ -1,6 +1,5 @@
{ bionix
, nixpkgs
-, ref
, indexAttrs ? {}
, bamIndexAttrs ? {}
, flags ? null
@@ -10,17 +9,25 @@
with nixpkgs;
with lib;
+with bionix.types;
let
filename = path: last (splitString "/" path);
+ getref = f: matchFiletype "strelka-call" { bam = x: x.ref; } f;
inputs = [ normal tumour ];
+ refs = map getref inputs;
+ ref = head refs;
-in stdenv.mkDerivation {
+in
+
+assert (length (unique refs) == 1);
+
+stdenv.mkDerivation {
name = "strelka";
buildInputs = [ strelka ];
buildCommand = ''
- ln -s ${ref.seq} ref.fa
- ln -s ${bionix.samtools.faidx indexAttrs ref.seq} ref.fa.fai
+ ln -s ${ref} ref.fa
+ ln -s ${bionix.samtools.faidx indexAttrs ref} ref.fa.fai
${concatMapStringsSep "\n" (p: "ln -s ${p} ${filename p}.bam") inputs}
${concatMapStringsSep "\n" (p: "ln -s ${bionix.samtools.index bamIndexAttrs p} ${filename p}.bai") inputs}