From 6fd00e1554fbebf1706a82cf7d4f4de8ccaf9b66 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 10 Nov 2022 19:15:39 +0100 Subject: [PATCH 1/3] expose cnvkit reference as parameter --- nextflow.config | 1 + nextflow_schema.json | 34 +++++++++++++++++++++++++++++----- workflows/sarek.nf | 4 +++- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/nextflow.config b/nextflow.config index dd886f8262..bf074101ca 100644 --- a/nextflow.config +++ b/nextflow.config @@ -63,6 +63,7 @@ params { cf_minqual = 0 // ControlFreec default values cf_window = null // by default we are not using this in Control-FREEC cf_chrom_len = null // by default we are using the fasta_fai. This can be used to circumvent this issue until there is a better option available upstream: https://github.com/nf-core/sarek/issues/670 + cnvkit_reference = null // by default the reference is build from the fasta file ignore_soft_clipped_bases = false // no --dont-use-soft-clipped-bases for GATK Mutect2 wes = false // Set to true, if data is exome/targeted sequencing data. Used to use correct models in various variant callers joint_germline = false // g.vcf & joint germline calling are not run by default if HaplotypeCaller is selected diff --git a/nextflow_schema.json b/nextflow_schema.json index bd50522344..6ce7f24c07 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,7 +10,10 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": ["step", "outdir"], + "required": [ + "step", + "outdir" + ], "properties": { "step": { "type": "string", @@ -194,7 +197,11 @@ "type": "string", "default": "bwa-mem", "fa_icon": "fas fa-puzzle-piece", - "enum": ["bwa-mem", "bwa-mem2", "dragmap"], + "enum": [ + "bwa-mem", + "bwa-mem2", + "dragmap" + ], "description": "Specify aligner to be used to map reads to reference genome.", "help_text": "`Sarek` will build missing indices automatically if not provided. Set `--bwa false` if indices should be (re-)built.\nIf `DragMap` is selected as aligner, it is recommended to skip baserecalibration with `--skip_tools baserecalibrator`. See [here](https://gatk.broadinstitute.org/hc/en-us/articles/4407897446939--How-to-Run-germline-single-sample-short-variant-discovery-in-DRAGEN-mode) for more info.\n", "hidden": true @@ -278,7 +285,7 @@ }, "cf_chrom_len": { "type": "string", - "default": null, + "default": "None", "fa_icon": "fas fa-ruler-horizontal", "description": "Specify a custom chromosome length file.", "help_text": "Control-FREEC requires a file containing all chromosome lenghts. By default the fasta.fai is used. If the fasta.fai file contains chromosomes not present in the intervals, it fails (see: https://github.com/BoevaLab/FREEC/issues/106).\n\nIn this case, a custom chromosome length can be specified. It must be of the same format as the fai, but only contain the relevant chromosomes.\n\n\n\n", @@ -338,6 +345,12 @@ "help_text": "Details, see [ControlFREEC manual](http://boevalab.inf.ethz.ch/FREEC/tutorial.html).", "hidden": true }, + "cnvkit_reference": { + "type": "string", + "default": null, + "fa_icon": "fas fa-file", + "help_text": "https://cnvkit.readthedocs.io/en/stable/pipeline.html?highlight=reference.cnn#batch" + }, "pon": { "type": "string", "fa_icon": "fas fa-file", @@ -478,7 +491,11 @@ "type": "string", "default": "vcf", "description": "VEP output-file format.", - "enum": ["json", "tab", "vcf"], + "enum": [ + "json", + "tab", + "vcf" + ], "help_text": "Sets the format of the output-file from VEP. Available formats: json, tab and vcf.", "fa_icon": "fas fa-table", "hidden": true @@ -845,7 +862,14 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], + "enum": [ + "symlink", + "rellink", + "link", + "copy", + "copyNoFollow", + "move" + ], "hidden": true }, "email": { diff --git a/workflows/sarek.nf b/workflows/sarek.nf index ca91a47231..682f4aaf91 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek.nf @@ -18,6 +18,7 @@ def checkPathParamList = [ params.bwa, params.bwamem2, params.cf_chrom_len, + params.cnvkit_reference, params.chr_dir, params.dbnsfp, params.dbnsfp_tbi, @@ -372,7 +373,8 @@ workflow SAREK { // Antitarget based reference for CNVKit PREPARE_REFERENCE_CNVKIT(fasta, intervals_bed_combined) - cnvkit_reference = params.tools && params.tools.split(',').contains('cnvkit') ? PREPARE_REFERENCE_CNVKIT.out.cnvkit_reference : Channel.empty() + cnvkit_reference = params.tools && params.tools.split(',').contains('cnvkit') ? (params.cnvkit_reference ? Channel.fromPath(params.cnvkit_reference).collect() : PREPARE_REFERENCE_CNVKIT.out.cnvkit_reference) : Channel.empty() + ch_versions = ch_versions.mix(PREPARE_REFERENCE_CNVKIT.out.versions) // PREPROCESSING From bfaa9827bbf64d961f8835325b2f9b1046dd5034 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 10 Nov 2022 19:32:32 +0100 Subject: [PATCH 2/3] don't compute reference if provided --- conf/modules/cnvkit.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/modules/cnvkit.config b/conf/modules/cnvkit.config index 93b06518b5..f77c6ef446 100644 --- a/conf/modules/cnvkit.config +++ b/conf/modules/cnvkit.config @@ -28,7 +28,7 @@ process { withName: 'CNVKIT_REFERENCE' { ext.prefix = "cnvkit" - ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + ext.when = { params.tools && params.tools.split(',').contains('cnvkit') && !params.cnvkit_reference } publishDir = [ enabled: params.save_reference, mode: params.publish_dir_mode, From 58bc75c51a404a1dfaae4476bc108694979a1d1f Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Thu, 10 Nov 2022 19:48:39 +0000 Subject: [PATCH 3/3] [automated] Fix linting with Prettier --- nextflow_schema.json | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 6ce7f24c07..64c319f511 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,10 +10,7 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": [ - "step", - "outdir" - ], + "required": ["step", "outdir"], "properties": { "step": { "type": "string", @@ -197,11 +194,7 @@ "type": "string", "default": "bwa-mem", "fa_icon": "fas fa-puzzle-piece", - "enum": [ - "bwa-mem", - "bwa-mem2", - "dragmap" - ], + "enum": ["bwa-mem", "bwa-mem2", "dragmap"], "description": "Specify aligner to be used to map reads to reference genome.", "help_text": "`Sarek` will build missing indices automatically if not provided. Set `--bwa false` if indices should be (re-)built.\nIf `DragMap` is selected as aligner, it is recommended to skip baserecalibration with `--skip_tools baserecalibrator`. See [here](https://gatk.broadinstitute.org/hc/en-us/articles/4407897446939--How-to-Run-germline-single-sample-short-variant-discovery-in-DRAGEN-mode) for more info.\n", "hidden": true @@ -491,11 +484,7 @@ "type": "string", "default": "vcf", "description": "VEP output-file format.", - "enum": [ - "json", - "tab", - "vcf" - ], + "enum": ["json", "tab", "vcf"], "help_text": "Sets the format of the output-file from VEP. Available formats: json, tab and vcf.", "fa_icon": "fas fa-table", "hidden": true @@ -862,14 +851,7 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": [ - "symlink", - "rellink", - "link", - "copy", - "copyNoFollow", - "move" - ], + "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], "hidden": true }, "email": {