aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-01-17 09:34:34 +1100
committerJustin Bedo <cu@cua0.org>2019-01-17 09:34:34 +1100
commit39de5e9a3e9f6345442146cca342565b29640a42 (patch)
tree9ffabda0db9f0d0dd418908994198042bedb4bac
parentd9223958d2d83a936719694db63c4777a8dde274 (diff)
strelka: refactor vcf extraction
-rw-r--r--tools/strelka-call.nix13
-rw-r--r--tools/strelka-callSomatic.nix28
-rw-r--r--tools/strelka.nix18
3 files changed, 27 insertions, 32 deletions
diff --git a/tools/strelka-call.nix b/tools/strelka-call.nix
index e90bdfd..1162558 100644
--- a/tools/strelka-call.nix
+++ b/tools/strelka-call.nix
@@ -16,14 +16,12 @@ let
refs = map getref inputs;
ref = head refs;
- drv = bionix.strelka.call {inherit indexAttrs bamIndexAttrs flags;} inputs;
-
in
assert (length (unique refs) == 1);
stage {
- name = "strelka-call";
+ name = "strelka";
buildInputs = with pkgs; [ strelka ];
buildCommand = ''
ln -s ${ref} ref.fa
@@ -32,7 +30,7 @@ stage {
${concatMapStringsSep "\n" (p: "ln -s ${bionix.samtools.index bamIndexAttrs p} ${filename p}.bai") inputs}
configureStrelkaGermlineWorkflow.py \
- ${concatMapStringsSep " " (i: "--bam ${filename i}.bam") inputs} \
+ ${concatMapStringsSep " " (i: "--bam ${filename i}.bam") inputs} \
--ref ref.fa \
--runDir $TMPDIR
@@ -42,11 +40,4 @@ stage {
cp -r results $out
'';
- passthru.variants = stage {
- name = "strelka-call-variants";
- buildCommand = ''
- ln -s ${drv}/variants/variants.vcf.gz $out
- '';
- passthru.filetype = filetype.gz (filetype.vcf {ref=ref;});
- };
}
diff --git a/tools/strelka-callSomatic.nix b/tools/strelka-callSomatic.nix
index 888e589..6d379f9 100644
--- a/tools/strelka-callSomatic.nix
+++ b/tools/strelka-callSomatic.nix
@@ -17,14 +17,12 @@ let
refs = map getref inputs;
ref = head refs;
- drv = bionix.strelka.callSomatic {inherit indexAttrs bamIndexAttrs flags;} {inherit normal tumour;};
-
in
assert (length (unique refs) == 1);
stage {
- name = "strelka-callSomatic";
+ name = "strelka";
buildInputs = with pkgs; [ strelka gzip ];
buildCommand = ''
ln -s ${ref} ref.fa
@@ -33,27 +31,15 @@ stage {
${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
+ --normalBam ${filename normal}.bam \
+ --tumourBam ${filename tumour}.bam \
+ --ref ref.fa \
+ --runDir $TMPDIR
./runWorkflow.py \
- -m local \
- -j $NIX_BUILD_CORES
+ -m local \
+ -j $NIX_BUILD_CORES
cp -r results $out
'';
- passthru = {
- indels = stage {
- name = "strelka-callVariants-indels";
- buildCommand = "ln -s ${drv}/variants/somatic.indels.vcf.gz $out";
- passthru.filetype = filetype.gz (filetype.vcf {ref = ref;});
- };
- snvs = stage {
- name = "strelka-callVariants-snvs";
- buildCommand = "ln -s ${drv}/variants/somatic.snvs.vcf.gz $out";
- passthru.filetype = filetype.gz (filetype.vcf {ref = ref;});
- };
- };
}
diff --git a/tools/strelka.nix b/tools/strelka.nix
index 04facb9..9a8f1aa 100644
--- a/tools/strelka.nix
+++ b/tools/strelka.nix
@@ -1,8 +1,26 @@
{ bionix }:
with bionix;
+with types;
{
callSomatic = callBionixE ./strelka-callSomatic.nix;
call = callBionixE ./strelka-call.nix;
+ variants = drv: stage {
+ name = "strelka-call-variants";
+ buildCommand = ''
+ ln -s ${drv}/variants/variants.vcf.gz $out
+ '';
+ passthru.filetype = filetype.gz (filetype.vcf {ref=ref;});
+ };
+ indels = drv: stage {
+ name = "strelka-callVariants-indels";
+ buildCommand = "ln -s ${drv}/variants/somatic.indels.vcf.gz $out";
+ passthru.filetype = filetype.gz (filetype.vcf {ref = ref;});
+ };
+ snvs = drv: stage {
+ name = "strelka-callVariants-snvs";
+ buildCommand = "ln -s ${drv}/variants/somatic.snvs.vcf.gz $out";
+ passthru.filetype = filetype.gz (filetype.vcf {ref = ref;});
+ };
}