Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional targets argument to CNVkit #13

Merged
merged 5 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,24 @@ If you are running the pipeline to generate references for the GATK's germlinecn

<sup>1</sup> To learn more about this file, see [this comment](https://gatk.broadinstitute.org/hc/en-us/community/posts/360074399831/comments/13441240230299) on GATK forum.<br />

### 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).
Expand Down
3 changes: 3 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ params {
scatter_content = 5000
segmental_duplications = null

// CNVkit options
cnvkit_targets = null

// MultiQC options
multiqc_config = null
multiqc_title = null
Expand Down
14 changes: 14 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -384,6 +395,9 @@
{
"$ref": "#/definitions/germlinecnvcaller_options"
},
{
"$ref": "#/definitions/cnvkit_options"
},
{
"$ref": "#/definitions/input_output_options"
},
Expand Down
20 changes: 11 additions & 9 deletions workflows/createpanelrefs.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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.value([[:],[]])

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -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)
}

Expand Down
Loading