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

Added somatic cnvkit #540

Merged
merged 13 commits into from
Jun 1, 2022
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#536](https://github.com/nf-core/sarek/pull/536) - Add `--step markduplicates` to start from duplicate marking, `--step prepare_recalibration` now ONLY starts at process `BaseRecalibrator` & adding `bam` and `cram` input support for `--step` `markduplicates`, `prepare_recalibration`, `recalibrate`, and `variant_calling`
- [#538](https://github.com/nf-core/sarek/pull/538) - Add param `--seq_platform`, default: `ILLUMINA`
- [#545](https://github.com/nf-core/sarek/pull/545) - Add modules and subworkflows for `cnvkit` tumor_only mode
- [#540](https://github.com/nf-core/sarek/pull/540) - Add modules and subworkflows for `cnvkit` somatic mode

### Changed

Expand Down
56 changes: 32 additions & 24 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,36 @@ process{
]
}

//CNVKIT
withName: 'CNVKIT_ANTITARGET' {
ext.when = { params.tools && params.tools.contains('cnvkit') }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference" },
pattern: "*{bed}"
]
}

withName: 'CNVKIT_REFERENCE' {
ext.prefix = "cnvkit"
ext.when = { params.tools && params.tools.contains('cnvkit') }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference" },
pattern: "*{cnn}"
]
}

withName: 'CNVKIT_BATCH_TUMORONLY' {
ext.args = { params.wes ? "--method hybrid --diagram --scatter" : "--method wgs --diagram --scatter" }
ext.when = { params.tools && params.tools.contains('cnvkit') }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/cnvkit" },
pattern: "*{bed,cnn,cnr,cns,pdf,png}"
]
}

//MANTA
withName: 'CONCAT_MANTA_TUMOR' {
ext.prefix = {"${meta.id}.tumor_sv"}
Expand Down Expand Up @@ -904,28 +934,8 @@ process{
}
}

// CNVKIT_TUMORONLY

withName: 'CNVKIT_ANTITARGET' {
ext.when = { params.tools && params.tools.contains('cnvkit') }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference" },
pattern: "*{bed}"
]
}

withName: 'CNVKIT_REFERENCE' {
ext.prefix = "cnvkit"
ext.when = { params.tools && params.tools.contains('cnvkit') }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference" },
pattern: "*{cnn}"
]
}

withName: 'CNVKIT_BATCH_TUMORONLY' {
//CNVKIT
withName: 'CNVKIT_BATCH_SOMATIC' {
ext.args = { params.wes ? "--method hybrid --diagram --scatter" : "--method wgs --diagram --scatter" }
ext.when = { params.tools && params.tools.contains('cnvkit') }
publishDir = [
Expand All @@ -934,8 +944,6 @@ process{
pattern: "*{bed,cnn,cnr,cns,pdf,png}"
]
FriederikeHanssen marked this conversation as resolved.
Show resolved Hide resolved
}


//FREEBAYES
withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_FREEBAYES_SOMATIC:FREEBAYES' {
ext.args = "--pooled-continuous \
Expand Down
12 changes: 12 additions & 0 deletions subworkflows/local/pair_variant_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include { RUN_CONTROLFREEC_SOMATIC } from '../nf-core/variantca
include { RUN_FREEBAYES as RUN_FREEBAYES_SOMATIC } from '../nf-core/variantcalling/freebayes/main.nf'
include { RUN_MANTA_SOMATIC } from '../nf-core/variantcalling/manta/somatic/main.nf'
include { RUN_STRELKA_SOMATIC } from '../nf-core/variantcalling/strelka/somatic/main.nf'
include { RUN_CNVKIT_SOMATIC } from '../nf-core/variantcalling/cnvkit/somatic/main.nf'

workflow PAIR_VARIANT_CALLING {
take:
Expand Down Expand Up @@ -91,6 +92,17 @@ workflow PAIR_VARIANT_CALLING {
ch_versions = ch_versions.mix(RUN_CONTROLFREEC_SOMATIC.out.versions)
}

if (tools.contains('cnvkit')){
cram_pair_cnvkit = cram_pair
.map{meta, normal_cram, normal_crai, tumor_cram, tumor_crai ->
[meta, tumor_cram, normal_cram]
}
RUN_CNVKIT_SOMATIC( cram_test,
fasta,
intervals_bed_combined,
[])
}

if (tools.contains('freebayes')){
RUN_FREEBAYES_SOMATIC(cram_pair_intervals, fasta, fasta_fai, intervals_bed_combine_gz)

Expand Down
27 changes: 27 additions & 0 deletions subworkflows/nf-core/variantcalling/cnvkit/somatic/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.