diff --git a/docs/output.md b/docs/output.md index 8974a1e..9251e4e 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/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 diff --git a/modules/nf-core/ascat/ascat.diff b/modules/nf-core/ascat/ascat.diff index 7f93901..a022286 100644 --- a/modules/nf-core/ascat/ascat.diff +++ b/modules/nf-core/ascat/ascat.diff @@ -1,6 +1,4 @@ -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 @@ @@ -98,7 +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 ?: 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" : "" @@ -112,7 +110,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 +316,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) @@ -342,7 +343,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) { @@ -360,7 +361,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 +192,48 @@ } ) colnames(summary) <- c("AberrantCellFraction","Ploidy") @@ -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 @@ -437,13 +439,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() } + ************************************************************ diff --git a/modules/nf-core/ascat/main.nf b/modules/nf-core/ascat/main.nf index fb34f18..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" : "" @@ -173,7 +172,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 +220,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() }