diff options
Diffstat (limited to 'examples/ex-tnpair')
-rw-r--r-- | examples/ex-tnpair/cluster.nix | 14 | ||||
-rw-r--r-- | examples/ex-tnpair/default.nix | 3 | ||||
-rw-r--r-- | examples/ex-tnpair/tnpair.nix | 33 |
3 files changed, 29 insertions, 21 deletions
diff --git a/examples/ex-tnpair/cluster.nix b/examples/ex-tnpair/cluster.nix index 8d54995..5d4e1de 100644 --- a/examples/ex-tnpair/cluster.nix +++ b/examples/ex-tnpair/cluster.nix @@ -4,11 +4,12 @@ let bionix = import <bionix> { overlays = [ (_: super: - super."${if tmpDir == null then "slurm" else "qsub"}" { - ppn = 24; - mem = 7; - walltime = "3:00:00"; - } // super.lib.optionalAttrs (tmpDir != null) { inherit tmpDir; }) + super."${if tmpDir == null then "slurm" else "qsub"}" + { + ppn = 24; + mem = 7; + walltime = "3:00:00"; + } // super.lib.optionalAttrs (tmpDir != null) { inherit tmpDir; }) (self: super: with super; { @@ -27,4 +28,5 @@ let }) ]; }; -in import ./. { inherit bionix; } +in +import ./. { inherit bionix; } diff --git a/examples/ex-tnpair/default.nix b/examples/ex-tnpair/default.nix index f9581f8..65a2265 100644 --- a/examples/ex-tnpair/default.nix +++ b/examples/ex-tnpair/default.nix @@ -45,6 +45,7 @@ let fetch = s: mapAttrs (_: fetchFastQGZ) s.inputs; -in import ./tnpair.nix { +in +import ./tnpair.nix { inherit pair fetch bionix; } diff --git a/examples/ex-tnpair/tnpair.nix b/examples/ex-tnpair/tnpair.nix index 9e6befe..414a391 100644 --- a/examples/ex-tnpair/tnpair.nix +++ b/examples/ex-tnpair/tnpair.nix @@ -1,4 +1,4 @@ -{bionix ? import <bionix> {}, pair, fetch}: +{ bionix ? import <bionix> { }, pair, fetch }: with bionix; with lib; @@ -13,7 +13,7 @@ let fetch (align { preset = "sr"; ref = ref.grch38.seq; flags = "-R'@RG\\tID:${s.type}\\tSM:${s.type}'"; }) (sort { nameSort = true; }) - (fixmate {}) + (fixmate { }) (sort { }) (markdup { }) ]; @@ -28,21 +28,26 @@ let bams = mapAttrs (_: preprocess) pair; - variants = let - somatic = strelka.callSomatic { } bams; in mapAttrs (_: flip pipe [ - (compression.uncompress { }) - (snpeff.annotate { db = ref.grch38.snpeff.db; }) - dropErrors - (snpeff.dbnsfp { dbnsfp = ref.grch38.snpeff.dbnsfp; }) - ]) { - "snvs.vcf" = somatic.snvs; - "indels.vcf" = somatic.snvs; - "germline.vcf" = strelka.call { } [bams.normal]; - }; + variants = + let + somatic = strelka.callSomatic { } bams; in + mapAttrs + (_: flip pipe [ + (compression.uncompress { }) + (snpeff.annotate { inherit (ref.grch38.snpeff) db; }) + dropErrors + (snpeff.dbnsfp { inherit (ref.grch38.snpeff) dbnsfp; }) + ]) + { + "snvs.vcf" = somatic.snvs; + "indels.vcf" = somatic.snvs; + "germline.vcf" = strelka.call { } [ bams.normal ]; + }; cnvs = cnvkit.callCNV { } { normals = [ bams.normal ]; tumours = [ bams.tumour ]; }; -in linkOutputs { +in +linkOutputs { inherit variants; alignments = linkOutputs (mapAttrs' (n: nameValuePair (n + ".bam")) bams); cnvkit = cnvs; |