diff options
Diffstat (limited to 'tools/strelka-call.nix')
-rw-r--r-- | tools/strelka-call.nix | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/tools/strelka-call.nix b/tools/strelka-call.nix index 74dfd0b..6a84b24 100644 --- a/tools/strelka-call.nix +++ b/tools/strelka-call.nix @@ -1,6 +1,6 @@ { bionix -, indexAttrs ? {} -, bamIndexAttrs ? {} +, indexAttrs ? { } +, bamIndexAttrs ? { } , flags ? null }: @@ -12,7 +12,7 @@ with types; let filename = path: last (splitString "/" path); - getref = f: matchFiletype "strelka-call" { bam = x: x.ref; } f; + getref = matchFiletype "strelka-call" { bam = x: x.ref; }; refs = map getref inputs; ref = head refs; @@ -21,38 +21,39 @@ in assert (length (unique refs) == 1); let -out = stage { - name = "strelka-call"; - 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} - - configureStrelkaGermlineWorkflow.py \ - ${concatMapStringsSep " " (i: "--bam ${filename i}.bam") inputs} \ - --ref ref.fa \ - --runDir $TMPDIR - - ./runWorkflow.py \ - -m local \ - -j $NIX_BUILD_CORES 2>&1 - - # Strelka writes runtime stats and timestamps; - # both have to be stripped to provide determinism - cd results/variants - rm *.tbi genome.vcf.gz - for f in *.vcf.gz; do - gunzip $f - g=$(basename $f .gz) - sed -i '/^##fileDate/d' $g - sed -i '/^##startTime/d' $g - sed -i '/^##cmd/d' $g - done - mv variants.vcf $out - ''; - passthru.multicore = true; - passthru.filetype = types.filetype.vcf {ref = ref;}; -}; -in out + out = stage { + name = "strelka-call"; + 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} + + configureStrelkaGermlineWorkflow.py \ + ${concatMapStringsSep " " (i: "--bam ${filename i}.bam") inputs} \ + --ref ref.fa \ + --runDir $TMPDIR + + ./runWorkflow.py \ + -m local \ + -j $NIX_BUILD_CORES 2>&1 + + # Strelka writes runtime stats and timestamps; + # both have to be stripped to provide determinism + cd results/variants + rm *.tbi genome.vcf.gz + for f in *.vcf.gz; do + gunzip $f + g=$(basename $f .gz) + sed -i '/^##fileDate/d' $g + sed -i '/^##startTime/d' $g + sed -i '/^##cmd/d' $g + done + mv variants.vcf $out + ''; + passthru.multicore = true; + passthru.filetype = types.filetype.vcf { inherit ref; }; + }; +in +out |