From feea69d2a4d07ca832cbf25bd30c1bedea1fff4d Mon Sep 17 00:00:00 2001 From: Amber Verhasselt Date: Fri, 6 Feb 2026 17:20:38 +0100 Subject: [PATCH 1/5] ascat raw segments txt files added to output --- docs/output.md | 2 ++ modules/nf-core/ascat/ascat.diff | 4 +++- modules/nf-core/ascat/main.nf | 3 ++- modules/nf-core/ascat/tests/main.nf.test | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/output.md b/docs/output.md index 8974a1e..9e2070b 100644 --- a/docs/output.md +++ b/docs/output.md @@ -73,6 +73,7 @@ The directories listed below will be created in the results directory after the │ ├── sample.normal_alleleFrequencies_chr(1-22,X).txt │ ├── sample.purityploidy.txt │ ├── sample.segments.txt +│ ├── sample.segments_raw.txt │ ├── sample.tumour_alleleFrequencies_chr(1-22,X).txt │ ├── sample.tumour_normalBAF_rawBAF.txt │ ├── sample.tumour_normalBAF.txt @@ -92,6 +93,7 @@ The directories listed below will be created in the results directory after the | `sample.normal_alleleFrequencies_chr(1-22,X).txt` | a tsv file describing the snp counts for the normal sample at each position and their respective depths | | `sample.purityploidy.txt` | a tsv file describing the purity and ploidy values of the sample | | `sample.segments.txt` | a tsv file describing each chromosome segment and it's major and minor copy number | +| `sample.segments_raw.txt` | a tsv file describing each chromosome segment and it's major and minor rounded and raw copy number | | `sample.tumour_alleleFrequencies_chr(1-22,X).txt` | a tsv file describing the snp counts for the tumor sample at each position and their respective depths | | `sample.tumour_normalBAF_rawBAF.txt` | a tsv file with the raw BAF values in the normal sample | | `sample.tumour_normalBAF.txt` | a tsv file with the BAF values in the normal sample | diff --git a/modules/nf-core/ascat/ascat.diff b/modules/nf-core/ascat/ascat.diff index 7f93901..ced5557 100644 --- a/modules/nf-core/ascat/ascat.diff +++ b/modules/nf-core/ascat/ascat.diff @@ -342,7 +342,7 @@ Changes in 'ascat/main.nf': + tryCatch({ # In case segments_raw is not selected + write.table( + ascat.output[["segments_raw"]], -+ file = paste0(prefix, ".segments_raw.txt"), ++ file = paste0("$prefix", ".segments_raw.txt"), + sep = "\t", quote = FALSE, row.names = FALSE + ) + }, error = function(e) { @@ -400,6 +400,7 @@ Changes in 'ascat/main.nf': - touch ${prefix}.normal_alleleFrequencies_chr22.txt - touch ${prefix}.purityploidy.txt - touch ${prefix}.segments.txt +- touch ${prefix}.segments_raw.txt - touch ${prefix}.tumour.ASPCF.png - touch ${prefix}.tumour.sunrise.png - touch ${prefix}.tumour_alleleFrequencies_chr21.txt @@ -426,6 +427,7 @@ Changes in 'ascat/main.nf': + echo stub > ${prefix}.normal_alleleFrequencies_chr22.txt + echo stub > ${prefix}.purityploidy.txt + echo stub > ${prefix}.segments.txt ++ echo stub > ${prefix}.segments_raw.txt + echo stub > ${prefix}.tumour.ASPCF.png + echo stub > ${prefix}.tumour.sunrise.png + echo stub > ${prefix}.tumour_alleleFrequencies_chr21.txt diff --git a/modules/nf-core/ascat/main.nf b/modules/nf-core/ascat/main.nf index fb34f18..1bbead2 100644 --- a/modules/nf-core/ascat/main.nf +++ b/modules/nf-core/ascat/main.nf @@ -173,7 +173,7 @@ process ASCAT { tryCatch({ # In case segments_raw is not selected write.table( ascat.output[["segments_raw"]], - file = paste0(prefix, ".segments_raw.txt"), + file = paste0("$prefix", ".segments_raw.txt"), sep = "\t", quote = FALSE, row.names = FALSE ) }, error = function(e) { @@ -221,6 +221,7 @@ process ASCAT { echo stub > ${prefix}.normal_alleleFrequencies_chr22.txt echo stub > ${prefix}.purityploidy.txt echo stub > ${prefix}.segments.txt + echo stub > ${prefix}.segments_raw.txt echo stub > ${prefix}.tumour.ASPCF.png echo stub > ${prefix}.tumour.sunrise.png echo stub > ${prefix}.tumour_alleleFrequencies_chr21.txt diff --git a/modules/nf-core/ascat/tests/main.nf.test b/modules/nf-core/ascat/tests/main.nf.test index 527fbc2..759abb3 100644 --- a/modules/nf-core/ascat/tests/main.nf.test +++ b/modules/nf-core/ascat/tests/main.nf.test @@ -55,6 +55,7 @@ nextflow_process { process.out.png.collect{it[1].collect{file(it).name}}, process.out.purityploidy, process.out.segments, + process.out.segments_raw, process.out.versions, path(process.out.versions[0]).yaml ).match() } @@ -109,6 +110,7 @@ nextflow_process { process.out.png.collect{it[1].collect{file(it).name}}, process.out.purityploidy, process.out.segments, + process.out.segments_raw, process.out.versions, path(process.out.versions[0]).yaml ).match() } @@ -163,6 +165,7 @@ nextflow_process { process.out.png.collect{it[1].collect{file(it).name}}, process.out.purityploidy, process.out.segments, + process.out.segments_raw, process.out.versions, path(process.out.versions[0]).yaml ).match() } @@ -218,6 +221,7 @@ nextflow_process { process.out.png.collect{it[1].collect{file(it).name}}, process.out.purityploidy, process.out.segments, + process.out.segments_raw, process.out.versions, path(process.out.versions[0]).yaml ).match() } @@ -296,6 +300,7 @@ nextflow_process { process.out.png.collect{it[1].collect{file(it).name}}, process.out.purityploidy, process.out.segments, + process.out.segments_raw, process.out.versions, path(process.out.versions[0]).yaml ).match() } From 87debc2c1b67dd8e81f649ccff02edfea640ab80 Mon Sep 17 00:00:00 2001 From: Amber Verhasselt Date: Fri, 6 Feb 2026 17:37:13 +0100 Subject: [PATCH 2/5] prettier --- docs/output.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/output.md b/docs/output.md index 9e2070b..9251e4e 100644 --- a/docs/output.md +++ b/docs/output.md @@ -93,7 +93,7 @@ The directories listed below will be created in the results directory after the | `sample.normal_alleleFrequencies_chr(1-22,X).txt` | a tsv file describing the snp counts for the normal sample at each position and their respective depths | | `sample.purityploidy.txt` | a tsv file describing the purity and ploidy values of the sample | | `sample.segments.txt` | a tsv file describing each chromosome segment and it's major and minor copy number | -| `sample.segments_raw.txt` | a tsv file describing each chromosome segment and it's major and minor rounded and raw copy number | +| `sample.segments_raw.txt` | a tsv file describing each chromosome segment and it's major and minor rounded and raw copy number | | `sample.tumour_alleleFrequencies_chr(1-22,X).txt` | a tsv file describing the snp counts for the tumor sample at each position and their respective depths | | `sample.tumour_normalBAF_rawBAF.txt` | a tsv file with the raw BAF values in the normal sample | | `sample.tumour_normalBAF.txt` | a tsv file with the BAF values in the normal sample | From c34899f6fd2c409e004d9a226364a78953b240d3 Mon Sep 17 00:00:00 2001 From: Amber Verhasselt Date: Fri, 6 Feb 2026 18:39:37 +0100 Subject: [PATCH 3/5] diff file restore --- modules/nf-core/ascat/ascat.diff | 76 ++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/modules/nf-core/ascat/ascat.diff b/modules/nf-core/ascat/ascat.diff index ced5557..e6f7125 100644 --- a/modules/nf-core/ascat/ascat.diff +++ b/modules/nf-core/ascat/ascat.diff @@ -1,9 +1,7 @@ -Changes in component 'nf-core/ascat' -'modules/nf-core/ascat/meta.yml' is unchanged -Changes in 'ascat/main.nf': +Changes in module 'nf-core/ascat' --- modules/nf-core/ascat/main.nf +++ modules/nf-core/ascat/main.nf -@@ -1,211 +1,189 @@ +@@ -1,211 +1,190 @@ process ASCAT { - tag "${meta.id}" + tag "$meta.id" @@ -98,6 +96,7 @@ Changes in 'ascat/main.nf': + def penalty = args.penalty ? "$args.penalty" : "NULL" + def gc_input = gc_file ? "$gc_file" : "NULL" + def rt_input = rt_file ? "$rt_file" : "NULL" ++ def pdf_plots = args.pdf_plots ? ("$args.pdf_plots" == true ? "TRUE": "FALSE") : "NULL" + + def minCounts_arg = args.minCounts ? ",minCounts = $args.minCounts" : "" + def bed_file_arg = bed_file ? ",BED_file = '$bed_file'": "" @@ -112,7 +111,7 @@ Changes in 'ascat/main.nf': + def normal_bam = input_normal ? ",normalseqfile = '$input_normal'" : "" + def normal_name = input_normal ? ",normalname = '${prefix}.normal'" : "" + def longread_bins = args.longread_bins ? ",loci_binsize = $args.longread_bins" : "" -+ def allele_counter_flags = args.allele_counter_flags ? ",additional_allelecounter_flags = '$args.allele_counter_flags'" : "" ++ def allele_counter_flags = args.allele_counter_flags ? ",additional_allelecounter_flags = '$args.allele_counter_flags'" : "" """ #!/usr/bin/env Rscript library(RColorBrewer) @@ -318,16 +317,19 @@ Changes in 'ascat/main.nf': + #Run ASCAT to fit every tumor to a model, inferring ploidy, normal cell contamination, and discrete copy numbers + #If psi and rho are manually set: + if (!is.null($purity) && !is.null($ploidy)){ -+ ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=$purity, psi_manual=$ploidy) ++ ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=$purity, psi_manual=$ploidy, pdfPlot = $pdf_plots) + } else if(!is.null($purity) && is.null($ploidy)){ -+ ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=$purity) ++ ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=$purity, pdfPlot = $pdf_plots) + } else if(!is.null($ploidy) && is.null($purity)){ -+ ascat.output <- ascat.runAscat(ascat.bc, gamma=1, psi_manual=$ploidy) ++ ascat.output <- ascat.runAscat(ascat.bc, gamma=1, psi_manual=$ploidy, pdfPlot = $pdf_plots) } else { - ascat.output <- ascat.runAscat(ascat.bc, gamma=1) - } - +- ascat.output <- ascat.runAscat(ascat.bc, gamma=1) +- } +- - # Extract metrics from ASCAT profiles ++ ascat.output <- ascat.runAscat(ascat.bc, gamma=1, pdfPlot = $pdf_plots) ++ } ++ + #Extract metrics from ASCAT profiles QC = ascat.metrics(ascat.bc,ascat.output) @@ -360,7 +362,7 @@ Changes in 'ascat/main.nf': summary <- tryCatch({ matrix(c(ascat.output[["aberrantcellfraction"]], ascat.output[["ploidy"]]), ncol=2, byrow=TRUE)}, error = function(err) { # error handler picks up where error was generated -@@ -214,46 +192,47 @@ +@@ -214,46 +193,48 @@ } ) colnames(summary) <- c("AberrantCellFraction","Ploidy") @@ -400,7 +402,6 @@ Changes in 'ascat/main.nf': - touch ${prefix}.normal_alleleFrequencies_chr22.txt - touch ${prefix}.purityploidy.txt - touch ${prefix}.segments.txt -- touch ${prefix}.segments_raw.txt - touch ${prefix}.tumour.ASPCF.png - touch ${prefix}.tumour.sunrise.png - touch ${prefix}.tumour_alleleFrequencies_chr21.txt @@ -439,13 +440,52 @@ Changes in 'ascat/main.nf': + + echo "${task.process}:" > versions.yml + echo ' alleleCounter: 4.3.0' >> versions.yml -+ echo ' ascat: 3.0.0' >> versions.yml ++ echo ' ascat: 3.2.0' >> versions.yml + + """ + +} -'modules/nf-core/ascat/environment.yml' is unchanged -'modules/nf-core/ascat/tests/main.nf.test' is unchanged -'modules/nf-core/ascat/tests/main.nf.test.snap' is unchanged -'modules/nf-core/ascat/tests/nextflow.config' is unchanged +--- modules/nf-core/ascat/tests/main.nf.test ++++ modules/nf-core/ascat/tests/main.nf.test +@@ -55,6 +55,7 @@ + process.out.png.collect{it[1].collect{file(it).name}}, + process.out.purityploidy, + process.out.segments, ++ process.out.segments_raw, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } +@@ -109,6 +110,7 @@ + process.out.png.collect{it[1].collect{file(it).name}}, + process.out.purityploidy, + process.out.segments, ++ process.out.segments_raw, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } +@@ -163,6 +165,7 @@ + process.out.png.collect{it[1].collect{file(it).name}}, + process.out.purityploidy, + process.out.segments, ++ process.out.segments_raw, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } +@@ -218,6 +221,7 @@ + process.out.png.collect{it[1].collect{file(it).name}}, + process.out.purityploidy, + process.out.segments, ++ process.out.segments_raw, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } +@@ -296,6 +300,7 @@ + process.out.png.collect{it[1].collect{file(it).name}}, + process.out.purityploidy, + process.out.segments, ++ process.out.segments_raw, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } + ************************************************************ From db09cadb31abb669453116c0b5d6f0b5ac1dadd6 Mon Sep 17 00:00:00 2001 From: Amber Verhasselt Date: Fri, 6 Feb 2026 19:05:27 +0100 Subject: [PATCH 4/5] fixed pdf plots arg --- modules/nf-core/ascat/ascat.diff | 7 +++---- modules/nf-core/ascat/main.nf | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/ascat/ascat.diff b/modules/nf-core/ascat/ascat.diff index e6f7125..a022286 100644 --- a/modules/nf-core/ascat/ascat.diff +++ b/modules/nf-core/ascat/ascat.diff @@ -1,7 +1,7 @@ Changes in module 'nf-core/ascat' --- modules/nf-core/ascat/main.nf +++ modules/nf-core/ascat/main.nf -@@ -1,211 +1,190 @@ +@@ -1,211 +1,189 @@ process ASCAT { - tag "${meta.id}" + tag "$meta.id" @@ -96,8 +96,7 @@ Changes in module 'nf-core/ascat' + def penalty = args.penalty ? "$args.penalty" : "NULL" + def gc_input = gc_file ? "$gc_file" : "NULL" + def rt_input = rt_file ? "$rt_file" : "NULL" -+ def pdf_plots = args.pdf_plots ? ("$args.pdf_plots" == true ? "TRUE": "FALSE") : "NULL" -+ ++ def pdf_plots = (args.pdf_plots ?: false) ? "TRUE" : "FALSE" + def minCounts_arg = args.minCounts ? ",minCounts = $args.minCounts" : "" + def bed_file_arg = bed_file ? ",BED_file = '$bed_file'": "" + def chrom_names_arg = args.chrom_names ? ",chrom_names = $args.chrom_names" : "" @@ -362,7 +361,7 @@ Changes in module 'nf-core/ascat' summary <- tryCatch({ matrix(c(ascat.output[["aberrantcellfraction"]], ascat.output[["ploidy"]]), ncol=2, byrow=TRUE)}, error = function(err) { # error handler picks up where error was generated -@@ -214,46 +193,48 @@ +@@ -214,46 +192,48 @@ } ) colnames(summary) <- c("AberrantCellFraction","Ploidy") diff --git a/modules/nf-core/ascat/main.nf b/modules/nf-core/ascat/main.nf index 1bbead2..01641e1 100644 --- a/modules/nf-core/ascat/main.nf +++ b/modules/nf-core/ascat/main.nf @@ -42,8 +42,7 @@ process ASCAT { def penalty = args.penalty ? "$args.penalty" : "NULL" def gc_input = gc_file ? "$gc_file" : "NULL" def rt_input = rt_file ? "$rt_file" : "NULL" - def pdf_plots = args.pdf_plots ? ("$args.pdf_plots" == true ? "TRUE": "FALSE") : "NULL" - + def pdf_plots = (args.pdf_plots ?: false) ? "TRUE" : "FALSE" def minCounts_arg = args.minCounts ? ",minCounts = $args.minCounts" : "" def bed_file_arg = bed_file ? ",BED_file = '$bed_file'": "" def chrom_names_arg = args.chrom_names ? ",chrom_names = $args.chrom_names" : "" From 6dad5017f6c81a9db37bf7ae0afac982f6cbcf85 Mon Sep 17 00:00:00 2001 From: Amber Verhasselt Date: Mon, 9 Feb 2026 11:20:03 +0100 Subject: [PATCH 5/5] added pdf plots ascat to usage --- docs/usage.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/usage.md b/docs/usage.md index dc14d04..448cf7d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -153,6 +153,7 @@ You can also generate such `YAML`/`JSON` files via [nf-core/launch](https://nf-c | `--ascat_loci_files` | A full path to a zipped folder containing loci files for [ASCAT](https://github.com/VanLoo-lab/ascat/tree/master/ReferenceFiles/WGS). Must be zipped and have `.zip` format. Default = `null` | | `--ascat_gc_file` | A full path to a GC correction file for [ASCAT](https://github.com/VanLoo-lab/ascat/tree/master/ReferenceFiles/WGS). Optionally can be zipped and have either `.txt` or `.txt.zip` format. Default = `null` | | `--ascat_rt_file` | A full path to a replication timing correction file for [ASCAT](https://github.com/VanLoo-lab/ascat/tree/master/ReferenceFiles/WGS). Optionally can be zipped and have either `.txt` or `.txt.zip` format. Default = `null` | +| `--ascat_pdf_plots` | string to enable output pltos in pdf format. Default = `false` | ### Updating the pipeline