aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-05-09 14:23:53 +1000
committerJustin Bedo <cu@cua0.org>2019-05-09 14:23:53 +1000
commit6137d292d8d721490bf6ded2695cdc71755aff59 (patch)
tree7e26b12750b73120509bb886a82bea319ae688ac
parent795c1ce6b03bfa1cefb628026e08371f39b86296 (diff)
strelka: rewrite to use multiple outputs
-rw-r--r--test-tnpair.nix6
-rw-r--r--tools/strelka-call.nix10
-rw-r--r--tools/strelka-callSomatic.nix13
-rw-r--r--tools/strelka.nix32
4 files changed, 22 insertions, 39 deletions
diff --git a/test-tnpair.nix b/test-tnpair.nix
index 2ea93ae..4d6a794 100644
--- a/test-tnpair.nix
+++ b/test-tnpair.nix
@@ -51,9 +51,9 @@ let
(ln (facets.callCNV {} {vcf = tnpairResult.platypusVars; bams = with tnpairResult.alignments; [ normal tumour ];}) "facets")
(ln tnpairResult.variants "strelka")
(ln tnpairResult.glvariants "strelka-gl")
- (ln (strelka.indels tnpairResult.variants) "strelka.indels.vcf")
- (ln (strelka.snvs tnpairResult.variants) "strelka.snvs.vcf")
- (ln (strelka.variants tnpairResult.glvariants) "strelka.gl.vcf")
+ (ln tnpairResult.variants.indels "strelka.indels.vcf")
+ (ln tnpairResult.variants.snvs "strelka.snvs.vcf")
+ (ln tnpairResult.glvariants.variants "strelka.gl.vcf")
(ln (bowtie.align {inherit ref;} tnpair.normal.files) "alignments/bowtie-normal.bam")
(ln (minimap2.align {inherit ref; preset = "sr"; } tnpair.normal.files) "alignments/minimap2-normal.bam")
(ln (snap.align {inherit ref; } tnpair.normal.files) "alignments/snap-normal.bam")
diff --git a/tools/strelka-call.nix b/tools/strelka-call.nix
index bc1e202..dc07291 100644
--- a/tools/strelka-call.nix
+++ b/tools/strelka-call.nix
@@ -20,9 +20,11 @@ in
assert (length (unique refs) == 1);
-stage {
+let
+out = stage {
name = "strelka-call";
buildInputs = with pkgs; [ strelka ];
+ outputs = [ "out" "variants" ];
buildCommand = ''
ln -s ${ref} ref.fa
ln -s ${bionix.samtools.faidx indexAttrs ref} ref.fa.fai
@@ -48,8 +50,12 @@ stage {
sed -i '/^##fileDate/d' $g
sed -i '/^##startTime/d' $g
done
+ mv variants.vcf $variants
+ ln -s $variants variants.vcf
mkdir $out
cp -r * $out
'';
passthru.multicore = true;
-}
+};
+ft = {filetype = types.filetype.vcf {ref = ref;};};
+in out // { variants = out.variants // ft; }
diff --git a/tools/strelka-callSomatic.nix b/tools/strelka-callSomatic.nix
index cf4b414..cce6243 100644
--- a/tools/strelka-callSomatic.nix
+++ b/tools/strelka-callSomatic.nix
@@ -21,9 +21,12 @@ in
assert (length (unique refs) == 1);
-stage {
+let
+
+out = stage {
name = "strelka-callSomatic";
buildInputs = with pkgs; [ strelka ];
+ outputs = [ "out" "indels" "snvs" ];
buildCommand = ''
ln -s ${ref} ref.fa
ln -s ${bionix.samtools.faidx indexAttrs ref} ref.fa.fai
@@ -50,8 +53,14 @@ stage {
sed -i '/^##fileDate/d' $g
sed -i '/^##startTime/d' $g
done
+ mv somatic.indels.vcf $indels
+ ln -s $indels somatic.indels.vcf
+ mv somatic.snvs.vcf $snvs
+ ln -s $snvs somatic.snvs.vcf
mkdir $out
cp -r * $out
'';
passthru.multicore = true;
-}
+};
+ft = {filetype = types.filetype.vcf {ref = ref;};};
+in out // { indels = out.indels // ft; snvs = out.snvs // ft;}
diff --git a/tools/strelka.nix b/tools/strelka.nix
index d3068b5..16f4a2b 100644
--- a/tools/strelka.nix
+++ b/tools/strelka.nix
@@ -12,36 +12,4 @@ with types;
Type: call :: {...} -> [input] -> results
*/
call = callBionixE ./strelka-call.nix;
- /* Extract VCF file from results
- Type: variants :: results -> vcf
- */
- variants =
- # result of call
- drv: stage {
- name = "strelka-call-variants";
- buildCommand = ''
- ln -s ${drv}/variants/variants.vcf $out
- '';
- passthru.filetype = filetype.vcf {ref=ref;};
- };
- /* Extract indels from somatic results
- Type: indels :: somatic results -> vcf
- */
- indels =
- # result of callSomatic
- drv: stage {
- name = "strelka-callVariants-indels";
- buildCommand = "ln -s ${drv}/variants/somatic.indels.vcf $out";
- passthru.filetype = filetype.vcf {ref = ref;};
- };
- /* Extract SNVs from somatic results
- Type: snvs :: somatic results -> vcf
- */
- snvs =
- # result of callSomatic
- drv: stage {
- name = "strelka-callVariants-snvs";
- buildCommand = "ln -s ${drv}/variants/somatic.snvs.vcf $out";
- passthru.filetype = filetype.vcf {ref = ref;};
- };
}