diff options
Diffstat (limited to 'tools/strelka-callSomatic.nix')
-rw-r--r-- | tools/strelka-callSomatic.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/strelka-callSomatic.nix b/tools/strelka-callSomatic.nix new file mode 100644 index 0000000..8505302 --- /dev/null +++ b/tools/strelka-callSomatic.nix @@ -0,0 +1,45 @@ +{ bionix +, indexAttrs ? {} +, bamIndexAttrs ? {} +, flags ? null +}: + +{normal, tumour}: + +with bionix; +with lib; +with 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 + +assert (length (unique refs) == 1); + +stage { + name = "strelka"; + buildInputs = with pkgs; [ strelka ]; + buildCommand = '' + 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} + + 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 + ''; +} |