Skip to content

Commit

Permalink
Merge pull request #13 from lescai/hybridcapture
Browse files Browse the repository at this point in the history
Add optional targets argument to CNVkit. 
note: nf-core lint fails due to template mismatches with current dev.
  • Loading branch information
lescai authored Jan 15, 2024
2 parents 315c0fb + 95f2daf commit add0a30
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
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

0 comments on commit add0a30

Please sign in to comment.