From f461b1718bafd72667412b15539308a6682e6e15 Mon Sep 17 00:00:00 2001 From: Francesco L Date: Sat, 13 Jan 2024 14:52:43 +0100 Subject: [PATCH 1/5] added cnvkit_targets param --- nextflow.config | 3 +++ workflows/createpanelrefs.nf | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/nextflow.config b/nextflow.config index 7956a66..75bd145 100644 --- a/nextflow.config +++ b/nextflow.config @@ -28,6 +28,9 @@ params { scatter_content = 5000 segmental_duplications = null + // CNVkit options + cnvkit_targets = null + // MultiQC options multiqc_config = null multiqc_title = null diff --git a/workflows/createpanelrefs.nf b/workflows/createpanelrefs.nf index d6cc32e..3e17b9b 100644 --- a/workflows/createpanelrefs.nf +++ b/workflows/createpanelrefs.nf @@ -43,14 +43,16 @@ ch_input = ch_from_samplesheet.map{meta, bam, bai, cram, crai -> } // Initialize file channels based on params, defined in the params.genomes[params.genome] scope -ch_dict = params.dict ? Channel.fromPath(params.dict).map { dict -> [[id:dict.baseName],dict]}.collect() - : Channel.empty() -ch_fai = params.fai ? Channel.fromPath(params.fai).map { fai -> [[id:fai.baseName],fai]}.collect() - : Channel.empty() -ch_fasta = params.fasta ? Channel.fromPath(params.fasta).map { fasta -> [[id:fasta.baseName],fasta]}.collect() - : Channel.empty() -ch_ploidy_priors = params.ploidy_priors ? Channel.fromPath(params.ploidy_priors).collect() - : Channel.empty() +ch_dict = params.dict ? Channel.fromPath(params.dict).map { dict -> [[id:dict.baseName],dict]}.collect() + : Channel.empty() +ch_fai = params.fai ? Channel.fromPath(params.fai).map { fai -> [[id:fai.baseName],fai]}.collect() + : Channel.empty() +ch_fasta = params.fasta ? Channel.fromPath(params.fasta).map { fasta -> [[id:fasta.baseName],fasta]}.collect() + : Channel.empty() +ch_ploidy_priors = params.ploidy_priors ? Channel.fromPath(params.ploidy_priors).collect() + : Channel.empty() +ch_cnvkit_targets = params.cnvkit_targets ? Channel.fromPath(params.cnvkit_targets).map { targets -> [[id:targets.baseName],targets]}.collect() + : Channel.empty() /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -117,7 +119,7 @@ workflow CREATEPANELREFS { .map {meta, bam -> [ meta, [], bam ]} .set { ch_cnvkit_input } - CNVKIT_BATCH ( ch_cnvkit_input, ch_fasta, [[:],[]], [[:],[]], [[:],[]], true ) + CNVKIT_BATCH ( ch_cnvkit_input, ch_fasta, [[:],[]], ch_cnvkit_targets, [[:],[]], true ) ch_versions = ch_versions.mix(CNVKIT_BATCH.out.versions) } From de819a6651210bac0882d13bcc161014730d9bd3 Mon Sep 17 00:00:00 2001 From: Francesco L Date: Sat, 13 Jan 2024 14:58:11 +0100 Subject: [PATCH 2/5] updated schema --- nextflow_schema.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nextflow_schema.json b/nextflow_schema.json index 1e05670..dafa1b2 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -66,6 +66,17 @@ } } }, + "cnvkit_options": { + "title": "CNVkit options", + "type": "object", + "description": "Options used by the cnvkit subworkflow", + "default": "", + "properties": { + "cnvkit_targets": { + "type": "string" + } + } + }, "input_output_options": { "title": "Input/output options", "type": "object", @@ -384,6 +395,9 @@ { "$ref": "#/definitions/germlinecnvcaller_options" }, + { + "$ref": "#/definitions/cnvkit_options" + }, { "$ref": "#/definitions/input_output_options" }, From d79415d13404ac967e7a39bbff3c9e2fa6af435f Mon Sep 17 00:00:00 2001 From: Francesco L Date: Sun, 14 Jan 2024 08:24:55 +0100 Subject: [PATCH 3/5] instead of empty channel pass dummy tuple --- workflows/createpanelrefs.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/createpanelrefs.nf b/workflows/createpanelrefs.nf index 3e17b9b..5105db9 100644 --- a/workflows/createpanelrefs.nf +++ b/workflows/createpanelrefs.nf @@ -52,7 +52,7 @@ ch_fasta = params.fasta ? Channel.fromPath(params.fasta).map { ch_ploidy_priors = params.ploidy_priors ? Channel.fromPath(params.ploidy_priors).collect() : Channel.empty() ch_cnvkit_targets = params.cnvkit_targets ? Channel.fromPath(params.cnvkit_targets).map { targets -> [[id:targets.baseName],targets]}.collect() - : Channel.empty() + : Channel.value([[:],[]]) /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 8c61d4f2432f830499f0879b523aff100fcc3ad2 Mon Sep 17 00:00:00 2001 From: Francesco L Date: Sun, 14 Jan 2024 09:46:55 +0100 Subject: [PATCH 4/5] added usage doc for cnvkit targets --- docs/usage.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index 1bc6a75..829ae4e 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -114,6 +114,27 @@ If you are running the pipeline to generate references for the GATK's germlinecn 1 To learn more about this file, see [this comment](https://gatk.broadinstitute.org/hc/en-us/community/posts/360074399831/comments/13441240230299) on GATK forum.
+ +### cnvkit + +If you are running the pipeline to generate references for the CNVkit variant calling workflow, you should consider that currently the default method for this pipeline is whole-genome. In order to use the CNVkit default, i.e. hybrid capture, when the user is creating a background for targeted capture sequencing (most commonly, exomes or panels), the user should + +1. provide an additional config file, in order to change or remove the method specified in the default `ext.args`, i.e. + +``` +process { + + withName: CNVKIT_BATCH { + ext.args = {"--output-reference ${meta.id}.cnn"} + } + +} +``` + +2. provide the `--cnvkit_target` parameter (optional) as a .bed file for the targets + + + ## Core Nextflow arguments > **NB:** These options are part of Nextflow and use a _single_ hyphen (pipeline parameters use a double-hyphen). From 95f2dafdcc0517cf3e1c4febe9132cce5293d252 Mon Sep 17 00:00:00 2001 From: Francesco L Date: Mon, 15 Jan 2024 14:00:13 +0100 Subject: [PATCH 5/5] prettier fixed --- docs/usage.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 829ae4e..91ff464 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -114,7 +114,6 @@ If you are running the pipeline to generate references for the GATK's germlinecn 1 To learn more about this file, see [this comment](https://gatk.broadinstitute.org/hc/en-us/community/posts/360074399831/comments/13441240230299) on GATK forum.
- ### cnvkit If you are running the pipeline to generate references for the CNVkit variant calling workflow, you should consider that currently the default method for this pipeline is whole-genome. In order to use the CNVkit default, i.e. hybrid capture, when the user is creating a background for targeted capture sequencing (most commonly, exomes or panels), the user should @@ -133,8 +132,6 @@ process { 2. provide the `--cnvkit_target` parameter (optional) as a .bed file for the targets - - ## Core Nextflow arguments > **NB:** These options are part of Nextflow and use a _single_ hyphen (pipeline parameters use a double-hyphen).