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

Enable multiple ploidy values for controlfreec #980

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#941](https://github.com/nf-core/sarek/pull/941) - Fix json validation for `tools`, `skip_tools` and `use_gatk_spark` [#892](https://github.com/nf-core/sarek/issues/892)
- [#954](https://github.com/nf-core/sarek/pull/954) - Fix missing annotation keys with `snpeff` and `ensemblvep` for `hg19`
- [#957](https://github.com/nf-core/sarek/pull/957) - Add `failOnDuplicate` and `failOnMismatch` options to all `join()` operator where it was possible
- [#980](https://github.com/nf-core/sarek/pull/941) - Fix allowing multiple ploidy values for plotting of controlfreec output ([#808](https://github.com/nf-core/sarek/issues/808))
- [#982](https://github.com/nf-core/sarek/pull/982) - Remove usage of exit statements, using `Nextflow.error` instead
- [#985](https://github.com/nf-core/sarek/pull/985) - Cache correctly identifies when it needs to be updated
- [#988](https://github.com/nf-core/sarek/pull/988) - Updated ascat module to fix seed for reproducibility
Expand Down
1 change: 0 additions & 1 deletion conf/modules/controlfreec.config
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ process {
}

withName: 'MAKEGRAPH' {
ext.args = { "${params.cf_ploidy}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/controlfreec/${meta.id}/" },
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/controlfreec/makegraph/main.nf

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

Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL {
mpileup_pair = mpileup_normal.cross(mpileup_tumor).map{ normal, tumor -> [ normal[0], normal[1], tumor[1], [], [], [], [] ] }

length_file = cf_chrom_len ?: fasta_fai
ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',')
FriederikeHanssen marked this conversation as resolved.
Show resolved Hide resolved

BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC(
mpileup_pair,
Expand All @@ -101,7 +102,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL {
dbsnp_tbi,
chr_files,
mappability,
intervals_bed_combined
intervals_bed_combined,
ploidy
)

versions = versions.mix(MPILEUP_NORMAL.out.versions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC {
chr_files // channel: [mandatory]
mappability // channel: [mandatory]
intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS
ploidy // channel: [mandatory] list of ploidy values

main:

Expand All @@ -24,7 +25,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC {
ASSESS_SIGNIFICANCE(FREEC_SOMATIC.out.CNV.join(FREEC_SOMATIC.out.ratio, failOnDuplicate: true, failOnMismatch: true))
FREEC2BED(FREEC_SOMATIC.out.ratio)
FREEC2CIRCOS(FREEC_SOMATIC.out.ratio)
MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true))
MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true).combine(ploidy))

ch_versions = ch_versions.mix(FREEC_SOMATIC.out.versions)
ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL {
// CONTROLFREEC (depends on MPILEUP)
if (tools.split(',').contains('controlfreec')) {
length_file = cf_chrom_len ?: fasta_fai
ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',')
FriederikeHanssen marked this conversation as resolved.
Show resolved Hide resolved

BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC(
// Remap channel to match module/subworkflow
Expand All @@ -70,7 +71,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL {
dbsnp_tbi,
chr_files,
mappability,
intervals_bed_combined
intervals_bed_combined,
ploidy
)

versions = versions.mix(BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC.out.versions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC {
chr_files // channel: [mandatory]
mappability // channel: [mandatory]
intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS
ploidy // channel: [mandatory] list of ploidy values

main:

Expand All @@ -24,7 +25,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC {
ASSESS_SIGNIFICANCE(FREEC_TUMORONLY.out.CNV.join(FREEC_TUMORONLY.out.ratio, failOnDuplicate: true, failOnMismatch: true))
FREEC2BED(FREEC_TUMORONLY.out.ratio)
FREEC2CIRCOS(FREEC_TUMORONLY.out.ratio)
MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true))
MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true).combine(ploidy))

ch_versions = ch_versions.mix(FREEC_TUMORONLY.out.versions)
ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions)
Expand Down