diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..16284795 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +name: Nextflow Lint and Auto-fix + +on: + pull_request: + push: + branches: + - main + +jobs: + lint: + name: Run Nextflow lint and commit fixes + runs-on: ubuntu-latest + + steps: + # Checkout the repo, full history needed to push + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.head_ref || github.ref_name }} + + # Setup Nextflow + - name: Setup Nextflow + uses: nf-core/setup-nextflow@v2.0.0 + with: + version: latest-stable + + # Run Nextflow lint + - name: Run Nextflow lint + run: nextflow lint -format -harshil-alignment * + + # Commit and push changes if any + - name: Commit and push lint auto-fixes + run: | + if [[ -n "$(git status --porcelain)" ]]; then + echo "Lint made changes, committing..." + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add -A + git commit -m "chore: apply Nextflow lint auto-fixes" + git push origin HEAD + else + echo "No changes to commit" + fi diff --git a/conf/base.config b/conf/base.config index 85a1eb19..fc7920d7 100644 --- a/conf/base.config +++ b/conf/base.config @@ -10,23 +10,23 @@ process { - resourceLimits = [ cpus: params.max_cpus, memory: params.max_memory, time: params.max_time ] + resourceLimits = [cpus: params.max_cpus, memory: params.max_memory, time: params.max_time] // TODO nf-core: Check the defaults for all processes - cpus = { 1 } - memory = { 6.GB * task.attempt } - time = { 15.min * task.attempt } + cpus = { 1 } + memory = { 6.GB * task.attempt } + time = { 15.min * task.attempt } - errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } - maxRetries = 3 - maxErrors = '-1' + errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } + maxRetries = 3 + maxErrors = '-1' - withLabel:error_ignore { + withLabel: error_ignore { errorStrategy = 'ignore' } - withLabel:error_retry { + withLabel: error_retry { errorStrategy = 'retry' maxRetries = 2 } @@ -37,85 +37,84 @@ process { // These labels are used and recognised by default in DSL2 files hosted on nf-core/modules. // If possible, it would be nice to keep the same label naming convention when // adding in your local modules too. - withLabel:process_single { - cpus = { 1 } + withLabel: process_single { + cpus = { 1 } } - withLabel:process_low { - cpus = { 2 * task.attempt } - memory = { 12.GB * task.attempt } + withLabel: process_low { + cpus = { 2 * task.attempt } + memory = { 12.GB * task.attempt } } - withLabel:process_medium { - cpus = { 6 * task.attempt } - memory = { 36.GB * task.attempt } + withLabel: process_medium { + cpus = { 6 * task.attempt } + memory = { 36.GB * task.attempt } } - withLabel:process_high { - cpus = { 12 * task.attempt } - memory = { 72.GB * task.attempt } - time = { 16.h * task.attempt } + withLabel: process_high { + cpus = { 12 * task.attempt } + memory = { 72.GB * task.attempt } + time = { 16.h * task.attempt } } - withLabel:process_low_memory { - memory = { 4.GB * task.attempt } + withLabel: process_low_memory { + memory = { 4.GB * task.attempt } } - withLabel:memory_medium { - memory = { 8.GB * task.attempt } + withLabel: memory_medium { + memory = { 8.GB * task.attempt } } - withLabel:process_medium_high_memory { - memory = { 36.GB * task.attempt } + withLabel: process_medium_high_memory { + memory = { 36.GB * task.attempt } } - withLabel:process_high_memory { - memory = { 200.GB * task.attempt } + withLabel: process_high_memory { + memory = { 200.GB * task.attempt } } - withLabel:time_minimal { - time = { 15.m * task.attempt } + withLabel: time_minimal { + time = { 15.m * task.attempt } } - withLabel:time_low { - time = { 4.h * task.attempt } + withLabel: time_low { + time = { 4.h * task.attempt } } - withLabel:time_medium { - time = { 8.h * task.attempt } + withLabel: time_medium { + time = { 8.h * task.attempt } } - withLabel:process_long { - time = { 20.h * task.attempt } + withLabel: process_long { + time = { 20.h * task.attempt } } - withLabel:cpu_single_fixed { - cpus = { 1 } + withLabel: cpu_single_fixed { + cpus = { 1 } } - withLabel:cpu_single { - cpus = { 1 * task.attempt } + withLabel: cpu_single { + cpus = { 1 * task.attempt } } - withLabel:process_low_fixed_cpus { - cpus = { 2 } + withLabel: process_low_fixed_cpus { + cpus = { 2 } } - withLabel:cpu_low { - cpus = { 2 * task.attempt } + withLabel: cpu_low { + cpus = { 2 * task.attempt } } - withLabel:cpu_lowmed { - cpus = { 4 * task.attempt } + withLabel: cpu_lowmed { + cpus = { 4 * task.attempt } } - withLabel:cpu_medium { - cpus = { 8 * task.attempt } + withLabel: cpu_medium { + cpus = { 8 * task.attempt } } - withLabel:cpu_medium_high { - cpus = { 12 } + withLabel: cpu_medium_high { + cpus = { 12 } } - withLabel:cpu_high { - cpus = { 30 * task.attempt } + withLabel: cpu_high { + cpus = { 30 * task.attempt } } - withLabel:cpu_veryhigh { - cpus = { 50 * task.attempt } + withLabel: cpu_veryhigh { + cpus = { 50 * task.attempt } } - withName:CUSTOM_DUMPSOFTWAREVERSIONS { + withName: CUSTOM_DUMPSOFTWAREVERSIONS { cache = false } - } diff --git a/conf/general_files_BBG.config b/conf/general_files_BBG.config index 6f8ce1d8..327b1a44 100644 --- a/conf/general_files_BBG.config +++ b/conf/general_files_BBG.config @@ -1,30 +1,28 @@ // This configuration file is used to define the general parameters for the pipeline when ran in BBGCluster params { - vep_cache = "/workspace/datasets/vep" + vep_cache = "/workspace/datasets/vep" // Fasta references - fasta = '/workspace/datasets/genomes/GRCh38/clean_n_fixed_genome/GCA_000001405.15_GRCh38_no_alt_analysis_set.masked.fna' + fasta = '/workspace/datasets/genomes/GRCh38/clean_n_fixed_genome/GCA_000001405.15_GRCh38_no_alt_analysis_set.masked.fna' - wgs_trinuc_counts = "assets/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" + wgs_trinuc_counts = "assets/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" - cosmic_ref_signatures = "/workspace/datasets/transfer/ferriol_deepcsa/COSMIC_v3.4_SBS_GRCh38.txt" - wgs_trinuc_counts = "/workspace/datasets/transfer/ferriol_deepcsa/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" - cadd_scores = "/workspace/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz" - cadd_scores_ind = "/workspace/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz.tbi" + cosmic_ref_signatures = "/workspace/datasets/transfer/ferriol_deepcsa/COSMIC_v3.4_SBS_GRCh38.txt" + wgs_trinuc_counts = "/workspace/datasets/transfer/ferriol_deepcsa/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" + cadd_scores = "/workspace/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz" + cadd_scores_ind = "/workspace/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz.tbi" - dnds_ref_transcripts = "/workspace/projects/prominent/analysis/dNdScv/data/reference_files/RefCDS_human_latest_intogen.rda" - dnds_covariates = "/workspace/projects/prominent/analysis/dNdScv/data/reference_files/covariates_hg19_hg38_epigenome_pcawg.rda" + dnds_ref_transcripts = "/workspace/projects/prominent/analysis/dNdScv/data/reference_files/RefCDS_human_latest_intogen.rda" + dnds_covariates = "/workspace/projects/prominent/analysis/dNdScv/data/reference_files/covariates_hg19_hg38_epigenome_pcawg.rda" // oncodrive3d - datasets3d = "/workspace/nobackup/scratch/oncodrive3d/datasets_240506" - annotations3d = "/workspace/nobackup/scratch/oncodrive3d/annotations_240506" - domains_file = "/workspace/projects/prominent/dev/internal_development/domains/o3d_pfam_parsed.tsv" - - + datasets3d = "/workspace/nobackup/scratch/oncodrive3d/datasets_240506" + annotations3d = "/workspace/nobackup/scratch/oncodrive3d/annotations_240506" + domains_file = "/workspace/projects/prominent/dev/internal_development/domains/o3d_pfam_parsed.tsv" } // Define the cacheDir for the singularity images -singularity.cacheDir = '/workspace/datasets/pipelines/nextflow_containers' -singularity.libraryDir = '/workspace/datasets/pipelines/nextflow_containers' +singularity.cacheDir = '/workspace/datasets/pipelines/nextflow_containers' +singularity.libraryDir = '/workspace/datasets/pipelines/nextflow_containers' diff --git a/conf/general_files_IRB.config b/conf/general_files_IRB.config index 598f7462..14566230 100644 --- a/conf/general_files_IRB.config +++ b/conf/general_files_IRB.config @@ -1,27 +1,25 @@ // This configuration file is used to define the general parameters for the pipeline when ran in IRBCluster params { - vep_cache = "/data/bbg/datasets/vep" + vep_cache = "/data/bbg/datasets/vep" // Fasta references - fasta = '/data/bbg/datasets/genomes/GRCh38/clean_n_fixed_genome/GCA_000001405.15_GRCh38_no_alt_analysis_set.masked.fna' + fasta = '/data/bbg/datasets/genomes/GRCh38/clean_n_fixed_genome/GCA_000001405.15_GRCh38_no_alt_analysis_set.masked.fna' - wgs_trinuc_counts = "assets/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" + wgs_trinuc_counts = "assets/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" - cosmic_ref_signatures = "/data/bbg/datasets/transfer/ferriol_deepcsa/COSMIC_v3.4_SBS_GRCh38.txt" - wgs_trinuc_counts = "/data/bbg/datasets/transfer/ferriol_deepcsa/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" - cadd_scores = "/data/bbg/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz" - cadd_scores_ind = "/data/bbg/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz.tbi" + cosmic_ref_signatures = "/data/bbg/datasets/transfer/ferriol_deepcsa/COSMIC_v3.4_SBS_GRCh38.txt" + wgs_trinuc_counts = "/data/bbg/datasets/transfer/ferriol_deepcsa/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" + cadd_scores = "/data/bbg/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz" + cadd_scores_ind = "/data/bbg/datasets/CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz.tbi" - dnds_ref_transcripts = "/data/bbg/projects/prominent/analysis/dNdScv/data/reference_files/RefCDS_human_latest_intogen.rda" - dnds_covariates = "/data/bbg/projects/prominent/analysis/dNdScv/data/reference_files/covariates_hg19_hg38_epigenome_pcawg.rda" + dnds_ref_transcripts = "/data/bbg/projects/prominent/analysis/dNdScv/data/reference_files/RefCDS_human_latest_intogen.rda" + dnds_covariates = "/data/bbg/projects/prominent/analysis/dNdScv/data/reference_files/covariates_hg19_hg38_epigenome_pcawg.rda" // oncodrive3d - datasets3d = "/data/bbg/nobackup/scratch/oncodrive3d/datasets_240506" - annotations3d = "/data/bbg/nobackup/scratch/oncodrive3d/annotations_240506" - domains_file = "/data/bbg/projects/prominent/dev/internal_development/domains/o3d_pfam_parsed.tsv" - - + datasets3d = "/data/bbg/nobackup/scratch/oncodrive3d/datasets_240506" + annotations3d = "/data/bbg/nobackup/scratch/oncodrive3d/annotations_240506" + domains_file = "/data/bbg/projects/prominent/dev/internal_development/domains/o3d_pfam_parsed.tsv" } diff --git a/conf/local.config b/conf/local.config index 460fbc48..f26a46c4 100644 --- a/conf/local.config +++ b/conf/local.config @@ -10,6 +10,5 @@ ---------------------------------------------------------------------------------------- */ -process.resourceLimits = [ cpus: 16, memory: 70.GB, time: 6.h ] +process.resourceLimits = [cpus: 16, memory: 70.GB, time: 6.h] process.errorStrategy = 'finish' - diff --git a/conf/mice.config b/conf/mice.config index fda6a1cc..836c387e 100644 --- a/conf/mice.config +++ b/conf/mice.config @@ -3,37 +3,38 @@ params { config_profile_description = 'Running deepCSA for mice data' // Input data - input = '/data/bbg/nobackup2/prominent/ucsf_mice/deepUMIcaller/deepCSA_input.med.csv' + input = '/data/bbg/nobackup2/prominent/ucsf_mice/deepUMIcaller/deepCSA_input.med.csv' // Fasta references - fasta = '/data/bbg/datasets/genomes/mm39/GCA_000001635.9_genome/GCA_000001635.9_GRCm39_genomic.fna' + fasta = '/data/bbg/datasets/genomes/mm39/GCA_000001635.9_genome/GCA_000001635.9_GRCm39_genomic.fna' - features_table = "/data/bbg/nobackup2/prominent/ucsf_mice/2024-10-17_clinical_features_summary.tsv" - features_table_separator = 'tab' - features_table_dict = ['"unique_identifier" : "sample"', - '"groups_of_interest" : [ ["DMBA"], ["TPA"], ["treatment"], ["sex"], ["timepoint"], ["timepoint", "treatment"], ["timepoint", "TPA"], ["timepoint", "DMBA"] ]' - ].join(',\t').trim() + features_table = "/data/bbg/nobackup2/prominent/ucsf_mice/2024-10-17_clinical_features_summary.tsv" + features_table_separator = 'tab' + features_table_dict = [ + '"unique_identifier" : "sample"', + '"groups_of_interest" : [ ["DMBA"], ["TPA"], ["treatment"], ["sex"], ["timepoint"], ["timepoint", "treatment"], ["timepoint", "TPA"], ["timepoint", "DMBA"] ]', + ].join(',\t').trim() - use_custom_minimum_depth = 30 + use_custom_minimum_depth = 30 - wgs_trinuc_counts = "$projectDir/assets/trinucleotide_counts/trinuc_counts.mus_musculus.mm39.tsv" + wgs_trinuc_counts = "${projectDir}/assets/trinucleotide_counts/trinuc_counts.mus_musculus.mm39.tsv" - vep_genome = "GRCm39" - vep_cache_version = 111 - vep_out_format = "tab" - vep_params = "--no_stats --cache --offline --symbol --protein --canonical" - vep_species = "mus_musculus" - vep_cache = "/data/bbg/datasets/vep/mus_musculus/111_GRCm39" + vep_genome = "GRCm39" + vep_cache_version = 111 + vep_out_format = "tab" + vep_params = "--no_stats --cache --offline --symbol --protein --canonical" + vep_species = "mus_musculus" + vep_cache = "/data/bbg/datasets/vep/mus_musculus/111_GRCm39" // oncodrive3d datasets3d = "/data/bbg/nobackup/scratch/oncodrive3d/datasets_mouse" // annotations3d = "/workspace/nobackup/scratch/oncodrive3d/annotations_240506" - omega_withingene = false - omega_subgenic_bedfile = "/data/bbg/datasets/transfer/ferriol_deepcsa/mouse_skin_panel.hotspots.bed4.bed" - hotspot_expansion = 15 + omega_withingene = false + omega_subgenic_bedfile = "/data/bbg/datasets/transfer/ferriol_deepcsa/mouse_skin_panel.hotspots.bed4.bed" + hotspot_expansion = 15 oncodrivefml = false @@ -50,8 +51,8 @@ params { signatures = true - mutationdensity = true - mutated_cells_vaf = false + mutationdensity = true + mutated_cells_vaf = false indels = false @@ -75,12 +76,11 @@ params { mutation_depth_threshold = 40 repetitive_variant_thres = 5 - } process { - withLabel:process_high_memory { - memory = { 15.GB * task.attempt } + withLabel: process_high_memory { + memory = { 15.GB * task.attempt } } } diff --git a/conf/modes/basic.config b/conf/modes/basic.config index 5a2a5cbe..035ecb63 100644 --- a/conf/modes/basic.config +++ b/conf/modes/basic.config @@ -1,5 +1,5 @@ params { - plot_depths = true - signatures = true - profileall = true + plot_depths = true + signatures = true + profileall = true } diff --git a/conf/modes/clonal_structure.config b/conf/modes/clonal_structure.config index 39bfb28d..28bf35fc 100644 --- a/conf/modes/clonal_structure.config +++ b/conf/modes/clonal_structure.config @@ -1,32 +1,31 @@ params { - mutationdensity = true + mutationdensity = true - profileall = true + profileall = true - oncodrivefml = true - oncodriveclustl = false + oncodrivefml = true + oncodriveclustl = false - oncodrive3d = true - o3d_raw_vep = true - o3d_plot = true + oncodrive3d = true + o3d_raw_vep = true + o3d_plot = true - omega = true - omega_multi = true - omega_globalloc = true - omega_mutabilities = true - site_comparison_grouping = 'all' - omega_plot = true + omega = true + omega_multi = true + omega_globalloc = true + omega_mutabilities = true + site_comparison_grouping = 'all' + omega_plot = true - omega_withingene = true - omega_autodomains = true - omega_autoexons = true + omega_withingene = true + omega_autodomains = true + omega_autoexons = true - mutated_cells_vaf = true - mutepi_genes_to_recode = null + mutated_cells_vaf = true + mutepi_genes_to_recode = null - indels = true - - signatures = true + indels = true + signatures = true } diff --git a/conf/modes/get_signatures.config b/conf/modes/get_signatures.config index 19799534..30ffc761 100644 --- a/conf/modes/get_signatures.config +++ b/conf/modes/get_signatures.config @@ -1,12 +1,10 @@ params { - mutationdensity = true - - profileall = true - profilenonprot = true - profileexons = true - profileintrons = true - - signatures = true + mutationdensity = true + profileall = true + profilenonprot = true + profileexons = true + profileintrons = true + signatures = true } diff --git a/conf/modules.config b/conf/modules.config index ea420932..1a214ac7 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -15,67 +15,67 @@ process { publishDir = [ path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }, mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, ] withName: SAMPLESHEET_CHECK { publishDir = [ path: { "${params.outdir}/pipeline_info" }, mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, ] } - withName: 'ENSEMBLVEP_VEP' { - ext.args = { [ - "${params.vep_params}", - (params.vep_out_format) ? "--${params.vep_out_format}" : '--tab' - ].join(' ').trim() - } - publishDir = [ - enabled : false + withName: ENSEMBLVEP_VEP { + ext.args = { + [ + "${params.vep_params}", + params.vep_out_format ? "--${params.vep_out_format}" : '--tab', + ].join(' ').trim() + } + publishDir = [ + enabled: false ] } - withName: 'COMPUTEDEPTHS' { - ext.restrict_panel = params.use_custom_bedfile - ext.minimum_depth = params.use_custom_minimum_depth - ext.args = "-H" - - publishDir = [ - enabled : false + withName: COMPUTEDEPTHS { + ext.restrict_panel = params.use_custom_bedfile + ext.minimum_depth = params.use_custom_minimum_depth + ext.args = "-H" + publishDir = [ + enabled: false ] } - withName: 'FILTEREXONS' { - ext.filtername = 'not_in_exons' + withName: FILTEREXONS { + ext.filtername = 'not_in_exons' } - withName: 'FILTERPANEL' { - ext.filtername = 'not_covered' + withName: FILTERPANEL { + ext.filtername = 'not_covered' } - withName: 'SUBSETDEPTHS' { + withName: SUBSETDEPTHS { ext.prefix = { ".subset_depths" } ext.args = '' ext.args2 = '-s 1 -b 2 -e 2' ext.args3 = '-h' ext.extension = 'tsv' ext.header = '1' - publishDir = [ - enabled : false + publishDir = [ + enabled: false ] } - withName: 'SUBSETPANEL' { + withName: SUBSETPANEL { ext.prefix = { ".subset_panel" } ext.args = '' ext.args2 = '-s 1 -b 2 -e 2' ext.args3 = '-h' ext.extension = 'tsv' ext.header = '1' - publishDir = [ - enabled : false + publishDir = [ + enabled: false ] } @@ -90,185 +90,194 @@ process { } - withName: 'SUBSETMUTATIONS' { + withName: SUBSETMUTATIONS { ext.prefix = { ".subset_mutations" } ext.args = '' ext.args2 = '-s 1 -b 2 -e 2' ext.args3 = '-h' ext.extension = 'tsv' ext.header = '1' - publishDir = [ - enabled : false + publishDir = [ + enabled: false ] } - withName: 'SUBSETPILEUP' { + withName: SUBSETPILEUP { ext.prefix = { ".subset_pileup" } ext.args = '' ext.args2 = '-s 1 -b 2 -e 2' ext.args3 = '-h' ext.extension = 'tsv' ext.header = 'pile' - publishDir = [ - enabled : false + publishDir = [ + enabled: false ] } - withName: "BBGTOOLS:DEEPCSA:.*ALL:.*" { - ext.prefix = { ".all" } + withName: 'BBGTOOLS:DEEPCSA:.*ALL:.*' { + ext.prefix = { ".all" } } - withName: "BBGTOOLS:DEEPCSA:.*INTRONS:.*" { - ext.prefix = { ".introns" } + withName: 'BBGTOOLS:DEEPCSA:.*INTRONS:.*' { + ext.prefix = { ".introns" } } - withName: "BBGTOOLS:DEEPCSA:.*PROT:.*" { - ext.prefix = { ".prot_aff" } + withName: 'BBGTOOLS:DEEPCSA:.*PROT:.*' { + ext.prefix = { ".prot_aff" } } - withName: "BBGTOOLS:DEEPCSA:.*NONPROT:.*" { - ext.prefix = { ".non_prot_aff" } + withName: 'BBGTOOLS:DEEPCSA:.*NONPROT:.*' { + ext.prefix = { ".non_prot_aff" } } - withName: "BBGTOOLS:DEEPCSA:.*EXONS:.*" { - ext.prefix = { ".exons" } + withName: 'BBGTOOLS:DEEPCSA:.*EXONS:.*' { + ext.prefix = { ".exons" } } // withName: "BBGTOOLS:DEEPCSA:.*SYNONYMOUS:.*" { // ext.prefix = { ".synonymous" } // } - withName: 'VCF2MAF' { - ext.args = "--level ${params.confidence_level}" + withName: VCF2MAF { + ext.args = "--level ${params.confidence_level}" } - withName: 'POSTPROCESSVEPPANEL' { - ext.canonical_only = params.panel_with_canonical - publishDir = [ + withName: POSTPROCESSVEPPANEL { + ext.canonical_only = params.panel_with_canonical + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/postprocessveppanel" }, - pattern: "*.tsv" + pattern: "*.tsv", ] ] } - withName: 'SUMANNOTATION' { - ext.hotspots_annotation = params.hotspots_annotation + withName: SUMANNOTATION { + ext.hotspots_annotation = params.hotspots_annotation } withName: 'FILTERBATCH|MERGEBATCH|FILTERPANEL|VCF2MAF|COMPUTETRINUC|COMPUTEDEPTHS' { - publishDir = [ - enabled : false + publishDir = [ + enabled: false ] } - withName: 'PLOTMAF' { - ext.filters = { [['"VAF" : "le ', "${params.germline_threshold}", '"'].join('').trim(), - ['"DEPTH" : "ge ', "${params.mutation_depth_threshold}", '"'].join('').trim()].join(',\t').trim() - } - ext.plots = { ['"global":["per_sample", "per_gene", "filter_stats SAMPLE_ID n_rich,no_pileup_support,other_sample_SNP", "filter_stats canonical_SYMBOL n_rich,no_pileup_support,other_sample_SNP", "plot_stats SAMPLE_ID canonical_Consequence_broader,TYPE,MUTTYPE", "plot_stats canonical_SYMBOL canonical_Consequence_broader,TYPE,MUTTYPE"]'].join(',\t').trim() } + withName: PLOTMAF { + ext.filters = { + [ + ['"VAF" : "le ', "${params.germline_threshold}", '"'].join('').trim(), + ['"DEPTH" : "ge ', "${params.mutation_depth_threshold}", '"'].join('').trim(), + ].join(',\t').trim() + } + ext.plots = { ['"global":["per_sample", "per_gene", "filter_stats SAMPLE_ID n_rich,no_pileup_support,other_sample_SNP", "filter_stats canonical_SYMBOL n_rich,no_pileup_support,other_sample_SNP", "plot_stats SAMPLE_ID canonical_Consequence_broader,TYPE,MUTTYPE", "plot_stats canonical_SYMBOL canonical_Consequence_broader,TYPE,MUTTYPE"]'].join(',\t').trim() } } - withName: 'PLOTSOMATICMAF' { - ext.filters = "" - ext.plots = { ['"global":["per_sample", "per_gene", "plot_stats SAMPLE_ID canonical_Consequence_broader,canonical_Protein_affecting,TYPE,MUTTYPE", "plot_stats canonical_SYMBOL canonical_Consequence_broader,canonical_Protein_affecting,TYPE,MUTTYPE"]'].join(',\t').trim() } + withName: PLOTSOMATICMAF { + ext.filters = "" + ext.plots = { ['"global":["per_sample", "per_gene", "plot_stats SAMPLE_ID canonical_Consequence_broader,canonical_Protein_affecting,TYPE,MUTTYPE", "plot_stats canonical_SYMBOL canonical_Consequence_broader,canonical_Protein_affecting,TYPE,MUTTYPE"]'].join(',\t').trim() } } - withName: 'PLOTOMEGA' { + withName: PLOTOMEGA { errorStrategy = 'ignore' } - withName: 'DEPTHSSUMMARY' { - ext.withingene = params.plot_depths + withName: DEPTHSSUMMARY { + ext.withingene = params.plot_depths } - withName: ".*PLOTDEPTHSALLCONS:DEPTHSSUMMARY" { - ext.prefix = { ".all_cons" } + withName: '.*PLOTDEPTHSALLCONS:DEPTHSSUMMARY' { + ext.prefix = { ".all_cons" } } - withName: ".*PLOTDEPTHSEXONS:DEPTHSSUMMARY" { - ext.prefix = { ".exons" } + withName: '.*PLOTDEPTHSEXONS:DEPTHSSUMMARY' { + ext.prefix = { ".exons" } } - withName: ".*PLOTDEPTHSEXONSCONS:DEPTHSSUMMARY" { - ext.prefix = { ".exons_cons" } + withName: '.*PLOTDEPTHSEXONSCONS:DEPTHSSUMMARY' { + ext.prefix = { ".exons_cons" } } - withName: 'WRITEMAF' { - publishDir = [ + withName: WRITEMAF { + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/germline_somatic" }, - pattern: "*{tsv.gz}" + pattern: "*{tsv.gz}", ] ] } - withName: 'CLEANMUTATIONS' { - ext.filters = { + withName: CLEANMUTATIONS { + ext.filters = { def baseFilters = [:] - baseFilters["FILTER"] = params.filter_criteria.collect { "\"$it\"" } + baseFilters["FILTER"] = params.filter_criteria.collect { "\"${it}\"" } if (!params.no_filter) { baseFilters["DEPTH"] = "ge ${params.mutation_depth_threshold}" baseFilters["VAF_distorted_expanded_sq"] = false } - baseFilters.collect { key, value -> - "\"${key}\" : ${value instanceof List ? value.toString() : - value instanceof Boolean ? value : - "\"$value\""}" - }.join(',\t') + baseFilters + .collect { key, value -> + "\"${key}\" : ${value instanceof List + ? value.toString() + : value instanceof Boolean + ? value + : "\"${value}\""}" + } + .join(',\t') } ext.output_prefix = '.clean' - ext.output_fmt = { ['"header": true'].join(',\t').trim() } - - publishDir = [ + ext.output_fmt = { ['"header": true'].join(',\t').trim() } + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/clean_germline_somatic" }, - pattern: "*.tsv" + pattern: "*.tsv", ] ] } - withName: 'SOMATICMUTATIONS' { + withName: SOMATICMUTATIONS { ext.output_prefix = '.somatic' - ext.output_fmt = { ['"header": true'].join(',\t').trim() } - - publishDir = [ + ext.output_fmt = { ['"header": true'].join(',\t').trim() } + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/clean_somatic" }, - pattern: "*.tsv" + pattern: "*.tsv", ] ] } // '"FILTER" : ["notcontains NM20", "notcontains p8", "notcontains n_rich", "notcontains cohort_n_rich_threshold", "notcontains cohort_n_rich", "notcontains no_pileup_support", "notcontains low_mappability", "notcontains not_covered" ]', - withName: 'SOMATICMUTATIONS' { + withName: SOMATICMUTATIONS { ext.filters = { - def baseFilters = [:] + def baseFilters = [:] // Handle FILTER criteria - if (params.filter_criteria_somatic) { - baseFilters["FILTER"] = params.filter_criteria_somatic.collect { "\"$it\"" } - } + if (params.filter_criteria_somatic) { + baseFilters["FILTER"] = params.filter_criteria_somatic.collect { "\"${it}\"" } + } - if (!params.no_filter) { - def vafThreshold = params.germline_threshold - baseFilters += [ - "VAF": "le ${vafThreshold}", - "vd_VAF": "le ${vafThreshold}", - "VAF_AM" : "le ${vafThreshold}" - ] + if (!params.no_filter) { + def vafThreshold = params.germline_threshold + baseFilters += [ + "VAF": "le ${vafThreshold}", + "vd_VAF": "le ${vafThreshold}", + "VAF_AM": "le ${vafThreshold}", + ] + } + baseFilters + .collect { key, value -> + "\"${key}\" : ${value instanceof List + ? value.toString() + : value instanceof Boolean + ? value + : "\"${value}\""}" } - baseFilters.collect { key, value -> - "\"${key}\" : ${value instanceof List ? value.toString() : - value instanceof Boolean ? value : - "\"$value\""}" - }.join(',\t') + .join(',\t') } } @@ -277,21 +286,21 @@ process { } - withName: 'FILTERBATCH' { + withName: FILTERBATCH { ext.repetitive_variant = params.repetitive_variant_thres ext.germline_threshold = params.germline_threshold } - withName: "TABLE2GROUP" { - ext.features = params.features_table_dict - ext.separator = params.features_table_separator + withName: TABLE2GROUP { + ext.features = params.features_table_dict + ext.separator = params.features_table_separator } - withName: "GROUPGENES" { - ext.custom = params.custom_groups - ext.hotspots = params.omega_withingene - ext.separator = params.custom_groups_separator + withName: GROUPGENES { + ext.custom = params.custom_groups + ext.hotspots = params.omega_withingene + ext.separator = params.custom_groups_separator } // withName: 'EXPANDREGIONS' { @@ -305,170 +314,181 @@ process { // } - withName: 'SUBSETMUTPROFILE' { - ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]', - '"colnames": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETMUTPROFILE { + ext.filters = { + ['"TYPE" : "SNV"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]', + '"colnames": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } withName: '.*NONPROT:SUBSETMUTPROFILE' { - ext.filters = { [ '"TYPE" : "SNV"', - '"Protein_affecting": "non_protein_affecting"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]', - '"colnames": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]' - ].join(',\t').trim() - } - publishDir = [ - enabled : false + ext.filters = { + [ + '"TYPE" : "SNV"', + '"Protein_affecting": "non_protein_affecting"', + ].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]', + '"colnames": ["SAMPLE_ID", "CONTEXT_MUT", "MUT_ID", "ALT_DEPTH"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'COMPUTE_MATRIX' { - ext.args = '--method unique \ + withName: COMPUTE_MATRIX { + ext.args = '--method unique \ --pseud 0 \ --per_sample \ --sigprofiler' } - withName: 'COMPUTE_TRINUCLEOTIDE' { - ext.args = '--pseud 1' + withName: COMPUTE_TRINUCLEOTIDE { + ext.args = '--pseud 1' } - withName: 'COMPUTE_PROFILE' { - ext.args = "--plot --wgs --sigprofiler" + withName: COMPUTE_PROFILE { + ext.args = "--plot --wgs --sigprofiler" } - withName: 'SUBSETMUTABILITY' { - ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "SYMBOL"]', - '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "SYMBOL"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETMUTABILITY { + ext.filters = { + ['"TYPE" : "SNV"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "SYMBOL"]', + '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "SYMBOL"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'COMPUTE_RELATIVE_MUTABILITY' { - ext.args = "--adjust_local_density" - publishDir = [ - enabled : false - ] + withName: COMPUTE_RELATIVE_MUTABILITY { + ext.args = "--adjust_local_density" + publishDir = [ + enabled: false + ] } - withName: 'MUTABILITY_BGZIPTABIX' { - ext.args = '' - ext.args2 = '-b 2 -e 2' - publishDir = [ + withName: MUTABILITY_BGZIPTABIX { + ext.args = '' + ext.args2 = '-b 2 -e 2' + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/relativemutability" }, - pattern: "*.{gz,gz.tbi}" + pattern: "*.{gz,gz.tbi}", ] ] } - withName: 'SUBSET_DNDS' { - ext.filters = '' - - ext.output_fmt = { ['"header": false', - '"columns": ["SAMPLE_ID", "CHROM_ensembl", "POS", "REF", "ALT"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false - ] + withName: SUBSET_DNDS { + ext.filters = '' + ext.output_fmt = { + [ + '"header": false', + '"columns": ["SAMPLE_ID", "CHROM_ensembl", "POS", "REF", "ALT"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false + ] } - withName: 'SUBSETINDELS' { - // ext.filters = '' - ext.filters = { ['"FILTER": "notcontains repetitive_variant"'].join(',\t').trim() } - - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "MUT_ID", "SYMBOL", "INDEL_INFRAME", "Protein_affecting", "TYPE", "MUT_ID"]', - '"colnames": ["SAMPLE_ID", "MUT_ID", "SYMBOL", "INDEL_INFRAME", "Protein_affecting", "TYPE", "MUT_ID"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETINDELS { + ext.filters = { ['"FILTER": "notcontains repetitive_variant"'].join(',\t').trim() } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "MUT_ID", "SYMBOL", "INDEL_INFRAME", "Protein_affecting", "TYPE", "MUT_ID"]', + '"colnames": ["SAMPLE_ID", "MUT_ID", "SYMBOL", "INDEL_INFRAME", "Protein_affecting", "TYPE", "MUT_ID"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'SUBSETMUTEPIVAFAM' { - ext.output_fmt = { ['"header": true', - '"columns": ["CHROM", "canonical_SYMBOL", "canonical_Consequence_broader", "VAF_AM", "ALT_DEPTH_AM", "DEPTH_AM", "canonical_Protein_affecting", "TYPE", "VAF_ND", "ALT_DEPTH_ND", "DEPTH_ND", "VAF", "ALT_DEPTH", "DEPTH", "MUT_ID"]', - '"colnames": ["CHROM", "GENE", "Consequence_broader", "VAF_AM", "ALT_DEPTH_AM", "DEPTH_AM", "Protein_affecting", "TYPE", "VAF_ND", "ALT_DEPTH_ND", "DEPTH_ND", "VAF", "ALT_DEPTH", "DEPTH", "MUT_ID"]' - ].join(',\t').trim() - } - publishDir = [ - enabled : false + withName: SUBSETMUTEPIVAFAM { + ext.output_fmt = { + [ + '"header": true', + '"columns": ["CHROM", "canonical_SYMBOL", "canonical_Consequence_broader", "VAF_AM", "ALT_DEPTH_AM", "DEPTH_AM", "canonical_Protein_affecting", "TYPE", "VAF_ND", "ALT_DEPTH_ND", "DEPTH_ND", "VAF", "ALT_DEPTH", "DEPTH", "MUT_ID"]', + '"colnames": ["CHROM", "GENE", "Consequence_broader", "VAF_AM", "ALT_DEPTH_AM", "DEPTH_AM", "Protein_affecting", "TYPE", "VAF_ND", "ALT_DEPTH_ND", "DEPTH_ND", "VAF", "ALT_DEPTH", "DEPTH", "MUT_ID"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'MUTATEDGENOMESFROMVAFAM' { - ext.recode_list = "${params.mutepi_genes_to_recode}"// "TERTpromoter" + withName: MUTATEDGENOMESFROMVAFAM { + ext.recode_list = "${params.mutepi_genes_to_recode}" } - withName: 'SUBSETONCODRIVECLUSTL' { - ext.filters = { "" } - ext.output_fmt = { ['"header": true', - '"columns": ["CHROM_ensembl", "POS_ensembl", "REF_ensembl", "ALT_ensembl", "SAMPLE_ID"]', - '"colnames": ["CHROMOSOME", "POSITION", "REF", "ALT", "SAMPLE"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETONCODRIVECLUSTL { + ext.filters = { "" } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["CHROM_ensembl", "POS_ensembl", "REF_ensembl", "ALT_ensembl", "SAMPLE_ID"]', + '"colnames": ["CHROMOSOME", "POSITION", "REF", "ALT", "SAMPLE"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'EXPECTEDMUTATEDCELLS' { - ext.metadata_file = params.features_table + withName: EXPECTEDMUTATEDCELLS { + ext.metadata_file = params.features_table } - withName: 'INTERVALSBED' { - ext.tool = "oncodrivefml" - publishDir = [ - enabled : false + withName: INTERVALSBED { + ext.tool = "oncodrivefml" + publishDir = [ + enabled: false ] } - withName: 'ONCODRIVECLUSTLBED' { - ext.tool = "oncodriveclustl" - publishDir = [ - enabled : false + withName: ONCODRIVECLUSTLBED { + ext.tool = "oncodriveclustl" + publishDir = [ + enabled: false ] } - withName: 'READSPOSBED' { - ext.tool = "readsxposition" - publishDir = [ - enabled : false + withName: READSPOSBED { + ext.tool = "readsxposition" + publishDir = [ + enabled: false ] } - withName: 'ONCODRIVECLUSTL' { - ext.args = "-sim region_restricted \ + withName: ONCODRIVECLUSTL { + ext.args = "-sim region_restricted \ -kmer 3 \ --clustplot \ --clustplotsig \ @@ -476,38 +496,38 @@ process { --seed 123" } - withName: 'SIGPROFILERASSIGNMENT' { - publishDir = [ + withName: SIGPROFILERASSIGNMENT { + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/signatures/sigprofilerassignment" }, - pattern: "**{txt,pdf}" + pattern: "**{txt,pdf}", ] ] } - withName: 'CUSTOM_DUMPSOFTWAREVERSIONS' { + withName: CUSTOM_DUMPSOFTWAREVERSIONS { publishDir = [ path: { "${params.outdir}/pipeline_info" }, mode: params.publish_dir_mode, - pattern: '*_versions.yml' + pattern: '*_versions.yml', ] } - withName: 'MULTIQC' { - ext.args = params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' + withName: MULTIQC { + ext.args = params.multiqc_title ? "--title \"${params.multiqc_title}\"" : '' publishDir = [ path: { "${params.outdir}/multiqc" }, mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, ] } - withName: 'RUNREGRESSIONSIGNORE' { + withName: RUNREGRESSIONSIGNORE { errorStrategy = 'ignore' - ext.args = "--total_plot ${params.total_plot} \ + ext.args = "--total_plot ${params.total_plot} \ --response_and_total_subplots ${params.response_and_total_subplots} \ --make2 ${params.make2} \ --correct_pvals ${params.correct_pvals} \ @@ -516,9 +536,9 @@ process { --random_effects_vars ${params.random_effects_vars_regressions} \ --missing_values ignore" } - withName: 'RUNREGRESSIONSCOHORT' { + withName: RUNREGRESSIONSCOHORT { errorStrategy = 'ignore' - ext.args = "--total_plot ${params.total_plot} \ + ext.args = "--total_plot ${params.total_plot} \ --response_and_total_subplots ${params.response_and_total_subplots} \ --make2 ${params.make2} \ --correct_pvals ${params.correct_pvals} \ @@ -528,9 +548,9 @@ process { --missing_values cohort" } - withName: 'RUNREGRESSIONSMEAN' { + withName: RUNREGRESSIONSMEAN { errorStrategy = 'ignore' - ext.args = "--total_plot ${params.total_plot} \ + ext.args = "--total_plot ${params.total_plot} \ --response_and_total_subplots ${params.response_and_total_subplots} \ --make2 ${params.make2} \ --correct_pvals ${params.correct_pvals} \ @@ -541,14 +561,14 @@ process { } withName: 'SITESFROMPOSITIONS|SUMMARIZE_ANNOTATION|SIGPROFILERASSIGNMENT|ONCODRIVECLUSTL|POSTPROCESSVEPPANEL' { - ext.assembly = - params.vep_genome == 'GRCh38' ? 'hg38' : - params.vep_genome == 'GRCm38' ? 'mm10' : - params.vep_genome == 'GRCm39' ? 'mm39' : - null + ext.assembly = params.vep_genome == 'GRCh38' + ? 'hg38' + : params.vep_genome == 'GRCm38' + ? 'mm10' + : params.vep_genome == 'GRCm39' + ? 'mm39' + : null } - - } includeConfig 'tools/panels.config' @@ -557,4 +577,3 @@ includeConfig 'tools/mutdensity.config' includeConfig 'tools/oncodrive3d.config' includeConfig 'tools/oncodrivefml.config' includeConfig 'tools/hdp_sig_extraction.config' - diff --git a/conf/test.config b/conf/test.config index d9a9e1b8..9a0b9e5c 100644 --- a/conf/test.config +++ b/conf/test.config @@ -11,91 +11,86 @@ */ params { - config_profile_name = 'Test profile' - config_profile_description = 'Minimal test dataset to check pipeline function' + config_profile_name = 'Test profile' + config_profile_description = 'Minimal test dataset to check pipeline function' // Input data // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets // TODO nf-core: Give any required params for the test so that command line flags are not needed - input = 'assets/input_double_bam.csv' + input = 'assets/input_double_bam.csv' - custom_groups = false + custom_groups = false //custom_groups_file = "/workspace/datasets/transfer/ferriol_deepcsa/genes_per_chromosome_band.tsv" - custom_groups_separator = 'tab' + custom_groups_separator = 'tab' - use_custom_minimum_depth = 100 + use_custom_minimum_depth = 100 - blacklist_mutations = "assets/example_inputs/blacklist_mutations.txt" + blacklist_mutations = "assets/example_inputs/blacklist_mutations.txt" - customize_annotation = false - custom_annotation_tsv = "/data/bbg/datasets/transfer/ferriol_deepcsa/custom_regions/test_file.regions.tsv" + customize_annotation = false + custom_annotation_tsv = "/data/bbg/datasets/transfer/ferriol_deepcsa/custom_regions/test_file.regions.tsv" - hotspots_annotation = false - hotspots_definition_file = '/data/bbg/datasets/transfer/ferriol_deepcsa/hotspots/lung_tcga_hotspots.header.tsv' + hotspots_annotation = false + hotspots_definition_file = '/data/bbg/datasets/transfer/ferriol_deepcsa/hotspots/lung_tcga_hotspots.header.tsv' - omega_withingene = false + omega_withingene = false // omega_subgenic_bedfile = "/data/bbg/datasets/transfer/ferriol_deepcsa/PanCancer_custom.annotated.with_hotspots.complete.cleaned.deepCSA.bed6.bed" // omega_subgenic_bedfile = "/data/bbg/datasets/transfer/ferriol_deepcsa/kidney_panel.hotspots.bed4.bed" - hotspot_expansion = 0 - omega_autodomains = false - omega_autoexons = false + hotspot_expansion = 0 + omega_autodomains = false + omega_autoexons = false - oncodrivefml = false - oncodriveclustl = false + oncodrivefml = false + oncodriveclustl = false - omega = false - omega_globalloc = false - omega_mutabilities = false - site_comparison_grouping = 'all' + omega = false + omega_globalloc = false + omega_mutabilities = false + site_comparison_grouping = 'all' - oncodrive3d = false - o3d_raw_vep = false - o3d_plot = false - o3d_plot_chimerax = false - store_depths = false + oncodrive3d = false + o3d_raw_vep = false + o3d_plot = false + o3d_plot_chimerax = false + store_depths = false - plot_depths = false + plot_depths = false - signatures = false - mutationdensity = false + signatures = false + mutationdensity = false - mutated_epithelium = false - mutated_epithelium_vaf = false - expected_mutation_rate = false - dnds = false + mutated_epithelium = false + mutated_epithelium_vaf = false + expected_mutation_rate = false + dnds = false - indels = false - mutated_cells_vaf = false + indels = false + mutated_cells_vaf = false expected_mutated_cells = false dnds = false - profileall = false - profilenonprot = false - profileexons = false - profileintrons = false - downsample = false - downsample_proportion = 0.7 - - regressions = false - + profileall = false + profilenonprot = false + profileexons = false + profileintrons = false + downsample = false + downsample_proportion = 0.7 + regressions = false } process { - withLabel:process_high_memory { - cpus = { 2 * task.attempt } - memory = { 15.GB * task.attempt } + withLabel: process_high_memory { + cpus = { 2 * task.attempt } + memory = { 15.GB * task.attempt } } - withLabel:process_high { - cpus = { 2 * task.attempt } - memory = { 16.GB * task.attempt } - time = { 1.h * task.attempt } + withLabel: process_high { + cpus = { 2 * task.attempt } + memory = { 16.GB * task.attempt } + time = { 1.h * task.attempt } } - - } - diff --git a/conf/test_real.config b/conf/test_real.config index 86bdadc3..4fb79c04 100644 --- a/conf/test_real.config +++ b/conf/test_real.config @@ -17,29 +17,30 @@ params { // Input data // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets // TODO nf-core: Give any required params for the test so that command line flags are not needed - input = "/data/bbg/datasets/transfer/ferriol_deepcsa/test/deepCSA_input.bladder_med.small_cohort.med.csv" + input = "/data/bbg/datasets/transfer/ferriol_deepcsa/test/deepCSA_input.bladder_med.small_cohort.med.csv" - features_table = "/data/bbg/datasets/transfer/ferriol_deepcsa/test/small_cohort_bladder.tsv" - features_table_separator = 'tab' - features_table_dict = ['"unique_identifier" : "SAMPLE_ID"', - '"groups_of_interest" : [ ["BLADDER_LOCATION"], ["BLADDER_LOCATION", "SEX"], ["BLADDER_LOCATION", "SEX", "SMOKING_STATUS"] ]' - ].join(',\t').trim() + features_table = "/data/bbg/datasets/transfer/ferriol_deepcsa/test/small_cohort_bladder.tsv" + features_table_separator = 'tab' + features_table_dict = [ + '"unique_identifier" : "SAMPLE_ID"', + '"groups_of_interest" : [ ["BLADDER_LOCATION"], ["BLADDER_LOCATION", "SEX"], ["BLADDER_LOCATION", "SEX", "SMOKING_STATUS"] ]', + ].join(',\t').trim() - use_custom_minimum_depth = 10 + use_custom_minimum_depth = 10 custom_groups = false //custom_groups_file = "/workspace/datasets/transfer/ferriol_deepcsa/genes_per_chromosome_band.tsv" - custom_groups_separator = 'tab' + custom_groups_separator = 'tab' - use_custom_minimum_depth = 100 + use_custom_minimum_depth = 100 - customize_annotation = false - custom_annotation_tsv = "/data/bbg/datasets/transfer/ferriol_deepcsa/custom_regions/TERT_regions.tsv" + customize_annotation = false + custom_annotation_tsv = "/data/bbg/datasets/transfer/ferriol_deepcsa/custom_regions/TERT_regions.tsv" - hotspots_annotation = true - hotspots_definition_file = '/data/bbg/datasets/transfer/ferriol_deepcsa/hotspots/all_intogen_v2024.header.tsv' + hotspots_annotation = true + hotspots_definition_file = '/data/bbg/datasets/transfer/ferriol_deepcsa/hotspots/all_intogen_v2024.header.tsv' - omega_withingene = false + omega_withingene = false // omega_subgenic_bedfile = "/data/bbg/datasets/transfer/ferriol_deepcsa/PanCancer_custom.annotated.with_hotspots.complete.cleaned.deepCSA.bed6.bed" // omega_subgenic_bedfile = "/data/bbg/datasets/transfer/ferriol_deepcsa/kidney_panel.hotspots.bed4.bed" // hotspot_expansion = 30 @@ -54,8 +55,8 @@ params { omega_mutabilities = false site_comparison_grouping = 'all' - omega_autodomains = false - omega_autoexons = false + omega_autodomains = false + omega_autoexons = false oncodrive3d = false o3d_raw_vep = false @@ -80,30 +81,25 @@ params { profileexons = false profileintrons = false - consensus_compliance = 0.8 - selected_genes = 'KMT2D,ARID1A,KDM6A,RBM10,EP300,STAG2,CREBBP,NOTCH2,CDKN1A,KMT2C,TP53,RB1' - - regressions = false - - filter_criteria = ["notcontains NM20", "notcontains p8", "notcontains n_rich", "notcontains cohort_n_rich_threshold", "notcontains cohort_n_rich", "notcontains no_pileup_support", "notcontains low_mappability", "notcontains not_covered" ] - filter_criteria_somatic = ["notcontains gnomAD_SNP"] - no_filter = false + consensus_compliance = 0.8 + selected_genes = 'KMT2D,ARID1A,KDM6A,RBM10,EP300,STAG2,CREBBP,NOTCH2,CDKN1A,KMT2C,TP53,RB1' + regressions = false + filter_criteria = ["notcontains NM20", "notcontains p8", "notcontains n_rich", "notcontains cohort_n_rich_threshold", "notcontains cohort_n_rich", "notcontains no_pileup_support", "notcontains low_mappability", "notcontains not_covered"] + filter_criteria_somatic = ["notcontains gnomAD_SNP"] + no_filter = false } process { - withLabel:process_high_memory { - cpus = { 2 * task.attempt } - memory = { 15.GB * task.attempt } + withLabel: process_high_memory { + cpus = { 2 * task.attempt } + memory = { 15.GB * task.attempt } } - withLabel:process_high { - cpus = { 2 * task.attempt } - memory = { 16.GB * task.attempt } - time = { 1.h * task.attempt } + withLabel: process_high { + cpus = { 2 * task.attempt } + memory = { 16.GB * task.attempt } + time = { 1.h * task.attempt } } - - } - diff --git a/conf/tools/hdp_sig_extraction.config b/conf/tools/hdp_sig_extraction.config index 7a19515a..007fc7bf 100644 --- a/conf/tools/hdp_sig_extraction.config +++ b/conf/tools/hdp_sig_extraction.config @@ -26,49 +26,48 @@ params.em_frac_threshold = 0.1 process { - withName: 'PREPARE_INPUT' { - publishDir = [ + withName: PREPARE_INPUT { + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/signatures/signatures_hdp/input" }, - pattern: "*{csv,rds}" + pattern: "*{csv,rds}", ] ] } - withName: 'RUN_HDP_CHAIN_SAMPLING' { - ext.args = "${params.prior_file} \ + withName: RUN_HDP_CHAIN_SAMPLING { + ext.args = "${params.prior_file} \ ${params.n_mut_cutoff} \ ${params.burnin} \ ${params.n_posterior} \ ${params.space} \ ${params.cpiter}" - publishDir = [ - enabled : false + publishDir = [ + enabled: false ] } - withName: 'COMPARE_SIGNATURES' { - ext.args = "${params.cosine_sim_threshold} \ + withName: COMPARE_SIGNATURES { + ext.args = "${params.cosine_sim_threshold} \ ${params.max_iter_em} \ ${params.em_frac_threshold}" - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/signatures/signatures_hdp" }, - pattern: "**{RData,txt,pdf}" + pattern: "**{RData,txt,pdf}", ] ] } - withName: 'PROCESS_HDP_RESULTS' { - ext.args = "${params.prior_file} \ + withName: PROCESS_HDP_RESULTS { + ext.args = "${params.prior_file} \ ${params.n_mut_cutoff} \ ${params.sig_activity_threshold} \ ${params.cohort_threshold}" - publishDir = [ - enabled : false + publishDir = [ + enabled: false ] } - } diff --git a/conf/tools/mutdensity.config b/conf/tools/mutdensity.config index 268694a1..a8f97d8e 100644 --- a/conf/tools/mutdensity.config +++ b/conf/tools/mutdensity.config @@ -12,84 +12,86 @@ process { - withName: 'SUBSETMUTDENSITY' { - ext.filters = '' - - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', - '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETMUTDENSITY { + ext.filters = '' + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', + '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'SUBSETMUTDENSITYADJUSTED' { - ext.filters = { ['"TYPE": "SNV"'].join(',\t').trim()} - - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "canonical_Consequence_broader", "TYPE"]', - '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "IMPACT", "TYPE"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETMUTDENSITYADJUSTED { + ext.filters = { ['"TYPE": "SNV"'].join(',\t').trim() } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "canonical_Consequence_broader", "TYPE"]', + '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "IMPACT", "TYPE"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } withName: 'BBGTOOLS:DEEPCSA:MUTDENSITYPROT:SUBSETMUTDENSITY' { - ext.filters = { ['"Protein_affecting": "protein_affecting"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', - '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + ext.filters = { + ['"Protein_affecting": "protein_affecting"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', + '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } withName: '.*NONPROT:SUBSETMUTDENSITY' { - ext.filters = { ['"Protein_affecting": "non_protein_affecting"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', - '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + ext.filters = { + ['"Protein_affecting": "non_protein_affecting"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', + '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } withName: '.*SYNONYMOUS:SUBSETMUTDENSITY' { - ext.filters = { ['"canonical_Consequence_broader": "synonymous"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', - '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + ext.filters = { + ['"canonical_Consequence_broader": "synonymous"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "canonical_SYMBOL", "TYPE"]', + '"colnames": ["SAMPLE_ID", "MUT_ID", "ALT_DEPTH", "GENE", "TYPE"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'SYNMUTDENSITY' { - ext.mode = 'mutations' + withName: SYNMUTDENSITY { + ext.mode = 'mutations' } - withName: 'SYNMUTREADSRATE' { - ext.mode = 'mutated_reads' + withName: SYNMUTREADSRATE { + ext.mode = 'mutated_reads' } - } - - - diff --git a/conf/tools/omega.config b/conf/tools/omega.config index 73bd865e..1037629a 100644 --- a/conf/tools/omega.config +++ b/conf/tools/omega.config @@ -13,156 +13,165 @@ process { withName: 'SITECOMPARISON.*' { - ext.size = params.site_comparison_grouping + ext.size = params.site_comparison_grouping } - withName: 'SUBSETOMEGA' { - ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID"]', - '"colnames": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETOMEGA { + ext.filters = { + ['"TYPE" : "SNV"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID"]', + '"colnames": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'SUBSETOMEGAMULTI' { - ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "ALT_DEPTH"]', - '"colnames": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "EFFECTIVE_MUTS"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETOMEGAMULTI { + ext.filters = { + ['"TYPE" : "SNV"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "ALT_DEPTH"]', + '"colnames": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "EFFECTIVE_MUTS"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } withName: '.*MULTI:SUBSETOMEGA' { - ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() - } - ext.output_fmt = { ['"header": true', - '"columns": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "ALT_DEPTH"]', - '"colnames": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "EFFECTIVE_MUTS"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + ext.filters = { + ['"TYPE" : "SNV"'].join(',\t').trim() + } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "ALT_DEPTH"]', + '"colnames": ["CHROM", "POS", "REF", "ALT", "SAMPLE_ID", "EFFECTIVE_MUTS"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: "BBGTOOLS:DEEPCSA:OMEGAMULTI:.*" { - ext.prefix = { ".multi" } + withName: 'BBGTOOLS:DEEPCSA:OMEGAMULTI:.*' { + ext.prefix = { ".multi" } } - withName: "BBGTOOLS:DEEPCSA:OMEGANONPROTMULTI:.*" { - ext.prefix = { ".non_prot_aff.multi" } + withName: 'BBGTOOLS:DEEPCSA:OMEGANONPROTMULTI:.*' { + ext.prefix = { ".non_prot_aff.multi" } } - withName: "BBGTOOLS:DEEPCSA:OMEGA:.*GLOBALLOC" { - ext.prefix = { ".global_loc" } + withName: 'BBGTOOLS:DEEPCSA:OMEGA:.*GLOBALLOC' { + ext.prefix = { ".global_loc" } } - withName: "BBGTOOLS:DEEPCSA:OMEGAMULTI:.*GLOBALLOC" { - ext.prefix = { ".multi.global_loc" } + withName: 'BBGTOOLS:DEEPCSA:OMEGAMULTI:.*GLOBALLOC' { + ext.prefix = { ".multi.global_loc" } } - withName: "BBGTOOLS:DEEPCSA:OMEGANONPROT:.*GLOBALLOC" { - ext.prefix = { ".non_prot_aff.global_loc" } + withName: 'BBGTOOLS:DEEPCSA:OMEGANONPROT:.*GLOBALLOC' { + ext.prefix = { ".non_prot_aff.global_loc" } } - withName: "BBGTOOLS:DEEPCSA:OMEGANONPROTMULTI:.*GLOBALLOC" { - ext.prefix = { ".non_prot_aff.multi.global_loc" } + withName: 'BBGTOOLS:DEEPCSA:OMEGANONPROTMULTI:.*GLOBALLOC' { + ext.prefix = { ".non_prot_aff.multi.global_loc" } } - withName: 'PREPROCESSING' { - ext.args = "" - publishDir = [ + withName: PREPROCESSING { + ext.args = "" + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/omega/preprocessing" }, - pattern: "*{tsv}" + pattern: "*{tsv}", ] ] } - withName: 'ESTIMATOR' { - ext.option = 'mle' - ext.args = "" - publishDir = [ + withName: ESTIMATOR { + ext.option = 'mle' + ext.args = "" + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/omega" }, - pattern: "*{tsv}" + pattern: "*{tsv}", ] ] } - withName: 'PLOTOMEGA' { - ext.args = "" - publishDir = [ + withName: PLOTOMEGA { + ext.args = "" + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/omega/plot" }, - pattern: "**{pdf}" + pattern: "**{pdf}", ] ] } - withName: 'PREPROCESSINGGLOBALLOC' { - ext.args = "" - ext.global_loc = true - publishDir = [ + withName: PREPROCESSINGGLOBALLOC { + ext.args = "" + ext.global_loc = true + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/omegagloballoc/preprocessing" }, - pattern: "*{tsv}" + pattern: "*{tsv}", ] ] } - withName: 'ESTIMATORGLOBALLOC' { - ext.option = 'mle' - ext.args = "" - publishDir = [ + withName: ESTIMATORGLOBALLOC { + ext.option = 'mle' + ext.args = "" + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/omegagloballoc" }, - pattern: "*{tsv}" + pattern: "*{tsv}", ] ] } - withName: 'PLOTOMEGAGLOBALLOC' { - ext.args = "" - publishDir = [ + withName: PLOTOMEGAGLOBALLOC { + ext.args = "" + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/omegagloballoc/plot" }, - pattern: "**{pdf}" + pattern: "**{pdf}", ] ] } withName: 'PREPROCESSING.*|ESTIMATOR.*' { - ext.assembly = params.vep_genome == 'GRCh38' ? 'hg38' : - params.vep_genome == 'GRCm38' ? 'mm10' : - params.vep_genome == 'GRCm39' ? 'mm39' : - null // or some default value if none of the conditions are met + ext.assembly = params.vep_genome == 'GRCh38' + ? 'hg38' + : params.vep_genome == 'GRCm38' + ? 'mm10' + : params.vep_genome == 'GRCm39' + ? 'mm39' + : null } } diff --git a/conf/tools/oncodrive3d.config b/conf/tools/oncodrive3d.config index 86640a9b..aaae9ffc 100644 --- a/conf/tools/oncodrive3d.config +++ b/conf/tools/oncodrive3d.config @@ -12,62 +12,57 @@ process { - withName: 'SUBSETONCODRIVE3D' { - ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() } - ext.output_fmt = { ['"header": true', - '"columns": ["SAMPLE_ID", "canonical_SYMBOL", "canonical_Consequence", "canonical_Amino_acids", "canonical_Protein_position", "MUT_ID"]', - '"colnames": ["Tumor_Sample_Barcode", "SYMBOL", "Consequence", "Amino_acids", "Protein_position", "MUT_ID"]' - ].join(',\t').trim() - } - publishDir = [ - enabled : false + withName: SUBSETONCODRIVE3D { + ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["SAMPLE_ID", "canonical_SYMBOL", "canonical_Consequence", "canonical_Amino_acids", "canonical_Protein_position", "MUT_ID"]', + '"colnames": ["Tumor_Sample_Barcode", "SYMBOL", "Consequence", "Amino_acids", "Protein_position", "MUT_ID"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'ONCODRIVE3D_PREPROCESSING' { - publishDir = [ - enabled : false + withName: ONCODRIVE3D_PREPROCESSING { + publishDir = [ + enabled: false ] } - withName: 'ONCODRIVE3D_RUN' { - ext.args = "-s 128" - ext.vep_raw = params.o3d_raw_vep - - // TODO revise why this is false - ext.mane = false - - publishDir = [ + withName: ONCODRIVE3D_RUN { + ext.args = "-s 128" + ext.vep_raw = params.o3d_raw_vep + ext.mane = false + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/oncodrive3d/run" }, - pattern: "**{tsv,log,csv,json}" + pattern: "**{tsv,log,csv,json}", ] -// enabled : false ] } - withName: 'ONCODRIVE3D_PLOT' { - publishDir = [ + withName: ONCODRIVE3D_PLOT { + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/oncodrive3d/plot" }, - pattern: "**{png,log,csv}" + pattern: "**{png,log,csv}", ] -// enabled : false ] } - withName: 'ONCODRIVE3D_PLOT_CHIMERAX' { - publishDir = [ + withName: ONCODRIVE3D_PLOT_CHIMERAX { + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/oncodrive3d/plotchimerax" }, - pattern: "**{png,log,defattr}" + pattern: "**{png,log,defattr}", ] -// enabled : false ] } - } diff --git a/conf/tools/oncodrivefml.config b/conf/tools/oncodrivefml.config index de2982ac..e6619052 100644 --- a/conf/tools/oncodrivefml.config +++ b/conf/tools/oncodrivefml.config @@ -12,35 +12,31 @@ process { - withName: 'SUBSETONCODRIVEFML' { - ext.filters = { "" } - ext.output_fmt = { ['"header": true', - '"columns": ["CHROM_ensembl", "POS_ensembl", "REF_ensembl", "ALT_ensembl", "SAMPLE_ID"]', - '"colnames": ["CHROMOSOME", "POSITION", "REF", "ALT", "SAMPLE"]' - ].join(',\t').trim() - } - - publishDir = [ - enabled : false + withName: SUBSETONCODRIVEFML { + ext.filters = { "" } + ext.output_fmt = { + [ + '"header": true', + '"columns": ["CHROM_ensembl", "POS_ensembl", "REF_ensembl", "ALT_ensembl", "SAMPLE_ID"]', + '"colnames": ["CHROMOSOME", "POSITION", "REF", "ALT", "SAMPLE"]', + ].join(',\t').trim() + } + publishDir = [ + enabled: false ] } - withName: 'ONCODRIVEFMLSNVS' { - ext.args = "--no-indels --debug" + withName: ONCODRIVEFMLSNVS { + ext.args = "--no-indels --debug" } - withName: 'ONCODRIVEFML' { - ext.args = "--debug" + withName: ONCODRIVEFML { + ext.args = "--debug" } - withName: 'ONCODRIVEFMLBED' { - ext.tool = "oncodrivefml" - publishDir = [ - enabled : false + withName: ONCODRIVEFMLBED { + ext.tool = "oncodrivefml" + publishDir = [ + enabled: false ] } - - } - - - diff --git a/conf/tools/panels.config b/conf/tools/panels.config index 8f2b5361..530b851b 100644 --- a/conf/tools/panels.config +++ b/conf/tools/panels.config @@ -13,109 +13,105 @@ process { withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:VCFANNOTATEPANEL:ENSEMBLVEP_VEP' { - ext.args = "${params.vep_params_panel} --tab" - publishDir = [ + ext.args = "${params.vep_params_panel} --tab" + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/panelannotation" }, - pattern: "*{gz}" + pattern: "*{gz}", ] ] } - withName: 'CUSTOMPROCESSING' { + withName: CUSTOMPROCESSING { ext.simple = true } - withName: 'CUSTOMPROCESSINGRICH' { + withName: CUSTOMPROCESSINGRICH { ext.simple = false } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATECAPTUREDPANELS' { - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/capturedpanels" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATECONSENSUSPANELS.*' { - ext.args = "--consensus_min_depth ${params.consensus_panel_min_depth} \ + ext.args = "--consensus_min_depth ${params.consensus_panel_min_depth} \ --compliance_threshold ${params.consensus_compliance} " - ext.genes_subset = "${params.selected_genes}" - publishDir = [ + ext.genes_subset = "${params.selected_genes}" + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/consensuspanels" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATESAMPLEPANELSALL' { - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/samplepanels/createsamplepanelsall" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATESAMPLEPANELSPROTAFFECT' { - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/samplepanels/createsamplepanelsprotaffect" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATESAMPLEPANELSNONPROTAFFECT' { - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/samplepanels/createsamplepanelsnonprotaffect" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATESAMPLEPANELSEXONS' { - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/samplepanels/createsamplepanelsexons" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATESAMPLEPANELSINTRONS' { - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/samplepanels/createsamplepanelsintrons" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } withName: 'BBGTOOLS:DEEPCSA:CREATEPANELS:CREATESAMPLEPANELSSYNONYMOUS' { - publishDir = [ + publishDir = [ [ mode: params.publish_dir_mode, path: { "${params.outdir}/createpanels/samplepanels/createsamplepanelssynonymous" }, - pattern: "*{tsv,bed}" + pattern: "*{tsv,bed}", ] ] } - } - - - diff --git a/conf/tools/regressions.config b/conf/tools/regressions.config index 71e1fc9d..1eda2b7d 100644 --- a/conf/tools/regressions.config +++ b/conf/tools/regressions.config @@ -1,11 +1,10 @@ - // Description: Configuration file for the regressions part of the analysis. // This file contains the parameters for the regressions analysis, including // the mutdensity, omega, and oncodrivefml regressions, as well as the responses // and samples subsets, predictors file, and other parameters. params { - mutdensity_regressions = null + mutdensity_regressions = null omega_regressions = null oncodrivefml_regressions = null responses_subset_regressions = '""' @@ -22,4 +21,4 @@ params { make2 = true correct_pvals = true sign_threshold = 0.05 -} \ No newline at end of file +} diff --git a/main.nf b/main.nf index e4393e26..64e16d55 100644 --- a/main.nf +++ b/main.nf @@ -28,9 +28,8 @@ include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_deep // WORKFLOW: Run main analysis pipeline depending on type of input // workflow BBGTOOLS { - main: - - DEEPCSA () + + DEEPCSA() } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -40,10 +39,8 @@ workflow BBGTOOLS { workflow { - main: - // SUBWORKFLOW: Run initialisation tasks - PIPELINE_INITIALISATION ( + PIPELINE_INITIALISATION( params.version, params.help, params.validate_params, @@ -56,11 +53,4 @@ workflow { // WORKFLOW: Run main workflow // BBGTOOLS() - } - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - THE END -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ \ No newline at end of file diff --git a/modules/local/annotatedepth/main.nf b/modules/local/annotatedepth/main.nf index 3e070a46..05aba3c2 100644 --- a/modules/local/annotatedepth/main.nf +++ b/modules/local/annotatedepth/main.nf @@ -6,17 +6,16 @@ process ANNOTATE_DEPTHS { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(depths) + tuple val(meta), path(depths) tuple val(meta2), path(panel_all) - path (json_groups) - path (input_csv) + path json_groups + path input_csv output: // tuple val(meta), path("*.depths.annotated.tsv.gz") , emit: annotated_depths - path("*.depths.annotated.tsv.gz") , emit: annotated_depths - tuple val(meta), path("all_samples_indv.depths.tsv.gz") , emit: all_samples_depths - path "versions.yml" , topic: versions - + path ("*.depths.annotated.tsv.gz"), emit: annotated_depths + tuple val(meta), path("all_samples_indv.depths.tsv.gz"), emit: all_samples_depths + path "versions.yml", topic: versions script: """ diff --git a/modules/local/bbgtools/omega/estimator/main.nf b/modules/local/bbgtools/omega/estimator/main.nf index 60571976..bc54e479 100644 --- a/modules/local/bbgtools/omega/estimator/main.nf +++ b/modules/local/bbgtools/omega/estimator/main.nf @@ -1,5 +1,5 @@ process OMEGA_ESTIMATOR { - tag "$meta.id" + tag "${meta.id}" label 'cpu_single_fixed' label 'time_low' label 'process_high_memory' @@ -8,14 +8,13 @@ process OMEGA_ESTIMATOR { container 'docker.io/ferriolcalvet/omega:20250716' input: - tuple val(meta) , path(mutabilities_table), path(mutations_table), path(depths) + tuple val(meta), path(mutabilities_table), path(mutations_table), path(depths) tuple val(meta2), path(annotated_panel) - path (genes_json) + path genes_json output: tuple val(meta), path("output_*.tsv"), emit: results - path "versions.yml" , topic: versions - + path "versions.yml", topic: versions script: def option = task.ext.option ?: "" @@ -74,4 +73,3 @@ process OMEGA_ESTIMATOR { END_VERSIONS """ } - diff --git a/modules/local/bbgtools/omega/mutabilities/main.nf b/modules/local/bbgtools/omega/mutabilities/main.nf index 827f1651..4e9c155f 100644 --- a/modules/local/bbgtools/omega/mutabilities/main.nf +++ b/modules/local/bbgtools/omega/mutabilities/main.nf @@ -1,5 +1,5 @@ process OMEGA_MUTABILITIES { - tag "$meta.id" + tag "${meta.id}" label 'cpu_single_fixed' label 'time_low' label 'process_high_memory' @@ -8,14 +8,13 @@ process OMEGA_MUTABILITIES { container 'docker.io/ferriolcalvet/omega:20250716' input: - tuple val(meta) , path(mutabilities_table), path(mutations_table), path(depths) + tuple val(meta), path(mutabilities_table), path(mutations_table), path(depths) tuple val(meta2), path(annotated_panel) - path (genes_json) + path genes_json output: - tuple val(meta), path("mutabilities_per_site.*.tsv.gz") , emit: mutabilities - path "versions.yml" , topic: versions - + tuple val(meta), path("mutabilities_per_site.*.tsv.gz"), emit: mutabilities + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -56,4 +55,3 @@ process OMEGA_MUTABILITIES { END_VERSIONS """ } - diff --git a/modules/local/bbgtools/omega/preprocess/main.nf b/modules/local/bbgtools/omega/preprocess/main.nf index 4dad2f68..d977a34d 100644 --- a/modules/local/bbgtools/omega/preprocess/main.nf +++ b/modules/local/bbgtools/omega/preprocess/main.nf @@ -1,5 +1,5 @@ process OMEGA_PREPROCESS { - tag "$meta.id" + tag "${meta.id}" label 'cpu_single_fixed' label 'time_low' label 'process_high_memory' @@ -8,17 +8,15 @@ process OMEGA_PREPROCESS { container 'docker.io/ferriolcalvet/omega:20250716' input: - tuple val(meta) , path(mutations), path(depths), path(mutation_profile) - tuple val(meta2), path (annotated_panel) - tuple val(meta3), path (syn_muts_global) - tuple val(meta4), path (mut_profile_global, stageAs: 'global_mutprofile.tsv') - + tuple val(meta), path(mutations), path(depths), path(mutation_profile) + tuple val(meta2), path(annotated_panel) + tuple val(meta3), path(syn_muts_global) + tuple val(meta4), path(mut_profile_global, stageAs: 'global_mutprofile.tsv') output: - tuple val(meta), path("mutability_per_sample_gene_context.*.tsv"), path("mutations_per_sample_gene_impact_context.*.tsv") , emit: mutabs_n_mutations_tsv - tuple val(meta), path("syn_muts.*.tsv") , emit: syn_muts_tsv - path "versions.yml" , topic: versions - + tuple val(meta), path("mutability_per_sample_gene_context.*.tsv"), path("mutations_per_sample_gene_impact_context.*.tsv"), emit: mutabs_n_mutations_tsv + tuple val(meta), path("syn_muts.*.tsv"), emit: syn_muts_tsv + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -58,16 +56,3 @@ process OMEGA_PREPROCESS { END_VERSIONS """ } - -// omega preprocessing --preprocessing-mode compute_mutabilities -// --depths-file all_samples.subset_depths.tsv.gz -// --mutations-file all_samples.mutations.tsv -// --input-vep-postprocessed-file consensus.exons_splice_sites.tsv -// --table-observed-muts mutations_per_sample_gene_impact_context.all_samples2.global_loc.gLoc.tsv -// --mutabilities-table mutability_per_sample_gene_context.all_samples2.global_loc.gLoc.tsv -// --synonymous-muts-table syn_muts.all_samples2.global_loc.gLoc.tsv -// --mutational-profile-file all_samples.all.profile.tsv -// --mutational-profile-global-file P19_0033_BTR_01.all.profile.tsv -// --single-sample all_samples -// --absent-synonymous infer_global_custom -// --synonymous-mutrates-file mutdensities_per_gene.tsv diff --git a/modules/local/bbgtools/oncodrive3d/plot/main.nf b/modules/local/bbgtools/oncodrive3d/plot/main.nf index 6337a514..47046f0b 100644 --- a/modules/local/bbgtools/oncodrive3d/plot/main.nf +++ b/modules/local/bbgtools/oncodrive3d/plot/main.nf @@ -1,39 +1,37 @@ process ONCODRIVE3D_PLOT { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/bbglab/oncodrive3d:1.0.5' - input: tuple val(meta), path(genes_csv), path(pos_csv), path(mutations_csv), path(miss_prob_json), path(seq_df_tsv) - path(datasets) - path(annotations) + path datasets + path annotations output: - tuple val(meta), path("**.summary_plot.png") , emit: summary_plot, optional: true - tuple val(meta), path("**.genes_plots/**.png") , emit: genes_plot, optional: true - tuple val(meta), path("**.associations_plots/**.logodds_plot.png") , emit: logodds_plot, optional: true - tuple val(meta), path("**.associations_plots/**.volcano_plot.png") , emit: volcano_plot, optional: true - tuple val(meta), path("**.associations_plots/**.volcano_plot_gene.png") , emit: volcano_plot_gene, optional: true - tuple val(meta), path("**.3d_clustering_pos.annotated.csv") , emit: pos_annotated_csv, optional: true - tuple val(meta), path("**plot_*.log") , emit: log - path "versions.yml" , topic: versions - + tuple val(meta), path("**.summary_plot.png"), emit: summary_plot, optional: true + tuple val(meta), path("**.genes_plots/**.png"), emit: genes_plot, optional: true + tuple val(meta), path("**.associations_plots/**.logodds_plot.png"), emit: logodds_plot, optional: true + tuple val(meta), path("**.associations_plots/**.volcano_plot.png"), emit: volcano_plot, optional: true + tuple val(meta), path("**.associations_plots/**.volcano_plot_gene.png"), emit: volcano_plot_gene, optional: true + tuple val(meta), path("**.3d_clustering_pos.annotated.csv"), emit: pos_annotated_csv, optional: true + tuple val(meta), path("**plot_*.log"), emit: log + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" """ - oncodrive3D plot -o $prefix \\ - -g $genes_csv \\ - -p $pos_csv \\ - -i $mutations_csv \\ - -m $miss_prob_json \\ - -s $seq_df_tsv \\ - -d $datasets \\ - -a $annotations \\ - -c $prefix \\ + oncodrive3D plot -o ${prefix} \\ + -g ${genes_csv} \\ + -p ${pos_csv} \\ + -i ${mutations_csv} \\ + -m ${miss_prob_json} \\ + -s ${seq_df_tsv} \\ + -d ${datasets} \\ + -a ${annotations} \\ + -c ${prefix} \\ --output_csv \\ @@ -55,4 +53,3 @@ process ONCODRIVE3D_PLOT { END_VERSIONS """ } - diff --git a/modules/local/bbgtools/oncodrive3d/plot_chimerax/main.nf b/modules/local/bbgtools/oncodrive3d/plot_chimerax/main.nf index 1cc74028..a8c08776 100644 --- a/modules/local/bbgtools/oncodrive3d/plot_chimerax/main.nf +++ b/modules/local/bbgtools/oncodrive3d/plot_chimerax/main.nf @@ -1,21 +1,19 @@ process ONCODRIVE3D_PLOT_CHIMERAX { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' // TODO pending to push the container somewhere and be able to retrieve it container 'docker.io/spellegrini87/oncodrive3d_chimerax:latest' - input: tuple val(meta), path(genes_csv), path(pos_csv), path(miss_prob_json), path(seq_df_tsv) - path(datasets) + path datasets output: - tuple val(meta), path("**.chimerax/attributes/**.defattr") , emit: chimerax_defattr, optional: true - tuple val(meta), path("**.chimerax/plots/**.png") , emit: chimerax_plot, optional: true - tuple val(meta), path("**.log") , emit: log - path "versions.yml" , topic: versions - + tuple val(meta), path("**.chimerax/attributes/**.defattr"), emit: chimerax_defattr, optional: true + tuple val(meta), path("**.chimerax/plots/**.png"), emit: chimerax_plot, optional: true + tuple val(meta), path("**.log"), emit: log + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -24,12 +22,12 @@ process ONCODRIVE3D_PLOT_CHIMERAX { // Increase/decrease pixel_size to decrease/increase resolution and speed/slow png generation // TODO revise argument definition """ - oncodrive3D chimerax-plot -o $prefix \\ - -g $genes_csv \\ - -p $pos_csv \\ - -d $datasets \\ - -s $seq_df_tsv \\ - -c $prefix \\ + oncodrive3D chimerax-plot -o ${prefix} \\ + -g ${genes_csv} \\ + -p ${pos_csv} \\ + -d ${datasets} \\ + -s ${seq_df_tsv} \\ + -c ${prefix} \\ --fragmented_proteins \\ --pixel_size 0.8 \\ --transparent_bg @@ -53,4 +51,3 @@ process ONCODRIVE3D_PLOT_CHIMERAX { END_VERSIONS """ } - diff --git a/modules/local/bbgtools/oncodrive3d/preprocessing/main.nf b/modules/local/bbgtools/oncodrive3d/preprocessing/main.nf index e124d94b..b26ec356 100644 --- a/modules/local/bbgtools/oncodrive3d/preprocessing/main.nf +++ b/modules/local/bbgtools/oncodrive3d/preprocessing/main.nf @@ -1,17 +1,16 @@ process ONCODRIVE3D_PREPROCESSING { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta), path(maf) + tuple val(meta), path(maf) tuple val(meta2), path(all_vep_output) output: - tuple val(meta), path("*.mutations.raw_vep.tsv") , emit: vep_output4o3d - path "versions.yml" , topic: versions - + tuple val(meta), path("*.mutations.raw_vep.tsv"), emit: vep_output4o3d + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/bbgtools/oncodrive3d/run/main.nf b/modules/local/bbgtools/oncodrive3d/run/main.nf index f1f7f0e9..b2074f8c 100644 --- a/modules/local/bbgtools/oncodrive3d/run/main.nf +++ b/modules/local/bbgtools/oncodrive3d/run/main.nf @@ -1,24 +1,21 @@ process ONCODRIVE3D_RUN { - tag "$meta.id" + tag "${meta.id}" label 'process_high' container 'docker.io/bbglab/oncodrive3d:1.0.5' - input: tuple val(meta), path(mutations), path(mutabilities), path(mutabilities_ind) - path (datasets) - + path datasets output: - tuple val(meta), path("**genes.csv") , emit: csv_genes - tuple val(meta), path("**pos.csv") , emit: csv_pos - tuple val(meta), path("**mutations.processed.tsv") , emit: mut_processed, optional: true - tuple val(meta), path("**miss_prob.processed.json") , emit: prob_processed, optional: true - tuple val(meta), path("**seq_df.processed.tsv") , emit: seq_processed, optional: true - tuple val(meta), path("**run_*.log") , emit: log - path "versions.yml" , topic: versions - + tuple val(meta), path("**genes.csv"), emit: csv_genes + tuple val(meta), path("**pos.csv"), emit: csv_pos + tuple val(meta), path("**mutations.processed.tsv"), emit: mut_processed, optional: true + tuple val(meta), path("**miss_prob.processed.json"), emit: prob_processed, optional: true + tuple val(meta), path("**seq_df.processed.tsv"), emit: seq_processed, optional: true + tuple val(meta), path("**run_*.log"), emit: log + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" @@ -42,12 +39,12 @@ process ONCODRIVE3D_RUN { } EOF - oncodrive3D run -i $mutations \\ + oncodrive3D run -i ${mutations} \\ -m oncodrive3d.mutability.conf \\ - -d $datasets \\ - -C $prefix \\ - -o $prefix \\ - $args \\ + -d ${datasets} \\ + -C ${prefix} \\ + -o ${prefix} \\ + ${args} \\ -c ${task.cpus} \\ ${vep_raw} \\ ${mane} @@ -71,4 +68,3 @@ process ONCODRIVE3D_RUN { END_VERSIONS """ } - diff --git a/modules/local/bbgtools/oncodriveclustl/main.nf b/modules/local/bbgtools/oncodriveclustl/main.nf index 51476280..f56efda0 100644 --- a/modules/local/bbgtools/oncodriveclustl/main.nf +++ b/modules/local/bbgtools/oncodriveclustl/main.nf @@ -1,5 +1,5 @@ process ONCODRIVECLUSTL { - tag "$meta.id" + tag "${meta.id}" label 'process_high' // // conda "YOUR-TOOL-HERE" @@ -9,16 +9,15 @@ process ONCODRIVECLUSTL { container 'docker.io/ferriolcalvet/oncodriveclustl:latest' input: - tuple val(meta) , path (mutations), path(mutabilities), path(mutabilities_ind) - tuple val(meta2), path (bed_file) + tuple val(meta), path(mutations), path(mutabilities), path(mutabilities_ind) + tuple val(meta2), path(bed_file) output: - tuple val(meta), path("**.tsv") , emit: tsv - tuple val(meta), path("**.txt") , emit: txt - tuple val(meta), path("**.png") , optional:true, emit: png - tuple val(meta), path("**.log") , emit: log - path "versions.yml" , topic: versions - + tuple val(meta), path("**.tsv"), emit: tsv + tuple val(meta), path("**.txt"), emit: txt + tuple val(meta), path("**.png"), optional: true, emit: png + tuple val(meta), path("**.log"), emit: log + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" @@ -28,7 +27,7 @@ process ONCODRIVECLUSTL { """ cat > mutability_config.json << EOF { - "file" : "$mutabilities", + "file" : "${mutabilities}", "format" : "tabix", "chr" : 0, "chr_prefix" : "chr", diff --git a/modules/local/bbgtools/oncodrivefml/main.nf b/modules/local/bbgtools/oncodrivefml/main.nf index 347a3fc2..ed70085a 100644 --- a/modules/local/bbgtools/oncodrivefml/main.nf +++ b/modules/local/bbgtools/oncodrivefml/main.nf @@ -1,5 +1,5 @@ process ONCODRIVEFML { - tag "$meta.id" + tag "${meta.id}" label 'process_high' // // conda "YOUR-TOOL-HERE" @@ -9,21 +9,21 @@ process ONCODRIVEFML { container 'docker.io/ferriolcalvet/oncodrivefml:latest' input: - tuple val(meta) , path(mutations), path(mutabilities), path(mutabilities_ind) - tuple val(meta2), path (bed_file) + tuple val(meta), path(mutations), path(mutabilities), path(mutabilities_ind) + tuple val(meta2), path(bed_file) tuple path(cadd_scores_file), path(cadd_scores_index) - val(mode) + val mode output: - tuple val(meta), path("**.tsv.gz") , emit: tsv - tuple val(meta), path("**.png") , emit: png - tuple val(meta), path("**.html") , emit: html - tuple val(meta), path("${meta.id}.${mode}/") , emit: folder - path "versions.yml" , topic: versions - + tuple val(meta), path("**.tsv.gz"), emit: tsv + tuple val(meta), path("**.png"), emit: png + tuple val(meta), path("**.html"), emit: html + tuple val(meta), path("${meta.id}.${mode}/"), emit: folder + path "versions.yml", topic: versions script: - def args = task.ext.args ?: "" // "-s ${params.seed}" + def args = task.ext.args ?: "" + // "-s ${params.seed}" def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" // TODO: See if we can provide the entire json as an input parameter @@ -38,7 +38,7 @@ process ONCODRIVEFML { [mutability] adjusting = True - file = '$mutabilities' + file = '${mutabilities}' format = 'tabix' chr = 0 chr_prefix = "chr" @@ -90,10 +90,10 @@ process ONCODRIVEFML { seed = 123 EOF - oncodrivefml -i $mutations \\ - -e $bed_file \\ - -o $prefix \\ - $args \\ + oncodrivefml -i ${mutations} \\ + -e ${bed_file} \\ + -o ${prefix} \\ + ${args} \\ -c oncodrivefml_v2.mutability.conf cat <<-END_VERSIONS > versions.yml diff --git a/modules/local/bbgtools/sitecomparison/main.nf b/modules/local/bbgtools/sitecomparison/main.nf index 4af1f7ad..b8e4830c 100644 --- a/modules/local/bbgtools/sitecomparison/main.nf +++ b/modules/local/bbgtools/sitecomparison/main.nf @@ -1,5 +1,5 @@ process SITE_COMPARISON { - tag "$meta.id" + tag "${meta.id}" label 'cpu_single_fixed' label 'time_low' label 'process_high_memory' @@ -7,18 +7,18 @@ process SITE_COMPARISON { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(mutations), path(mutabilities_per_site) + tuple val(meta), path(mutations), path(mutabilities_per_site) tuple val(meta2), path(annotated_panel_richer) output: - tuple val(meta), path("*.comparison.tsv.gz") , emit: comparisons - path "versions.yml" , topic: versions - + tuple val(meta), path("*.comparison.tsv.gz"), emit: comparisons + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" - def size = task.ext.size ?: "all" // other options are 'site', 'aa_change', 'aa', '3aa', '3aa_rolling' // think if is worth having 'Naa', 'Naa_rolling' + def size = task.ext.size ?: "all" + // other options are 'site', 'aa_change', 'aa', '3aa', '3aa_rolling' // think if is worth having 'Naa', 'Naa_rolling' """ omega_comparison_per_site.py --mutations-file ${mutations} \\ --panel-file ${annotated_panel_richer} \\ @@ -44,4 +44,3 @@ process SITE_COMPARISON { END_VERSIONS """ } - diff --git a/modules/local/blacklistmuts/main.nf b/modules/local/blacklistmuts/main.nf index bf846af3..72b3353c 100644 --- a/modules/local/blacklistmuts/main.nf +++ b/modules/local/blacklistmuts/main.nf @@ -1,6 +1,6 @@ process BLACKLIST_MUTATIONS { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -10,8 +10,8 @@ process BLACKLIST_MUTATIONS { path blacklist_file output: - tuple val(meta), path("*.bk.filtered.mutations.tsv") , emit: mutations - path "versions.yml" , topic: versions + tuple val(meta), path("*.bk.filtered.mutations.tsv"), emit: mutations + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -39,4 +39,4 @@ process BLACKLIST_MUTATIONS { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/local/combine_sbs/main.nf b/modules/local/combine_sbs/main.nf index 224609ac..f2725355 100644 --- a/modules/local/combine_sbs/main.nf +++ b/modules/local/combine_sbs/main.nf @@ -5,14 +5,12 @@ process SIGNATURES_PROBABILITIES { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" - input: - tuple val(meta), path (signature_probabilities) + tuple val(meta), path(signature_probabilities) output: - path ("*.decomposed_probabilities.tsv") , emit: signature_probs - path "versions.yml" , topic: versions - + path ("*.decomposed_probabilities.tsv"), emit: signature_probs + path "versions.yml", topic: versions script: """ diff --git a/modules/local/compute_mutability/main.nf b/modules/local/compute_mutability/main.nf index e12d5de3..9f1d6330 100644 --- a/modules/local/compute_mutability/main.nf +++ b/modules/local/compute_mutability/main.nf @@ -1,25 +1,20 @@ process COMPUTE_RELATIVE_MUTABILITY { - tag "$meta.id" + tag "${meta.id}" label 'process_low_fixed_cpus' label 'process_high_memory' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(matrix), path(mut_profile), path(depths) + tuple val(meta), path(matrix), path(mut_profile), path(depths) tuple val(meta2), path(bedfile) output: // TODO revise this to see which one is outputed and why - tuple val(meta), path("*.relative_mutability_per_site.tsv") , emit: mutability_not_adjusted - tuple val(meta), path("*.relative_mutability_per_site.tsv.adjusted") , emit: mutability - path "versions.yml" , topic: versions - - // tuple val(meta), path("*.relative_mutability_per_site.tsv") , emit: mutability - // tuple val(meta), path("*.relative_mutability_per_site.tsv.adjusted") , optional:true , emit: mutability_adjusted - // path "versions.yml" , topic: versions - + tuple val(meta), path("*.relative_mutability_per_site.tsv"), emit: mutability_not_adjusted + tuple val(meta), path("*.relative_mutability_per_site.tsv.adjusted"), emit: mutability + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" @@ -41,7 +36,6 @@ process COMPUTE_RELATIVE_MUTABILITY { END_VERSIONS """ - stub: def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" diff --git a/modules/local/compute_profile/main.nf b/modules/local/compute_profile/main.nf index 080840f7..f5be8637 100644 --- a/modules/local/compute_profile/main.nf +++ b/modules/local/compute_profile/main.nf @@ -1,6 +1,6 @@ process COMPUTE_PROFILE { - tag "$meta.id" + tag "${meta.id}" label 'process_low' @@ -8,19 +8,18 @@ process COMPUTE_PROFILE { input: tuple val(meta), path(matrix), path(trinucleotide) - path( wgs_trinucleotides ) + path wgs_trinucleotides output: - tuple val(meta), path("*.profile.tsv") , emit: profile - tuple val(meta), path("*.proportion_mutations.tsv") , optional:true , emit: panel_proportions - tuple val(meta), path("*.proportion_mutations.WGS.tsv") , optional:true , emit: wgs_proportions - tuple val(meta), path("*.matrix.WGS.tsv") , optional:true , emit: wgs - tuple val(meta), path("*.matrix.WGS.sigprofiler.tsv") , optional:true , emit: wgs_sigprofiler + tuple val(meta), path("*.profile.tsv"), emit: profile + tuple val(meta), path("*.proportion_mutations.tsv"), optional: true, emit: panel_proportions + tuple val(meta), path("*.proportion_mutations.WGS.tsv"), optional: true, emit: wgs_proportions + tuple val(meta), path("*.matrix.WGS.tsv"), optional: true, emit: wgs + tuple val(meta), path("*.matrix.WGS.sigprofiler.tsv"), optional: true, emit: wgs_sigprofiler - tuple val(meta), path("*.pdf") , optional:true , emit: plots - - path "versions.yml" , topic: versions + tuple val(meta), path("*.pdf"), optional: true, emit: plots + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" @@ -40,7 +39,6 @@ process COMPUTE_PROFILE { END_VERSIONS """ - stub: def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" diff --git a/modules/local/compute_trinucleotide/main.nf b/modules/local/compute_trinucleotide/main.nf index f99f683e..26ef53a0 100644 --- a/modules/local/compute_trinucleotide/main.nf +++ b/modules/local/compute_trinucleotide/main.nf @@ -1,6 +1,6 @@ process COMPUTE_TRINUCLEOTIDE { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -10,8 +10,7 @@ process COMPUTE_TRINUCLEOTIDE { output: tuple val(meta), path("*.trinucleotides.tsv.gz"), emit: trinucleotides - path "versions.yml" , topic: versions - + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" @@ -28,7 +27,6 @@ process COMPUTE_TRINUCLEOTIDE { END_VERSIONS """ - stub: def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" diff --git a/modules/local/computedepths/main.nf b/modules/local/computedepths/main.nf index 1f4135dd..b9c3b02f 100644 --- a/modules/local/computedepths/main.nf +++ b/modules/local/computedepths/main.nf @@ -1,20 +1,19 @@ process COMPUTEDEPTHS { - tag "$meta.id" + tag "${meta.id}" label 'process_high' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : - 'biocontainers/samtools:1.18--h50ea8bc_1' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' + : 'biocontainers/samtools:1.18--h50ea8bc_1'}" input: tuple val(meta), path(bam) - path (custombed) + path custombed output: - tuple val(meta), path("*.tsv.gz") , emit: depths - path "versions.yml" , topic: versions - + tuple val(meta), path("*.tsv.gz"), emit: depths + path "versions.yml", topic: versions script: def args = task.ext.args ?: '' @@ -26,14 +25,14 @@ process COMPUTEDEPTHS { // this variable is used for subsetting the output depths table to only // positions with a mean depth above a given value // if the provided value is 0 this is not used - def minimum_depth = task.ext.minimum_depth ? "| awk 'NR == 1 {print; next} {sum = 0; for (i=3; i<=NF; i++) sum += \$i; mean = sum / (NF - 2); if (mean >= ${task.ext.minimum_depth} ) print }'": "" + def minimum_depth = task.ext.minimum_depth ? "| awk 'NR == 1 {print; next} {sum = 0; for (i=3; i<=NF; i++) sum += \$i; mean = sum / (NF - 2); if (mean >= ${task.ext.minimum_depth} ) print }'" : "" """ ls -1 *.bam > bam_files_list.txt; samtools \\ depth \\ ${args} \\ ${restrict_to_region} \\ - -@ $task.cpus \\ + -@ ${task.cpus} \\ -f bam_files_list.txt \\ | tail -c +2 \\ ${minimum_depth} \\ @@ -57,19 +56,3 @@ process COMPUTEDEPTHS { END_VERSIONS """ } - - - -// # Generate depth file using samtools depth -// samtools depth -H -@ $task.cpus -f bam_files_list.txt > ${prefix}.depths.tsv - -// # Filter positions with mean depth >= 5 and compress the output -// awk '{ -// sum = 0; -// for (i=3; i<=NF; i++) sum += $i; -// mean = sum / (NF - 2); -// if (mean >= 5) print -// }' ${prefix}.depths.tsv | gzip -c > ${prefix}.filtered.depths.tsv.gz - -// # Optionally, remove the intermediate depth file if it's no longer needed -// rm ${prefix}.depths.tsv diff --git a/modules/local/computemutdensity/main.nf b/modules/local/computemutdensity/main.nf index 23f6e2d4..c65ab9a8 100644 --- a/modules/local/computemutdensity/main.nf +++ b/modules/local/computemutdensity/main.nf @@ -1,5 +1,5 @@ process MUTATION_DENSITY { - tag "$meta.id" + tag "${meta.id}" label 'process_single' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -10,7 +10,7 @@ process MUTATION_DENSITY { output: tuple val(meta), path("*.mutdensities.tsv"), emit: mutdensities - path "versions.yml" , topic: versions + path "versions.yml", topic: versions script: def sample_name = "${meta.id}" @@ -40,5 +40,4 @@ process MUTATION_DENSITY { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - } diff --git a/modules/local/contamination/main.nf b/modules/local/contamination/main.nf index 5fa800eb..c89734b2 100644 --- a/modules/local/contamination/main.nf +++ b/modules/local/contamination/main.nf @@ -1,6 +1,6 @@ process COMPUTE_CONTAMINATION { - tag "$meta.id" + tag "${meta.id}" label 'process_high' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -9,11 +9,10 @@ process COMPUTE_CONTAMINATION { tuple val(meta), path(maf) tuple val(meta2), path(somatic_maf) - output: - tuple val(meta), path("*.tsv") , emit: contamination_results - tuple val(meta2), path("*.pdf") , optional:true, emit: contamination_plots - path "versions.yml" , topic: versions + tuple val(meta), path("*.tsv"), emit: contamination_results + tuple val(meta2), path("*.pdf"), optional: true, emit: contamination_plots + path "versions.yml", topic: versions script: """ diff --git a/modules/local/createpanels/captured/main.nf b/modules/local/createpanels/captured/main.nf index bad7097a..2f1f4926 100644 --- a/modules/local/createpanels/captured/main.nf +++ b/modules/local/createpanels/captured/main.nf @@ -1,32 +1,30 @@ process CREATECAPTUREDPANELS { - tag "$meta.id" + tag "${meta.id}" label 'process_single' label 'process_medium_high_memory' conda "bioconda::pybedtools=0.9.1--py38he0f268d_0" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/pybedtools:0.9.1--py38he0f268d_0' : - 'biocontainers/pybedtools:0.9.1--py38he0f268d_0' }" - + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/pybedtools:0.9.1--py38he0f268d_0' + : 'biocontainers/pybedtools:0.9.1--py38he0f268d_0'}" input: tuple val(meta), path(compact_captured_panel_annotation) output: - path("*.all.tsv") , emit: captured_panel_all - path("*.protein_affecting.tsv") , emit: captured_panel_protein_affecting - path("*.non_protein_affecting.tsv") , emit: captured_panel_non_protein_affecting - path("*.exons_splice_sites.tsv") , emit: captured_panel_exons_splice_sites - path("*.introns_intergenic.tsv") , emit: captured_panel_introns_intergenic - path("*.synonymous.tsv") , emit: captured_panel_synonymous - path("*.all.bed") , emit: captured_panel_all_bed - path("*.protein_affecting.bed") , emit: captured_panel_protein_affecting_bed - path("*.non_protein_affecting.bed") , emit: captured_panel_non_protein_affecting_bed - path("*.exons_splice_sites.bed") , emit: captured_panel_exons_splice_sites_bed - path("*.introns_intergenic.bed") , emit: captured_panel_introns_intergenic_bed - path("*.synonymous.bed") , emit: captured_panel_synonymous_bed - path "versions.yml" , topic: versions - + path ("*.all.tsv"), emit: captured_panel_all + path ("*.protein_affecting.tsv"), emit: captured_panel_protein_affecting + path ("*.non_protein_affecting.tsv"), emit: captured_panel_non_protein_affecting + path ("*.exons_splice_sites.tsv"), emit: captured_panel_exons_splice_sites + path ("*.introns_intergenic.tsv"), emit: captured_panel_introns_intergenic + path ("*.synonymous.tsv"), emit: captured_panel_synonymous + path ("*.all.bed"), emit: captured_panel_all_bed + path ("*.protein_affecting.bed"), emit: captured_panel_protein_affecting_bed + path ("*.non_protein_affecting.bed"), emit: captured_panel_non_protein_affecting_bed + path ("*.exons_splice_sites.bed"), emit: captured_panel_exons_splice_sites_bed + path ("*.introns_intergenic.bed"), emit: captured_panel_introns_intergenic_bed + path ("*.synonymous.bed"), emit: captured_panel_synonymous_bed + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/createpanels/consensus/main.nf b/modules/local/createpanels/consensus/main.nf index 0391b416..44451f8d 100644 --- a/modules/local/createpanels/consensus/main.nf +++ b/modules/local/createpanels/consensus/main.nf @@ -1,27 +1,26 @@ process CREATECONSENSUSPANELS { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "python=3.10.17 bioconda::pybedtools=0.12.0 conda-forge::polars=1.30.0 conda-forge::click=8.2.1 conda-forge::gcc_linux-64=15.1.0 conda-forge::gxx_linux-64=15.1.0" container 'docker://bbglab/deepcsa_bed:latest' input: - tuple val(meta) , path(compact_captured_panel_annotation) + tuple val(meta), path(compact_captured_panel_annotation) tuple val(meta2), path(depths) output: - tuple val(meta), path("consensus*.tsv") , emit: consensus_panel - tuple val(meta), path("consensus*.bed") , emit: consensus_panel_bed - tuple val(meta), path("failing_consensus*.tsv") , emit: failing_consensus_panel - path "versions.yml" , topic: versions - + tuple val(meta), path("consensus*.tsv"), emit: consensus_panel + tuple val(meta), path("consensus*.bed"), emit: consensus_panel_bed + tuple val(meta), path("failing_consensus*.tsv"), emit: failing_consensus_panel + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" def args = task.ext.args ?: "" def genes_subset = task.ext.genes_subset ?: "" - target_genes = genes_subset != "" ? "--genes ${genes_subset}": "" + target_genes = genes_subset != "" ? "--genes ${genes_subset}" : "" """ ## ${target_genes} create_consensus_panel.py \\ diff --git a/modules/local/createpanels/custombedfile/main.nf b/modules/local/createpanels/custombedfile/main.nf index c39f9b2b..addd09c4 100644 --- a/modules/local/createpanels/custombedfile/main.nf +++ b/modules/local/createpanels/custombedfile/main.nf @@ -1,19 +1,18 @@ process CREATECUSTOMBEDFILE { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "bioconda::pybedtools=0.9.1--py38he0f268d_0" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/pybedtools:0.9.1--py38he0f268d_0' : - 'biocontainers/pybedtools:0.9.1--py38he0f268d_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/pybedtools:0.9.1--py38he0f268d_0' + : 'biocontainers/pybedtools:0.9.1--py38he0f268d_0'}" input: - tuple val(meta) , path(panel_tsv) + tuple val(meta), path(panel_tsv) output: tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , topic: versions - + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/createpanels/sample/main.nf b/modules/local/createpanels/sample/main.nf index e75fa28f..85809d60 100644 --- a/modules/local/createpanels/sample/main.nf +++ b/modules/local/createpanels/sample/main.nf @@ -1,24 +1,22 @@ process CREATESAMPLEPANELS { - tag "$meta.id" + tag "${meta.id}" label 'process_single' label 'time_low' conda "bioconda::pybedtools=0.9.1--py38he0f268d_0" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/pybedtools:0.9.1--py38he0f268d_0' : - 'biocontainers/pybedtools:0.9.1--py38he0f268d_0' }" - + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/pybedtools:0.9.1--py38he0f268d_0' + : 'biocontainers/pybedtools:0.9.1--py38he0f268d_0'}" input: - tuple val(meta) , path(compact_captured_panel_annotation) + tuple val(meta), path(compact_captured_panel_annotation) tuple val(meta2), path(depths) - val(min_depth) + val min_depth output: - path("*.tsv") , emit: sample_specific_panel - path("*.bed") , emit: sample_specific_panel_bed - path "versions.yml" , topic: versions - + path ("*.tsv"), emit: sample_specific_panel + path ("*.bed"), emit: sample_specific_panel_bed + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/dna2protein/main.nf b/modules/local/dna2protein/main.nf index 047efae3..dba91da6 100644 --- a/modules/local/dna2protein/main.nf +++ b/modules/local/dna2protein/main.nf @@ -1,21 +1,18 @@ process DNA_2_PROTEIN_MAPPING { - tag "$meta.id" + tag "${meta.id}" label 'process_single' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" - input: - tuple val(meta) , path(mutations_file) + tuple val(meta), path(mutations_file) tuple val(meta2), path(panel_file) tuple val(meta3), path(all_samples_depths) - output: - tuple val(meta2), path("depths_per_position_exon_gene.tsv") , emit: depths_exons_positions - tuple val(meta2), path("panel_exons.bed4.bed") , emit: panel_exons_bed - path "versions.yml" , topic: versions - + tuple val(meta2), path("depths_per_position_exon_gene.tsv"), emit: depths_exons_positions + tuple val(meta2), path("panel_exons.bed4.bed"), emit: panel_exons_bed + path "versions.yml", topic: versions script: """ @@ -41,5 +38,4 @@ process DNA_2_PROTEIN_MAPPING { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - } diff --git a/modules/local/dnds/preprocess/main.nf b/modules/local/dnds/preprocess/main.nf index 85919472..a1f05124 100644 --- a/modules/local/dnds/preprocess/main.nf +++ b/modules/local/dnds/preprocess/main.nf @@ -1,5 +1,5 @@ process PREPROCESS_DNDS { - tag "$meta.id" + tag "${meta.id}" label 'cpu_single_fixed' label 'time_low' label 'process_high_memory' @@ -7,14 +7,12 @@ process PREPROCESS_DNDS { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(depths) - tuple val(meta2), path (annotated_panel) - + tuple val(meta), path(depths) + tuple val(meta2), path(annotated_panel) output: - tuple val(meta), path("*.depths_input.tsv") , emit: depths - path "versions.yml" , topic: versions - + tuple val(meta), path("*.depths_input.tsv"), emit: depths + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -40,4 +38,3 @@ process PREPROCESS_DNDS { END_VERSIONS """ } - diff --git a/modules/local/dnds/run/main.nf b/modules/local/dnds/run/main.nf index 8441f30e..2d92dd7f 100644 --- a/modules/local/dnds/run/main.nf +++ b/modules/local/dnds/run/main.nf @@ -1,5 +1,5 @@ process RUN_DNDS { - tag "$meta.id" + tag "${meta.id}" label 'cpu_single_fixed' label 'time_low' label 'process_high_memory' @@ -8,14 +8,13 @@ process RUN_DNDS { container 'docker.io/ferriolcalvet/dnds:latest' input: - tuple val(meta) , path(mutations_table), path(depths) + tuple val(meta), path(mutations_table), path(depths) tuple val(meta2), path(ref_cds) - path (covariates) + path covariates output: - tuple val(meta), path("*.out.tsv*") , emit: results - path "versions.yml" , topic: versions - + tuple val(meta), path("*.out.tsv*"), emit: results + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -46,18 +45,3 @@ process RUN_DNDS { END_VERSIONS """ } - -// "--referencetranscripts" -// default="/workspace/projects/prominent/analysis/dNdScv/data/reference_files/RefCDS_human_latest_intogen.rda", -// --covariates -// "/workspace/projects/prominent/analysis/dNdScv/data/reference_files/covariates_hg19_hg38_epigenome_pcawg.rda", -// help="Human GRCh38 covariates file [default= %default]", metavar="character"), -// --genelist"), type="character", -// default=NULL, -// help="Gene list file [default= %default]", metavar="character"), -// --genedepth"), type="character", -// default=NULL, -// help="Gene depth file (2 columns: GENE\tAVG_DEPTH) [default= %default]", metavar="character"), -// --snvsonly"), type="logical", -// default=FALSE, -// help="Only use SNVs for the analysis [default= %default]", metavar="logical") diff --git a/modules/local/downsample/depths/main.nf b/modules/local/downsample/depths/main.nf index 6d0b7b59..3cc9880b 100644 --- a/modules/local/downsample/depths/main.nf +++ b/modules/local/downsample/depths/main.nf @@ -1,6 +1,6 @@ process DOWNSAMPLE_DEPTHS { - tag "$meta.id" + tag "${meta.id}" label 'process_high' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -8,11 +8,9 @@ process DOWNSAMPLE_DEPTHS { input: tuple val(meta), path(depths_file) - output: - tuple val(meta), path("*.downsampled.tsv.gz") , emit: downsampled_depths - path "versions.yml" , topic: versions - + tuple val(meta), path("*.downsampled.tsv.gz"), emit: downsampled_depths + path "versions.yml", topic: versions script: def downsample_prop = task.ext.downsample_prop ?: 1 diff --git a/modules/local/downsample/mutations/main.nf b/modules/local/downsample/mutations/main.nf index 522d40a2..3f9cbbdb 100644 --- a/modules/local/downsample/mutations/main.nf +++ b/modules/local/downsample/mutations/main.nf @@ -3,7 +3,7 @@ process DOWNSAMPLE_MUTATIONS { // mutations should be downsampled differently in different runs cache false - tag "$meta.id" + tag "${meta.id}" label 'process_high' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -12,8 +12,8 @@ process DOWNSAMPLE_MUTATIONS { tuple val(meta), path(mutations_file) output: - tuple val(meta), path("*.downsampled.mutations.tsv") , emit: downsampled_muts - path "versions.yml" , topic: versions + tuple val(meta), path("*.downsampled.mutations.tsv"), emit: downsampled_muts + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/expand_regions/main.nf b/modules/local/expand_regions/main.nf index 303b91c0..e201ef83 100644 --- a/modules/local/expand_regions/main.nf +++ b/modules/local/expand_regions/main.nf @@ -1,21 +1,20 @@ process EXPAND_REGIONS { - tag "$meta.id" + tag "${meta.id}" label 'process_high' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: tuple val(meta), path(panel) - path (domains) - path (exons) - path (custom) + path domains + path exons + path custom output: - tuple val(meta), path("*with_hotspots.tsv") , emit: panel_increased - tuple val(meta), path("hotspot_names.json") , emit: new_regions_json - path "versions.yml" , topic: versions - + tuple val(meta), path("*with_hotspots.tsv"), emit: panel_increased + tuple val(meta), path("hotspot_names.json"), emit: new_regions_json + path "versions.yml", topic: versions script: // def expansion = task.ext.expansion ?: 0 diff --git a/modules/local/filterbed/main.nf b/modules/local/filterbed/main.nf index d455eb0d..adbef8b3 100644 --- a/modules/local/filterbed/main.nf +++ b/modules/local/filterbed/main.nf @@ -1,18 +1,17 @@ process FILTERBED { - tag "$meta.id" + tag "${meta.id}" label 'process_high' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(maf) - tuple val(meta2) , path(bedfile) + tuple val(meta), path(maf) + tuple val(meta2), path(bedfile) output: - tuple val(meta), path("*.tsv.gz") , emit: maf - path "versions.yml" , topic: versions - + tuple val(meta), path("*.tsv.gz"), emit: maf + path "versions.yml", topic: versions script: def filtername = task.ext.filtername ?: "covered" diff --git a/modules/local/filtermaf/main.nf b/modules/local/filtermaf/main.nf index b5078f4b..fc04aea7 100644 --- a/modules/local/filtermaf/main.nf +++ b/modules/local/filtermaf/main.nf @@ -1,5 +1,5 @@ process FILTER_BATCH { - tag "$meta.id" + tag "${meta.id}" label 'process_high_memory' label 'time_low' @@ -10,9 +10,8 @@ process FILTER_BATCH { tuple val(meta), path(maf) output: - tuple val(meta), path("*.cohort.filtered.tsv.gz") , emit: cohort_maf - path "versions.yml" , topic: versions - + tuple val(meta), path("*.cohort.filtered.tsv.gz"), emit: cohort_maf + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/group_genes/main.nf b/modules/local/group_genes/main.nf index 3632b41f..eedffd11 100644 --- a/modules/local/group_genes/main.nf +++ b/modules/local/group_genes/main.nf @@ -6,14 +6,13 @@ process GROUP_GENES { input: tuple val(meta), path(mutations_table) - path (features_table) + path features_table tuple val(meta2), path(hotspots_file) output: - path("genes2group_out.json") , emit: json_genes - path("pathway_groups_out.json") , optional : true , emit: json_pathways - path "versions.yml" , topic: versions - + path ("genes2group_out.json"), emit: json_genes + path ("pathway_groups_out.json"), optional: true, emit: json_pathways + path "versions.yml", topic: versions script: def separator = task.ext.separator ?: "tab" @@ -40,4 +39,3 @@ process GROUP_GENES { END_VERSIONS """ } - // features_1table2groups.py ${features_table} ${separator} features_table_information.json diff --git a/modules/local/indels/main.nf b/modules/local/indels/main.nf index edc8df58..da6ab25c 100644 --- a/modules/local/indels/main.nf +++ b/modules/local/indels/main.nf @@ -1,5 +1,5 @@ process INDELS_COMPARISON { - tag "$meta.id" + tag "${meta.id}" label 'process_single' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -8,9 +8,8 @@ process INDELS_COMPARISON { tuple val(meta), path(mutations) output: - tuple val(meta), path("*.indels.tsv") , emit: indels - path "versions.yml" , topic: versions - + tuple val(meta), path("*.indels.tsv"), emit: indels + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -37,5 +36,4 @@ process INDELS_COMPARISON { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - } diff --git a/modules/local/mergemafs/main.nf b/modules/local/mergemafs/main.nf index 3d843c75..7d2d8a39 100644 --- a/modules/local/mergemafs/main.nf +++ b/modules/local/mergemafs/main.nf @@ -1,5 +1,5 @@ process MERGE_BATCH { - tag "$meta.id" + tag "${meta.id}" label 'process_high_memory' label 'time_low' @@ -10,9 +10,8 @@ process MERGE_BATCH { tuple val(meta), path(mafs) output: - tuple val(meta), path("*.cohort.tsv.gz") , emit: cohort_maf - path "versions.yml" , topic: versions - + tuple val(meta), path("*.cohort.tsv.gz"), emit: cohort_maf + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/mut_density/main.nf b/modules/local/mut_density/main.nf index 2ca8c8fc..f83eaee8 100644 --- a/modules/local/mut_density/main.nf +++ b/modules/local/mut_density/main.nf @@ -1,6 +1,6 @@ process MUTATION_DENSITY { - tag "$meta.id" + tag "${meta.id}" label 'process_high' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -8,14 +8,13 @@ process MUTATION_DENSITY { input: tuple val(meta), path(somatic_mutations_file), path(depths_file), path(mutability_file) tuple val(meta2), path(panel_file) - path(trinucleotide_counts_file) - + path trinucleotide_counts_file output: - tuple val(meta), path("*.mutdensities.tsv") , emit: mutdensities - tuple val(meta), path("*.mutdensities_flat.tsv") , emit: mutdensities_flat - path("*.logfoldchangeplot.pdf") , emit: mutdensities_plots - path "versions.yml" , topic: versions + tuple val(meta), path("*.mutdensities.tsv"), emit: mutdensities + tuple val(meta), path("*.mutdensities_flat.tsv"), emit: mutdensities_flat + path ("*.logfoldchangeplot.pdf"), emit: mutdensities_plots + path "versions.yml", topic: versions script: def sample_name = "${meta.id}" @@ -45,4 +44,4 @@ process MUTATION_DENSITY { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/local/mutated_cells_expected/main.nf b/modules/local/mutated_cells_expected/main.nf index e9f5ad93..fefd8100 100644 --- a/modules/local/mutated_cells_expected/main.nf +++ b/modules/local/mutated_cells_expected/main.nf @@ -1,5 +1,5 @@ process EXPECTED_MUTATED_CELLS { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/axelrosendahlhuber/expected_mutrate:latest' @@ -10,20 +10,18 @@ process EXPECTED_MUTATED_CELLS { tuple val(meta3), path(depths) tuple val(meta4), path(annotated_panel) tuple val(meta5), path(annotated_bed_file) - path (features_table) - + path features_table output: - tuple val(meta), path("**.png") , emit: plots - tuple val(meta), path("**.tsv") , emit: stats - tuple val(meta), path("**.rds") , emit: rds_file - tuple val(meta), path("**.rda") , emit: rda_file - - path "versions.yml" , topic: versions + tuple val(meta), path("**.png"), emit: plots + tuple val(meta), path("**.tsv"), emit: stats + tuple val(meta), path("**.rds"), emit: rds_file + tuple val(meta), path("**.rda"), emit: rda_file + path "versions.yml", topic: versions script: - def metadata_file = task.ext.metadata_file ? "${features_table}": "" + def metadata_file = task.ext.metadata_file ? "${features_table}" : "" """ mkdir expected_mutdensity mutgenomes_expected_mutrisk.R \\ diff --git a/modules/local/mutated_cells_from_vaf/main.nf b/modules/local/mutated_cells_from_vaf/main.nf index d24bd31c..73c1c481 100644 --- a/modules/local/mutated_cells_from_vaf/main.nf +++ b/modules/local/mutated_cells_from_vaf/main.nf @@ -1,18 +1,17 @@ process MUTATED_CELLS_FROM_VAF { - tag "$meta.id" + tag "${meta.id}" label 'process_single' label 'memory_medium' container 'docker.io/ferranmuinos/test_mutated_genomes' input: - tuple val(meta), path (mutated_genomes_results) - path (clinical_features) + tuple val(meta), path(mutated_genomes_results) + path clinical_features output: - tuple val(meta), path("*.tsv") , emit: mutated_cells_sample - path "versions.yml" , topic: versions - + tuple val(meta), path("*.tsv"), emit: mutated_cells_sample + path "versions.yml", topic: versions script: """ @@ -35,5 +34,4 @@ process MUTATED_CELLS_FROM_VAF { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - -} \ No newline at end of file +} diff --git a/modules/local/mutated_genomes_from_vaf/main.nf b/modules/local/mutated_genomes_from_vaf/main.nf index c9dbfee0..0dfc829b 100644 --- a/modules/local/mutated_genomes_from_vaf/main.nf +++ b/modules/local/mutated_genomes_from_vaf/main.nf @@ -1,17 +1,16 @@ process MUTATED_GENOMES_FROM_VAF { - tag "$meta.id" + tag "${meta.id}" label 'process_single' label 'memory_medium' container 'docker.io/ferranmuinos/test_mutated_genomes' input: - tuple val(meta) , path(mutations), path(omegas) + tuple val(meta), path(mutations), path(omegas) output: - tuple val(meta), path("*.covered_genomes_summary.tsv") , emit: mutated_gen_sample - path "versions.yml" , topic: versions - + tuple val(meta), path("*.covered_genomes_summary.tsv"), emit: mutated_gen_sample + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -40,5 +39,4 @@ process MUTATED_GENOMES_FROM_VAF { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - } diff --git a/modules/local/mutation_matrix/main.nf b/modules/local/mutation_matrix/main.nf index 326a13fc..e7e04097 100644 --- a/modules/local/mutation_matrix/main.nf +++ b/modules/local/mutation_matrix/main.nf @@ -1,6 +1,6 @@ process COMPUTE_MATRIX { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -9,12 +9,11 @@ process COMPUTE_MATRIX { tuple val(meta), path(mut_files) output: - tuple val(meta), path("*.matrix.tsv") , emit: matrix - tuple val(meta), path("*.single.sigprofiler") , optional:true, emit: single_sigprof - tuple val(meta), path("*.per_sample") , optional:true, emit: per_sample - tuple val(meta), path("*.per_sample.sigprofiler") , optional:true, emit: per_sample_sigprof - path "versions.yml" , topic: versions - + tuple val(meta), path("*.matrix.tsv"), emit: matrix + tuple val(meta), path("*.single.sigprofiler"), optional: true, emit: single_sigprof + tuple val(meta), path("*.per_sample"), optional: true, emit: per_sample + tuple val(meta), path("*.per_sample.sigprofiler"), optional: true, emit: per_sample_sigprof + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" diff --git a/modules/local/mutations2sbs/main.nf b/modules/local/mutations2sbs/main.nf index 9ce55dbf..c322a2d9 100644 --- a/modules/local/mutations2sbs/main.nf +++ b/modules/local/mutations2sbs/main.nf @@ -5,14 +5,12 @@ process MUTATIONS_2_SIGNATURES { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" - input: - tuple val(meta), path (maf), path (signature_probabilities) + tuple val(meta), path(maf), path(signature_probabilities) output: - tuple val(meta), path ("*.sigs.annotated.tsv.gz") , emit: mafs_sigs_info - path "versions.yml" , topic: versions - + tuple val(meta), path("*.sigs.annotated.tsv.gz"), emit: mafs_sigs_info + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/plot/depths_summary/main.nf b/modules/local/plot/depths_summary/main.nf index fa66f624..0fec367e 100644 --- a/modules/local/plot/depths_summary/main.nf +++ b/modules/local/plot/depths_summary/main.nf @@ -1,6 +1,6 @@ process PLOT_DEPTHS { - tag "$meta.id" + tag "${meta.id}" label 'process_single' label 'time_low' label 'process_high_memory' @@ -8,16 +8,14 @@ process PLOT_DEPTHS { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(depth) + tuple val(meta), path(depth) tuple val(meta2), path(panel) output: - tuple val(meta), path("*.pdf") , emit: plots - tuple val(meta), path("*.avgdepth_per_sample.tsv") , emit: average_per_sample - tuple val(meta), path("*depth*.tsv") , emit: depths - path "versions.yml" , topic: versions - - + tuple val(meta), path("*.pdf"), emit: plots + tuple val(meta), path("*.avgdepth_per_sample.tsv"), emit: average_per_sample + tuple val(meta), path("*depth*.tsv"), emit: depths + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -49,5 +47,4 @@ process PLOT_DEPTHS { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - } diff --git a/modules/local/plot/mutations_summary/main.nf b/modules/local/plot/mutations_summary/main.nf index 58a4f240..32b6f6c7 100644 --- a/modules/local/plot/mutations_summary/main.nf +++ b/modules/local/plot/mutations_summary/main.nf @@ -1,6 +1,6 @@ process PLOT_MUTATIONS { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -9,9 +9,8 @@ process PLOT_MUTATIONS { tuple val(meta), path(mut_files) output: - tuple val(meta), path("*.pdf") , emit: plots - path "versions.yml" , topic: versions - + tuple val(meta), path("*.pdf"), emit: plots + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" diff --git a/modules/local/plot/needles/main.nf b/modules/local/plot/needles/main.nf index 33e9d65b..2b25ba67 100644 --- a/modules/local/plot/needles/main.nf +++ b/modules/local/plot/needles/main.nf @@ -1,18 +1,17 @@ process PLOT_NEEDLES { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: tuple val(meta), path(mut_files) - path (gene_data_df) + path gene_data_df output: - tuple val(meta), path("**.pdf") , emit: plots, optional : true - path "versions.yml" , topic: versions - + tuple val(meta), path("**.pdf"), emit: plots, optional: true + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -45,16 +44,3 @@ process PLOT_NEEDLES { END_VERSIONS """ } - - -// cat > mutations_subset.conf << EOF -// { -// ${filters} -// } -// EOF - -// cat > requested_plots.conf << EOF -// { -// ${requested_plots} -// } -// EOF diff --git a/modules/local/plot/omega/main.nf b/modules/local/plot/omega/main.nf index 234bb607..77ba50b5 100644 --- a/modules/local/plot/omega/main.nf +++ b/modules/local/plot/omega/main.nf @@ -1,6 +1,6 @@ process PLOT_OMEGA { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -9,9 +9,8 @@ process PLOT_OMEGA { tuple val(meta), path(mutations), path(omegas) output: - tuple val(meta), path("**.pdf") , optional: true , emit: plots - path "versions.yml" , topic: versions - + tuple val(meta), path("**.pdf"), optional: true, emit: plots + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/plot/saturation/main.nf b/modules/local/plot/saturation/main.nf index ec142f2e..2287df9c 100644 --- a/modules/local/plot/saturation/main.nf +++ b/modules/local/plot/saturation/main.nf @@ -1,24 +1,23 @@ process PLOT_SATURATION { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(results_files) + tuple val(meta), path(results_files) tuple val(meta2), path(all_samples_indv_depths) tuple val(meta3), path(site_selection_files) tuple val(meta4), path(panel_file) - path (gene_data_df) - path (pdb_df) - path (domains_df) - tuple val(meta5), path (exons_depths_df) + path gene_data_df + path pdb_df + path domains_df + tuple val(meta5), path(exons_depths_df) output: - tuple val(meta), path("**.png") , emit: plots - path "versions.yml" , topic: versions - + tuple val(meta), path("**.png"), emit: plots + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/plot/selection_metrics/main.nf b/modules/local/plot/selection_metrics/main.nf index c3c67135..3dc26f14 100644 --- a/modules/local/plot/selection_metrics/main.nf +++ b/modules/local/plot/selection_metrics/main.nf @@ -1,18 +1,17 @@ process PLOT_SELECTION_METRICS { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: tuple val(meta), path(results_files) - path (gene_data_df) + path gene_data_df output: - tuple val(meta), path("**.pdf"), optional : true , emit: plots - path "versions.yml" , topic: versions - + tuple val(meta), path("**.pdf"), optional: true, emit: plots + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -41,16 +40,3 @@ process PLOT_SELECTION_METRICS { END_VERSIONS """ } - - -// cat > mutations_subset.conf << EOF -// { -// ${filters} -// } -// EOF - -// cat > requested_plots.conf << EOF -// { -// ${requested_plots} -// } -// EOF diff --git a/modules/local/process_annotation/domain/main.nf b/modules/local/process_annotation/domain/main.nf index 602e54da..1d6c3ffb 100644 --- a/modules/local/process_annotation/domain/main.nf +++ b/modules/local/process_annotation/domain/main.nf @@ -9,14 +9,13 @@ process DOMAIN_ANNOTATION { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(panel_annotated) - path (domains_file) + tuple val(meta), path(panel_annotated) + path domains_file output: - path("*.domains.bed4.bed") , emit: domains_bed - path("domains_info.tsv") , emit: domains_tsv - path "versions.yml" , topic: versions - + path ("*.domains.bed4.bed"), emit: domains_bed + path ("domains_info.tsv"), emit: domains_tsv + path "versions.yml", topic: versions script: """ diff --git a/modules/local/process_annotation/mutations/main.nf b/modules/local/process_annotation/mutations/main.nf index 02ca1677..9bfb5ad5 100644 --- a/modules/local/process_annotation/mutations/main.nf +++ b/modules/local/process_annotation/mutations/main.nf @@ -1,5 +1,5 @@ process SUMMARIZE_ANNOTATION { - tag "$meta.id" + tag "${meta.id}" label 'cpu_low' label 'process_high_memory' @@ -8,14 +8,13 @@ process SUMMARIZE_ANNOTATION { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(tab_files) - path(hotspots_annotation_file) + tuple val(meta), path(tab_files) + path hotspots_annotation_file output: - tuple val(meta), path("*.summary.tab.gz") , emit: tab - tuple val(meta), path("*.vep.tab.gz") , emit: tab_all - path "versions.yml" , topic: versions - + tuple val(meta), path("*.summary.tab.gz"), emit: tab + tuple val(meta), path("*.vep.tab.gz"), emit: tab_all + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/process_annotation/mutations_custom/main.nf b/modules/local/process_annotation/mutations_custom/main.nf index d460227e..7267ff23 100644 --- a/modules/local/process_annotation/mutations_custom/main.nf +++ b/modules/local/process_annotation/mutations_custom/main.nf @@ -1,5 +1,5 @@ process CUSTOM_MUTATION_PROCESSING { - tag "$meta.id" + tag "${meta.id}" label 'cpu_low' label 'process_high_memory' @@ -8,13 +8,12 @@ process CUSTOM_MUTATION_PROCESSING { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(mutations_annotated) + tuple val(meta), path(mutations_annotated) tuple val(meta2), path(custom_regions) output: - tuple val(meta), path("*.custom.tsv") , emit: mutations - path "versions.yml" , topic: versions - + tuple val(meta), path("*.custom.tsv"), emit: mutations + path "versions.yml", topic: versions script: // TODO reimplement python script with click diff --git a/modules/local/process_annotation/panel/main.nf b/modules/local/process_annotation/panel/main.nf index 01fad65e..2af7a343 100644 --- a/modules/local/process_annotation/panel/main.nf +++ b/modules/local/process_annotation/panel/main.nf @@ -8,15 +8,13 @@ process POSTPROCESS_VEP_ANNOTATION { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" - input: - tuple val(meta) , path(vep_annotated_file) + tuple val(meta), path(vep_annotated_file) output: - tuple val(meta), path("*.compact.tsv") , emit: compact_panel_annotation - tuple val(meta), path("*.compact_rich.tsv") , emit: rich_panel_annotation - path "versions.yml" , topic: versions - + tuple val(meta), path("*.compact.tsv"), emit: compact_panel_annotation + tuple val(meta), path("*.compact_rich.tsv"), emit: rich_panel_annotation + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/process_annotation/panelcustom/main.nf b/modules/local/process_annotation/panelcustom/main.nf index fd024722..5896f95e 100644 --- a/modules/local/process_annotation/panelcustom/main.nf +++ b/modules/local/process_annotation/panelcustom/main.nf @@ -9,15 +9,13 @@ process CUSTOM_ANNOTATION_PROCESSING { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(panel_annotated) - path (custom_regions) - + tuple val(meta), path(panel_annotated) + path custom_regions output: - tuple val(meta), path("*.custom.tsv") , emit: custom_panel_annotation - tuple val(meta), path("added_regions.tsv") , emit: added_regions - path "versions.yml" , topic: versions - + tuple val(meta), path("*.custom.tsv"), emit: custom_panel_annotation + tuple val(meta), path("added_regions.tsv"), emit: added_regions + path "versions.yml", topic: versions script: def simple = task.ext.simple ? "True" : "False" diff --git a/modules/local/runregressions/main.nf b/modules/local/runregressions/main.nf index 2cb7aba9..ef59c6d8 100644 --- a/modules/local/runregressions/main.nf +++ b/modules/local/runregressions/main.nf @@ -6,23 +6,23 @@ process RUNREGRESSIONS { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - val (metric_name) - path (metric_data) - val (metric_params) + val metric_name + path metric_data + val metric_params - val (responses_subset_regressions) - val (responses_excluded_regressions) - val (samples_subset_regressions) - path (predictors_file_regressions) - val (predictors_plot_config_regressions) - val (multipletesting_join_regressions) - val (multivariate_rules_regressions) + val responses_subset_regressions + val responses_excluded_regressions + val samples_subset_regressions + path predictors_file_regressions + val predictors_plot_config_regressions + val multipletesting_join_regressions + val multivariate_rules_regressions output: - path ("inputs/*") , emit: regression_inputs - path (metric_name) , emit: res_tables - path ("*.pdf") , emit: res_pdf - path "versions.yml" , topic: versions + path ("inputs/*"), emit: regression_inputs + path (metric_name), emit: res_tables + path ("*.pdf"), emit: res_pdf + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" @@ -61,5 +61,4 @@ process RUNREGRESSIONS { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - } diff --git a/modules/local/samplesheet_check.nf b/modules/local/samplesheet_check.nf index 384591b6..94a55e1e 100644 --- a/modules/local/samplesheet_check.nf +++ b/modules/local/samplesheet_check.nf @@ -1,24 +1,24 @@ process SAMPLESHEET_CHECK { - tag "$samplesheet" + tag "${samplesheet}" label 'process_single' conda "conda-forge::python=3.8.3" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/python:3.8.3' : - 'biocontainers/python:3.8.3' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/python:3.8.3' + : 'biocontainers/python:3.8.3'}" input: path samplesheet output: - path '*.csv' , emit: csv + path '*.csv', emit: csv path "versions.yml", topic: versions - - script: // This script is bundled with the pipeline, in bbglab/deepCSA/bin/ + script: + // This script is bundled with the pipeline, in bbglab/deepCSA/bin/ """ check_samplesheet.py \\ - $samplesheet \\ + ${samplesheet} \\ samplesheet.valid.csv cat <<-END_VERSIONS > versions.yml diff --git a/modules/local/select_mutdensity/main.nf b/modules/local/select_mutdensity/main.nf index 07734b0e..20ec3b06 100644 --- a/modules/local/select_mutdensity/main.nf +++ b/modules/local/select_mutdensity/main.nf @@ -1,5 +1,5 @@ process SELECT_MUTDENSITIES { - tag "$meta.id" + tag "${meta.id}" label 'process_single' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -8,10 +8,8 @@ process SELECT_MUTDENSITIES { tuple val(meta), path(mutation_densities) output: - tuple val(meta), path("*.gene_mutdensities.tsv") , emit: mutdensity - path "versions.yml" , topic: versions - - + tuple val(meta), path("*.gene_mutdensities.tsv"), emit: mutdensity + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -39,5 +37,4 @@ process SELECT_MUTDENSITIES { python: \$(python --version | sed 's/Python //g') END_VERSIONS """ - } diff --git a/modules/local/sig_matrix_concat/main.nf b/modules/local/sig_matrix_concat/main.nf index 3dba3b47..3c808a39 100644 --- a/modules/local/sig_matrix_concat/main.nf +++ b/modules/local/sig_matrix_concat/main.nf @@ -1,22 +1,22 @@ process MATRIX_CONCAT { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: tuple val(meta), path(matrix_files) - path (json_samples) + path json_samples output: - path("*_matrix*.sp.tsv") , emit: wgs_tsv - path("*_matrix*.hdp.tsv") , emit: wgs_tsv_hdp - path("*_matrix*.sp.round.tsv") , emit: wgs_round_tsv - path "versions.yml" , topic: versions - + path ("*_matrix*.sp.tsv"), emit: wgs_tsv + path ("*_matrix*.hdp.tsv"), emit: wgs_tsv_hdp + path ("*_matrix*.sp.round.tsv"), emit: wgs_round_tsv + path "versions.yml", topic: versions script: - def prefix = task.ext.prefix ?: "" // type of profile. e.g. all, nonproteinaffecting, ... + def prefix = task.ext.prefix ?: "" + // type of profile. e.g. all, nonproteinaffecting, ... """ ls ${matrix_files} > all_files.txt; concat_sigprot_matrices.py \\ diff --git a/modules/local/signatures/hdp/chainsampling/main.nf b/modules/local/signatures/hdp/chainsampling/main.nf index 93fffc78..c3b4d2fd 100644 --- a/modules/local/signatures/hdp/chainsampling/main.nf +++ b/modules/local/signatures/hdp/chainsampling/main.nf @@ -1,26 +1,24 @@ process RUN_HDP_CHAIN_SAMPLING { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/ferriolcalvet/hdp_stefano:0.1.0' - input: tuple val(meta), path(count_matrix), path(tree_layers), val(iter) output: tuple val(meta), path("iteration_dir/*"), emit: iteration_results - path "versions.yml" , topic: versions - + path "versions.yml", topic: versions script: def args = task.ext.args ?: '' """ mkdir iteration_dir Rscript /app/HDP_sigExtraction/R/run_HDP_chainSampling.R \\ - $count_matrix \\ + ${count_matrix} \\ iteration_dir \\ - $tree_layers \\ + ${tree_layers} \\ ${args} \\ ${iter} cat <<-END_VERSIONS > versions.yml @@ -45,4 +43,3 @@ process RUN_HDP_CHAIN_SAMPLING { END_VERSIONS """ } - diff --git a/modules/local/signatures/hdp/compare_sigs/main.nf b/modules/local/signatures/hdp/compare_sigs/main.nf index 466b43e2..e3a07215 100644 --- a/modules/local/signatures/hdp/compare_sigs/main.nf +++ b/modules/local/signatures/hdp/compare_sigs/main.nf @@ -1,18 +1,16 @@ - process COMPARE_SIGNATURES { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/ferriolcalvet/hdp_stefano:0.1.0' input: tuple val(meta), path(output_dir) - path (reference_signatures) + path reference_signatures output: - tuple val(meta), path("*.compared_output_dir/**") , emit: compared_results - path "versions.yml" , topic: versions - + tuple val(meta), path("*.compared_output_dir/**"), emit: compared_results + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" @@ -48,71 +46,4 @@ process COMPARE_SIGNATURES { HDP : original END_VERSIONS """ - } - - -// process COMPARE_NORMALIZED_SIGNATURES { -// input: -// tuple val(meta), path(normalized_output_dir) - -// output: -// tuple val(meta), path("compared_normalized_output_dir"), emit: compared_normalized_results - - -// script: -// """ -// Rscript run_HDP_comparing.R \\ -// $normalized_output_dir \\ -// ${params.cosine_sim_threshold} \\ -// ${params.max_iter_em} \\ -// ${params.em_frac_threshold} \\ -// ${params.ref_file} \\ -// "NA" \\ -// "TRUE" -// cp -r $normalized_output_dir compared_normalized_output_dir -// """ -// } - -// process COMPARE_SIGNATURES { -// input: -// tuple val(meta), path(output_dir) - -// output: -// tuple val(meta), path("compared_output_dir"), emit: compared_results - -// script: -// """ -// Rscript run_HDP_comparing.R \\ -// $output_dir \\ -// ${params.cosine_sim_threshold} \\ -// ${params.max_iter_em} \\ -// ${params.em_frac_threshold} \\ -// ${params.ref_file} \\ -// "NA" \\ -// "FALSE" -// cp -r $output_dir compared_output_dir -// """ -// } - -// process COMPARE_CANCER_SIGNATURES { -// input: -// tuple val(meta), path(compared_output_dir) - -// output: -// tuple val(meta), path("final_output_dir"), emit: final_results - -// script: -// """ -// cancer_sigs_file="" # You might want to parameterize this -// Rscript run_HDP_comparing.R \\ -// $compared_output_dir \\ -// ${params.cosine_sim_threshold} \\ -// ${params.max_iter_em} \\ -// ${params.em_frac_threshold} \\ -// ${params.ref_file} \\ -// \$cancer_sigs_file \\ -// "FALSE" -// cp -r $compared_output_dir final_output_dir -// """ -// } diff --git a/modules/local/signatures/hdp/normalize_sigs/main.nf b/modules/local/signatures/hdp/normalize_sigs/main.nf index 605a211f..842dd464 100644 --- a/modules/local/signatures/hdp/normalize_sigs/main.nf +++ b/modules/local/signatures/hdp/normalize_sigs/main.nf @@ -1,25 +1,22 @@ - process NORMALIZE_SIGNATURES { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/ferriolcalvet/hdp_stefano:0.1.0' - input: tuple val(meta), path(output_dir) output: tuple val(meta), path("normalized_output_dir"), emit: normalized_results - path "versions.yml" , topic: versions - + path "versions.yml", topic: versions script: """ Rscript run_HDP_sigNormalising.R \\ - $output_dir \\ + ${output_dir} \\ ${params.norm_file} - cp -r $output_dir normalized_output_dir + cp -r ${output_dir} normalized_output_dir cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -42,7 +39,4 @@ process NORMALIZE_SIGNATURES { HDP : original END_VERSIONS """ - } - - diff --git a/modules/local/signatures/hdp/prepareinput/main.nf b/modules/local/signatures/hdp/prepareinput/main.nf index 27e562ee..e2c69a57 100644 --- a/modules/local/signatures/hdp/prepareinput/main.nf +++ b/modules/local/signatures/hdp/prepareinput/main.nf @@ -1,19 +1,17 @@ - process PREPARE_INPUT { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/ferriolcalvet/hdp_stefano:0.1.0' input: - tuple val(meta) , val(type), path(matrix) + tuple val(meta), val(type), path(matrix) output: - tuple val(meta), path("*.hdp.rds"), path("*.hdp.treelayer.rds") , emit: input_data - tuple val(meta), path("*.csv") , emit: csv_matrices - path "versions.yml" , topic: versions - + tuple val(meta), path("*.hdp.rds"), path("*.hdp.treelayer.rds"), emit: input_data + tuple val(meta), path("*.csv"), emit: csv_matrices + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" @@ -69,5 +67,4 @@ process PREPARE_INPUT { HDP : original END_VERSIONS """ - } diff --git a/modules/local/signatures/hdp/process_results/main.nf b/modules/local/signatures/hdp/process_results/main.nf index 51043366..7851282d 100644 --- a/modules/local/signatures/hdp/process_results/main.nf +++ b/modules/local/signatures/hdp/process_results/main.nf @@ -1,17 +1,16 @@ -process PROCESS_HDP_RESULTS { - tag "$meta.id" +process PROCESS_HDP_RESULTS { + tag "${meta.id}" label 'process_medium' container 'docker.io/ferriolcalvet/hdp_stefano:0.1.0' input: tuple val(meta), path(count_matrix), path(tree_layers) - tuple val(meta2), path (iteration_dir) + tuple val(meta2), path(iteration_dir) output: tuple val(meta), path("output_dir"), emit: processed_results - path "versions.yml" , topic: versions - + path "versions.yml", topic: versions script: def args = task.ext.args ?: '' @@ -19,9 +18,9 @@ process PROCESS_HDP_RESULTS { mkdir -p output_dir/iterations/ mv hdp_chains_*.RData output_dir/iterations/. Rscript /app/HDP_sigExtraction/R/run_HDP_processing.R \\ - $count_matrix \\ + ${count_matrix} \\ output_dir/ \\ - $tree_layers \\ + ${tree_layers} \\ ${args} cat <<-END_VERSIONS > versions.yml @@ -46,4 +45,3 @@ process PROCESS_HDP_RESULTS { END_VERSIONS """ } - diff --git a/modules/local/signatures/msighdp/main.nf b/modules/local/signatures/msighdp/main.nf index 53e1711a..99ef1f35 100644 --- a/modules/local/signatures/msighdp/main.nf +++ b/modules/local/signatures/msighdp/main.nf @@ -1,5 +1,5 @@ process MSIGHDP { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/ferriolcalvet/msighdp:latest' @@ -8,10 +8,9 @@ process MSIGHDP { tuple val(meta), path(matrix) output: - tuple val(meta), path("**.pdf") , emit: plots - tuple val(meta), path("**.csv") , emit: stats - path "versions.yml" , topic: versions - + tuple val(meta), path("**.pdf"), emit: plots + tuple val(meta), path("**.csv"), emit: stats + path "versions.yml", topic: versions script: def prefix = task.ext.prefix ?: "" diff --git a/modules/local/signatures/sigprofiler/assignment/main.nf b/modules/local/signatures/sigprofiler/assignment/main.nf index fd2236c0..20476ea7 100644 --- a/modules/local/signatures/sigprofiler/assignment/main.nf +++ b/modules/local/signatures/sigprofiler/assignment/main.nf @@ -1,19 +1,18 @@ process SIGPROFILERASSIGNMENT { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' container 'docker.io/ferriolcalvet/sigprofilerassignment' input: tuple val(meta), val(type), path(matrix) - path(reference_signatures) + path reference_signatures output: - tuple val(meta), path("**.pdf") , emit: plots - tuple val(meta), path("**.txt") , emit: stats - tuple val(meta), path("**Decomposed_MutationType_Probabilities.*.txt") , emit: mutation_probs - path "versions.yml" , topic: versions - + tuple val(meta), path("**.pdf"), emit: plots + tuple val(meta), path("**.txt"), emit: stats + tuple val(meta), path("**Decomposed_MutationType_Probabilities.*.txt"), emit: mutation_probs + path "versions.yml", topic: versions script: def name = "${meta.id}.${type}" diff --git a/modules/local/sitesfrompositions/main.nf b/modules/local/sitesfrompositions/main.nf index 755b528a..05c31a28 100644 --- a/modules/local/sitesfrompositions/main.nf +++ b/modules/local/sitesfrompositions/main.nf @@ -8,14 +8,12 @@ process SITESFROMPOSITIONS { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" - input: tuple val(meta), path(depths) output: - tuple val(meta), path("*.sites4VEP.tsv") , emit: annotated_panel_reg - path "versions.yml" , topic: versions - + tuple val(meta), path("*.sites4VEP.tsv"), emit: annotated_panel_reg + path "versions.yml", topic: versions script: def assembly = task.ext.assembly ?: "hg38" diff --git a/modules/local/subsetmaf/main.nf b/modules/local/subsetmaf/main.nf index d903669f..16024d2c 100644 --- a/modules/local/subsetmaf/main.nf +++ b/modules/local/subsetmaf/main.nf @@ -1,6 +1,6 @@ process SUBSET_MAF { - tag "$meta.id" + tag "${meta.id}" label 'process_low' container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" @@ -9,9 +9,8 @@ process SUBSET_MAF { tuple val(meta), path(mut_files) output: - tuple val(meta), path("*.mutations.tsv") , emit: mutations - path "versions.yml" , topic: versions - + tuple val(meta), path("*.mutations.tsv"), emit: mutations + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" diff --git a/modules/local/table2groups/main.nf b/modules/local/table2groups/main.nf index 6cbcef2b..ac8be905 100644 --- a/modules/local/table2groups/main.nf +++ b/modules/local/table2groups/main.nf @@ -6,14 +6,13 @@ process TABLE_2_GROUP { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - path(features_table) + path features_table output: - path("samples.json") , emit: json_samples - path("groups.json") , optional : true , emit: json_groups - path("all_groups.json") , emit: json_allgroups - path "versions.yml" , topic: versions - + path ("samples.json"), emit: json_samples + path ("groups.json"), optional: true, emit: json_groups + path ("all_groups.json"), emit: json_allgroups + path "versions.yml", topic: versions script: def separator = task.ext.separator ?: "comma" diff --git a/modules/local/vcf2maf/main.nf b/modules/local/vcf2maf/main.nf index c9996ae9..9dfa1d8f 100644 --- a/modules/local/vcf2maf/main.nf +++ b/modules/local/vcf2maf/main.nf @@ -1,5 +1,5 @@ process VCF2MAF { - tag "$meta.id" + tag "${meta.id}" label 'cpu_low' label 'process_high_memory' @@ -7,13 +7,12 @@ process VCF2MAF { container "docker.io/bbglab/deepcsa-core:0.0.1-alpha" input: - tuple val(meta) , path(vcf) + tuple val(meta), path(vcf) tuple val(meta2), path(annotation) output: - tuple val(meta), path("*.tsv.gz") , emit: maf - path "versions.yml" , topic: versions - + tuple val(meta), path("*.tsv.gz"), emit: maf + path "versions.yml", topic: versions script: def args = task.ext.args ?: "" diff --git a/modules/local/writemaf/main.nf b/modules/local/writemaf/main.nf index b83636dd..4ae3ad36 100644 --- a/modules/local/writemaf/main.nf +++ b/modules/local/writemaf/main.nf @@ -7,12 +7,11 @@ process WRITE_MAFS { input: tuple val(meta), path(maf) - path (json_groups) + path json_groups output: - path("*.filtered.tsv.gz") , emit: mafs - path "versions.yml" , topic: versions - + path ("*.filtered.tsv.gz"), emit: mafs + path "versions.yml", topic: versions script: // TODO reimplement with click diff --git a/modules/nf-core/custom/dumpsoftwareversions/main.nf b/modules/nf-core/custom/dumpsoftwareversions/main.nf index 2984da18..c8f47f1b 100644 --- a/modules/nf-core/custom/dumpsoftwareversions/main.nf +++ b/modules/nf-core/custom/dumpsoftwareversions/main.nf @@ -3,19 +3,18 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container conda "bioconda::multiqc=1.18" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.18--pyhdfd78af_0' : - 'biocontainers/multiqc:1.18--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/multiqc:1.18--pyhdfd78af_0' + : 'biocontainers/multiqc:1.18--pyhdfd78af_0'}" input: path versions output: - path "software_versions.yml" , emit: yml + path "software_versions.yml", emit: yml path "software_versions_mqc.yml", emit: mqc_yml - path "versions.yml" , emit: versions - + path "versions.yml", emit: versions script: - template 'dumpsoftwareversions.py' -} \ No newline at end of file + template('dumpsoftwareversions.py') +} diff --git a/modules/nf-core/ensemblvep/vep/main.nf b/modules/nf-core/ensemblvep/vep/main.nf index ef7a2a1a..51a97fd3 100644 --- a/modules/nf-core/ensemblvep/vep/main.nf +++ b/modules/nf-core/ensemblvep/vep/main.nf @@ -1,60 +1,65 @@ process ENSEMBLVEP_VEP { - tag "$meta.id" + tag "${meta.id}" label 'process_high' - conda params.vep_cache_version == 108 ? 'bioconda::ensembl-vep=108.2' : - params.vep_cache_version == 102 ? 'bioconda::ensembl-vep=102.0' : - params.vep_cache_version == 111 ? 'bioconda::ensembl-vep=111.0' : - 'bioconda::ensembl-vep=111.0' + conda params.vep_cache_version == 108 + ? 'bioconda::ensembl-vep=108.2' + : params.vep_cache_version == 102 + ? 'bioconda::ensembl-vep=102.0' + : params.vep_cache_version == 111 + ? 'bioconda::ensembl-vep=111.0' + : 'bioconda::ensembl-vep=111.0' - container params.vep_cache_version == 108 ? "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:108.2--pl5321h4a94de4_0' : 'biocontainers/ensembl-vep:108.2--pl5321h4a94de4_0' }" : - params.vep_cache_version == 102 ? "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:102.0--pl526hecda079_0' : 'biocontainers/ensembl-vep:102.0--pl526hecda079_0' }" : - params.vep_cache_version == 111 ? "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:111.0--pl5321h2a3209d_0' : 'biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0' }" : - "biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0" + container params.vep_cache_version == 108 + ? "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:108.2--pl5321h4a94de4_0' : 'biocontainers/ensembl-vep:108.2--pl5321h4a94de4_0'}" + : params.vep_cache_version == 102 + ? "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:102.0--pl526hecda079_0' : 'biocontainers/ensembl-vep:102.0--pl526hecda079_0'}" + : params.vep_cache_version == 111 + ? "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:111.0--pl5321h2a3209d_0' : 'biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0'}" + : "biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0" input: tuple val(meta), path(vcf) - val genome - val species - val cache_version - path cache - path fasta - path extra_files + val genome + val species + val cache_version + path cache + path fasta + path extra_files output: - tuple val(meta), path("*.vcf.gz") , optional:true, emit: vcf - tuple val(meta), path("*.tab.gz") , optional:true, emit: tab - tuple val(meta), path("*.json.gz") , optional:true, emit: json - path "*.summary.html" , optional:true, emit: report - path "versions.yml" , topic: versions - + tuple val(meta), path("*.vcf.gz"), optional: true, emit: vcf + tuple val(meta), path("*.tab.gz"), optional: true, emit: tab + tuple val(meta), path("*.json.gz"), optional: true, emit: json + path "*.summary.html", optional: true, emit: report + path "versions.yml", topic: versions script: def args = task.ext.args ?: '' - def file_extension = args.contains("--vcf") ? 'vcf' : args.contains("--json")? 'json' : args.contains("--tab")? 'tab' : 'vcf' + def file_extension = args.contains("--vcf") ? 'vcf' : args.contains("--json") ? 'json' : args.contains("--tab") ? 'tab' : 'vcf' def compress_cmd = args.contains("--compress_output") ? '' : '--compress_output bgzip' def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" def dir_cache = cache ? "\${PWD}/${cache}" : "/.vep" - def reference = fasta ? "--fasta $fasta" : "" + def reference = fasta ? "--fasta ${fasta}" : "" """ # this is to ensure that we will be able to match the tab and vcf files afterwards # the structure of the ID is the following: # chr:pos_ref>alt - cat <(grep '#' $vcf) <(grep -v '#' $vcf | awk -F'\\t' '{OFS="\\t"; \$3=\$1":"\$2"_"\$4">"\$5; print}') > $vcf.4vep.vcf + cat <(grep '#' ${vcf}) <(grep -v '#' ${vcf} | awk -F'\\t' '{OFS="\\t"; \$3=\$1":"\$2"_"\$4">"\$5; print}') > ${vcf}.4vep.vcf vep \\ - -i $vcf.4vep.vcf \\ + -i ${vcf}.4vep.vcf \\ -o ${prefix}.${file_extension}.gz \\ - $args \\ - $compress_cmd \\ - $reference \\ - --assembly $genome \\ - --species $species \\ + ${args} \\ + ${compress_cmd} \\ + ${reference} \\ + --assembly ${genome} \\ + --species ${species} \\ --cache \\ - --cache_version $cache_version \\ - --dir_cache $dir_cache \\ + --cache_version ${cache_version} \\ + --dir_cache ${dir_cache} \\ --fork ${task.cpus} @@ -78,4 +83,4 @@ process ENSEMBLVEP_VEP { ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//') END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/nf-core/ensemblvep/veppanel/main.nf b/modules/nf-core/ensemblvep/veppanel/main.nf index 6ee8b5d1..3d94f594 100644 --- a/modules/nf-core/ensemblvep/veppanel/main.nf +++ b/modules/nf-core/ensemblvep/veppanel/main.nf @@ -1,46 +1,50 @@ // taken from deepUMIcaller process ENSEMBLVEP_VEP { - tag "$meta.id" + tag "${meta.id}" label 'process_high' label 'cpu_veryhigh' - conda params.vep_cache_version == 108 ? 'bioconda::ensembl-vep=108.2' : - params.vep_cache_version == 102 ? 'bioconda::ensembl-vep=102.0' : - params.vep_cache_version == 111 ? 'bioconda::ensembl-vep=111.0' : - 'bioconda::ensembl-vep=111.0' - - container params.vep_cache_version == 108 ? "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:108.2--pl5321h4a94de4_0' : 'biocontainers/ensembl-vep:108.2--pl5321h4a94de4_0' }" : - params.vep_cache_version == 102 ? "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:102.0--pl526hecda079_0' : 'biocontainers/ensembl-vep:102.0--pl526hecda079_0' }" : - params.vep_cache_version == 111 ? "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:111.0--pl5321h2a3209d_0' : 'biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0' }" : - "biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0" + conda params.vep_cache_version == 108 + ? 'bioconda::ensembl-vep=108.2' + : params.vep_cache_version == 102 + ? 'bioconda::ensembl-vep=102.0' + : params.vep_cache_version == 111 + ? 'bioconda::ensembl-vep=111.0' + : 'bioconda::ensembl-vep=111.0' + container params.vep_cache_version == 108 + ? "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:108.2--pl5321h4a94de4_0' : 'biocontainers/ensembl-vep:108.2--pl5321h4a94de4_0'}" + : params.vep_cache_version == 102 + ? "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:102.0--pl526hecda079_0' : 'biocontainers/ensembl-vep:102.0--pl526hecda079_0'}" + : params.vep_cache_version == 111 + ? "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ensembl-vep:111.0--pl5321h2a3209d_0' : 'biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0'}" + : "biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0" input: tuple val(meta), path(vcf) - val genome - val species - val cache_version - path cache - path fasta - path extra_files + val genome + val species + val cache_version + path cache + path fasta + path extra_files output: - tuple val(meta), path("*.vcf.gz") , optional:true, emit: vcf - tuple val(meta), path("*.tab.gz") , optional:true, emit: tab - tuple val(meta), path("*.json.gz") , optional:true, emit: json - path "*.summary.html" , optional:true, emit: report - path "versions.yml" , topic: versions - + tuple val(meta), path("*.vcf.gz"), optional: true, emit: vcf + tuple val(meta), path("*.tab.gz"), optional: true, emit: tab + tuple val(meta), path("*.json.gz"), optional: true, emit: json + path "*.summary.html", optional: true, emit: report + path "versions.yml", topic: versions script: def args = task.ext.args ?: '' - def file_extension = args.contains("--vcf") ? 'vcf' : args.contains("--json")? 'json' : args.contains("--tab")? 'tab' : 'vcf' + def file_extension = args.contains("--vcf") ? 'vcf' : args.contains("--json") ? 'json' : args.contains("--tab") ? 'tab' : 'vcf' def compress_cmd = args.contains("--compress_output") ? '' : '--compress_output bgzip' def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" def dir_cache = cache ? "\${PWD}/${cache}" : "/.vep" - def reference = fasta ? "--fasta $fasta" : "" + def reference = fasta ? "--fasta ${fasta}" : "" """ # this is to ensure that we will be able to match the tab and vcf files afterwards @@ -48,15 +52,15 @@ process ENSEMBLVEP_VEP { vep \\ -i ${vcf} \\ -o ${prefix}.${file_extension}.gz \\ - $args \\ - $compress_cmd \\ - $reference \\ - --assembly $genome \\ - --species $species \\ + ${args} \\ + ${compress_cmd} \\ + ${reference} \\ + --assembly ${genome} \\ + --species ${species} \\ --cache \\ - --cache_version $cache_version \\ - --dir_cache $dir_cache \\ - --fork $task.cpus + --cache_version ${cache_version} \\ + --dir_cache ${dir_cache} \\ + --fork ${task.cpus} cat <<-END_VERSIONS > versions.yml @@ -79,4 +83,4 @@ process ENSEMBLVEP_VEP { ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//') END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 783d1027..65e007a7 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -2,33 +2,32 @@ process MULTIQC { label 'process_single' conda "bioconda::multiqc=1.20" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.20--pyhdfd78af_0' : - 'biocontainers/multiqc:1.20--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/multiqc:1.20--pyhdfd78af_0' + : 'biocontainers/multiqc:1.20--pyhdfd78af_0'}" input: - path multiqc_files, stageAs: "?/*" - path(multiqc_config) - path(extra_multiqc_config) - path(multiqc_logo) + path multiqc_files, stageAs: "?/*" + path multiqc_config + path extra_multiqc_config + path multiqc_logo output: path "*multiqc_report.html", emit: report - path "*_data" , emit: data - path "*_plots" , optional:true, emit: plots - path "versions.yml" , emit: versions - + path "*_data", emit: data + path "*_plots", optional: true, emit: plots + path "versions.yml", emit: versions script: def args = task.ext.args ?: '' - def config = multiqc_config ? "--config $multiqc_config" : '' - def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' + def config = multiqc_config ? "--config ${multiqc_config}" : '' + def extra_config = extra_multiqc_config ? "--config ${extra_multiqc_config}" : '' """ multiqc \\ --force \\ - $args \\ - $config \\ - $extra_config \\ + ${args} \\ + ${config} \\ + ${extra_config} \\ . cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/tabix/bgziptabix/main.nf b/modules/nf-core/tabix/bgziptabix/main.nf index a6dd8446..f4d9f61b 100644 --- a/modules/nf-core/tabix/bgziptabix/main.nf +++ b/modules/nf-core/tabix/bgziptabix/main.nf @@ -1,13 +1,13 @@ process TABIX_BGZIPTABIX { cache false - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : - 'biocontainers/tabix:1.11--hdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' + : 'biocontainers/tabix:1.11--hdfd78af_0'}" input: tuple val(meta), path(input) @@ -15,8 +15,7 @@ process TABIX_BGZIPTABIX { output: tuple val(meta), path("*.gz"), path("*.tbi"), optional: true, emit: gz_tbi tuple val(meta), path("*.gz"), path("*.csi"), optional: true, emit: gz_csi - path "versions.yml" , topic: versions - + path "versions.yml", topic: versions script: def args = task.ext.args ?: '' @@ -24,8 +23,8 @@ process TABIX_BGZIPTABIX { def prefix = task.ext.prefix ?: "" prefix = "${meta.id}${prefix}" """ - bgzip --threads ${task.cpus} -c $args $input > ${prefix}.${input.getExtension()}.gz - tabix $args2 ${prefix}.${input.getExtension()}.gz + bgzip --threads ${task.cpus} -c ${args} ${input} > ${prefix}.${input.getExtension()}.gz + tabix ${args2} ${prefix}.${input.getExtension()}.gz cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -46,4 +45,4 @@ process TABIX_BGZIPTABIX { tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/nf-core/tabix/bgziptabixquery/main.nf b/modules/nf-core/tabix/bgziptabixquery/main.nf index 85bbc14b..a970dbee 100644 --- a/modules/nf-core/tabix/bgziptabixquery/main.nf +++ b/modules/nf-core/tabix/bgziptabixquery/main.nf @@ -1,23 +1,22 @@ process TABIX_BGZIPTABIX_QUERY { cache false - - tag "$meta.id" + + tag "${meta.id}" label 'process_high' label 'process_high_memory' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : - 'biocontainers/tabix:1.11--hdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' + : 'biocontainers/tabix:1.11--hdfd78af_0'}" input: - tuple val(meta) , path(input) - tuple val(meta2) , path(bedfile) + tuple val(meta), path(input) + tuple val(meta2), path(bedfile) output: - tuple val(meta), path("*.gz") , emit: subset - path "versions.yml" , topic: versions - + tuple val(meta), path("*.gz"), emit: subset + path "versions.yml", topic: versions script: def args = task.ext.args ?: '' @@ -78,4 +77,4 @@ process TABIX_BGZIPTABIX_QUERY { tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ -} \ No newline at end of file +} diff --git a/nextflow.config b/nextflow.config index b097fc55..50173dee 100644 --- a/nextflow.config +++ b/nextflow.config @@ -10,113 +10,113 @@ params { // Input options - input = null - fasta = null + input = null + fasta = null - features_table = null - features_table_separator = 'comma' - features_table_dict = '' + features_table = null + features_table_separator = 'comma' + features_table_dict = '' - custom_groups = false - custom_groups_file = null - custom_groups_separator = 'tab' + custom_groups = false + custom_groups_file = null + custom_groups_separator = 'tab' - customize_annotation = false - custom_annotation_tsv = '' + customize_annotation = false + custom_annotation_tsv = '' - use_custom_bedfile = false - custom_bedfile = null - use_custom_minimum_depth = 0 + use_custom_bedfile = false + custom_bedfile = null + use_custom_minimum_depth = 0 - hotspots_annotation = false - hotspots_definition_file = '' + hotspots_annotation = false + hotspots_definition_file = '' - mutationdensity = false + mutationdensity = false - profileall = false - profilenonprot = false - profileexons = false - profileintrons = false + profileall = false + profilenonprot = false + profileexons = false + profileintrons = false - oncodrivefml = false - oncodriveclustl = false + oncodrivefml = false + oncodriveclustl = false - oncodrive3d = false - o3d_raw_vep = false - o3d_plot = false - o3d_plot_chimerax = false + oncodrive3d = false + o3d_raw_vep = false + o3d_plot = false + o3d_plot_chimerax = false - omega = false - omega_multi = false - omega_globalloc = false - omega_mutabilities = false - site_comparison_grouping = 'all' - omega_plot = false + omega = false + omega_multi = false + omega_globalloc = false + omega_mutabilities = false + site_comparison_grouping = 'all' + omega_plot = false - omega_withingene = false - omega_autodomains = false - omega_autoexons = false - domains_file = null - omega_subgenic_bedfile = null - hotspot_expansion = 0 + omega_withingene = false + omega_autodomains = false + omega_autoexons = false + domains_file = null + omega_subgenic_bedfile = null + hotspot_expansion = 0 - signatures = false + signatures = false - mutated_cells_vaf = false - mutepi_genes_to_recode = null - expected_mutated_cells = false + mutated_cells_vaf = false + mutepi_genes_to_recode = null + expected_mutated_cells = false - dnds = false + dnds = false - indels = false + indels = false - signatures = false + signatures = false - confidence_level = 'med' - pileup_all_duplex = false - plot_depths = false - store_depths = false - create_sample_panels = false + confidence_level = 'med' + pileup_all_duplex = false + plot_depths = false + store_depths = false + create_sample_panels = false - downsample = false - downsample_proportion = 1 + downsample = false + downsample_proportion = 1 - regressions = false + regressions = false - filter_criteria = ["notcontains NM20", "notcontains p8", "notcontains n_rich", "notcontains cohort_n_rich_threshold", "notcontains cohort_n_rich", "notcontains no_pileup_support", "notcontains low_mappability", "notcontains not_covered" ] - filter_criteria_somatic = [] - no_filter = false + filter_criteria = ["notcontains NM20", "notcontains p8", "notcontains n_rich", "notcontains cohort_n_rich_threshold", "notcontains cohort_n_rich", "notcontains no_pileup_support", "notcontains low_mappability", "notcontains not_covered"] + filter_criteria_somatic = [] + no_filter = false // depth and panel - sample_panel_min_depth = 40 - consensus_panel_min_depth = 500 - consensus_compliance = 0.8 - selected_genes = '' - panel_with_canonical = true + sample_panel_min_depth = 40 + consensus_panel_min_depth = 500 + consensus_compliance = 0.8 + selected_genes = '' + panel_with_canonical = true - germline_threshold = 0.3 - mutation_depth_threshold = 40 + germline_threshold = 0.3 + mutation_depth_threshold = 40 - repetitive_variant_thres = 5 - prop_samples_nrich = 0.1 - blacklist_mutations = null + repetitive_variant_thres = 5 + prop_samples_nrich = 0.1 + blacklist_mutations = null - cosmic_ref_signatures = "COSMIC_v3.4_SBS_GRCh38.txt" - wgs_trinuc_counts = "assets/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" - cadd_scores = "CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz" - cadd_scores_ind = "CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz.tbi" + cosmic_ref_signatures = "COSMIC_v3.4_SBS_GRCh38.txt" + wgs_trinuc_counts = "assets/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv" + cadd_scores = "CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz" + cadd_scores_ind = "CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz.tbi" // dnds - dnds_ref_transcripts = "RefCDS_human_latest_intogen.rda" - dnds_covariates = "covariates_hg19_hg38_epigenome_pcawg.rda" + dnds_ref_transcripts = "RefCDS_human_latest_intogen.rda" + dnds_covariates = "covariates_hg19_hg38_epigenome_pcawg.rda" // oncodrive3d - datasets3d = "oncodrive3d/datasets" - annotations3d = "oncodrive3d/annotations" + datasets3d = "oncodrive3d/datasets" + annotations3d = "oncodrive3d/annotations" // sigprofiler @@ -124,22 +124,21 @@ params { // 'BER_deficiency_signatures', 'Chemotherapy_signatures', 'Immunosuppressants_signatures', // 'Treatment_signatures', 'APOBEC_signatures', 'Tobacco_signatures', 'UV_signatures', // 'AA_signatures', 'Colibactin_signatures','Artifact_signatures', 'Lymphoid_signatures'] - exclude_subgroups = "['UV_signatures', 'MMR_deficiency_signatures', 'POL_deficiency_signatures', 'HR_deficiency_signatures','BER_deficiency_signatures', 'Artifact_signatures', 'Lymphoid_signatures']" + exclude_subgroups = "['UV_signatures', 'MMR_deficiency_signatures', 'POL_deficiency_signatures', 'HR_deficiency_signatures','BER_deficiency_signatures', 'Artifact_signatures', 'Lymphoid_signatures']" // References for Ensembl VEP - download_cache = false + download_cache = false - vep_cache = ".vep" + vep_cache = ".vep" // Ensembl VEP for homo_sapiens - vep_genome = "GRCh38" - vep_species = "homo_sapiens" - vep_cache_version = 111 - vep_out_format = "tab" - vep_params = "--no_stats --cache --offline --symbol --protein --canonical --af_gnomadg --af_gnomade" - vep_params_panel = "--no_stats --cache --offline --symbol --protein --canonical" - + vep_genome = "GRCh38" + vep_species = "homo_sapiens" + vep_cache_version = 111 + vep_out_format = "tab" + vep_params = "--no_stats --cache --offline --symbol --protein --canonical --af_gnomadg --af_gnomade" + vep_params_panel = "--no_stats --cache --offline --symbol --protein --canonical" } // Load default regressions parameters @@ -151,35 +150,34 @@ includeConfig 'conf/tools/regressions.config' params { // MultiQC options - multiqc_config = null - multiqc_title = null - multiqc_logo = null - max_multiqc_email_size = '25.MB' + multiqc_config = null + multiqc_title = null + multiqc_logo = null + max_multiqc_email_size = '25.MB' multiqc_methods_description = null // Boilerplate options - outdir = null - publish_dir_mode = 'copy' - email = null - email_on_fail = null - plaintext_email = false - monochrome_logs = false - hook_url = null - help = false - version = false + outdir = null + publish_dir_mode = 'copy' + email = null + email_on_fail = null + plaintext_email = false + monochrome_logs = false + hook_url = null + help = false + version = false // Config options - config_profile_name = null - config_profile_description = null + config_profile_name = null + config_profile_description = null // Max resource options // Defaults only, expecting to be overwritten - max_memory = 256.GB - max_cpus = 56 - max_time = 240.h - - validate_params = true + max_memory = 256.GB + max_cpus = 56 + max_time = 240.h + validate_params = true } // Load base.config by default for all pipelines @@ -190,46 +188,46 @@ includeConfig 'conf/base.config' // Set default registry for Apptainer, Docker, Podman and Singularity independent of -profile // Will not be used unless Apptainer / Docker / Podman / Singularity are enabled // Set to your registry if you have a mirror of containers -apptainer.registry = 'quay.io' -docker.registry = 'quay.io' -podman.registry = 'quay.io' +apptainer.registry = 'quay.io' +docker.registry = 'quay.io' +podman.registry = 'quay.io' singularity.registry = 'quay.io' profiles { debug { - dumpHashes = true - process.beforeScript = 'echo $HOSTNAME' - cleanup = false + dumpHashes = true + process.beforeScript = 'echo $HOSTNAME' + cleanup = false } conda { - conda.enabled = true - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + conda.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } mamba { - conda.enabled = true - conda.useMamba = true - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + conda.enabled = true + conda.useMamba = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } docker { - docker.enabled = true - conda.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + docker.enabled = true + conda.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' @@ -245,58 +243,76 @@ profiles { apptainer.enabled = false } podman { - podman.enabled = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - shifter.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + podman.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } shifter { - shifter.enabled = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - podman.enabled = false - charliecloud.enabled = false - apptainer.enabled = false + shifter.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } charliecloud { - charliecloud.enabled = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - apptainer.enabled = false + charliecloud.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + apptainer.enabled = false } apptainer { - apptainer.enabled = true - apptainer.autoMounts = true - conda.enabled = false - docker.enabled = false - singularity.enabled = false - podman.enabled = false - shifter.enabled = false - charliecloud.enabled = false + apptainer.enabled = true + apptainer.autoMounts = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false } gitpod { - executor.name = 'local' - executor.cpus = 4 - executor.memory = 8.GB + executor.name = 'local' + executor.cpus = 4 + executor.memory = 8.GB + } + irbcluster { + includeConfig 'conf/general_files_IRB.config' + } + bbgcluster { + includeConfig 'conf/general_files_BBG.config' + } + local { + includeConfig 'conf/local.config' + } + test { + includeConfig 'conf/test.config' + } + test_real { + includeConfig 'conf/test_real.config' } - irbcluster { includeConfig 'conf/general_files_IRB.config' } - bbgcluster { includeConfig 'conf/general_files_BBG.config' } - local { includeConfig 'conf/local.config' } - test { includeConfig 'conf/test.config' } - test_real { includeConfig 'conf/test_real.config' } - basic { includeConfig 'conf/modes/basic.config' } - clonal_structure { includeConfig 'conf/modes/clonal_structure.config' } - get_signatures { includeConfig 'conf/modes/get_signatures.config' } + basic { + includeConfig 'conf/modes/basic.config' + } + clonal_structure { + includeConfig 'conf/modes/clonal_structure.config' + } + get_signatures { + includeConfig 'conf/modes/get_signatures.config' + } - mice { includeConfig 'conf/mice.config' } + mice { + includeConfig 'conf/mice.config' + } } @@ -304,7 +320,7 @@ profiles { // Nextflow plugins plugins { - id 'nf-schema@2.3.0' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-schema@2.3.0' } // Export these variables to prevent local Python/R libraries from conflicting with those in the container @@ -337,7 +353,7 @@ trace { } dag { enabled = true - file = "${params.outdir}/pipeline_info/pipeline_dag_${new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')}.html" + file = "${params.outdir}/pipeline_info/pipeline_dag_${new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')}.html" } manifest { diff --git a/subworkflows/local/createpanels/main.nf b/subworkflows/local/createpanels/main.nf index 15db1033..06dcf890 100644 --- a/subworkflows/local/createpanels/main.nf +++ b/subworkflows/local/createpanels/main.nf @@ -1,50 +1,49 @@ -include { SITESFROMPOSITIONS } from '../../../modules/local/sitesfrompositions/main' -include { VCF_ANNOTATE_ENSEMBLVEP as VCFANNOTATEPANEL } from '../../../subworkflows/nf-core/vcf_annotate_ensemblvep_panel/main' +include { SITESFROMPOSITIONS } from '../../../modules/local/sitesfrompositions/main' +include { VCF_ANNOTATE_ENSEMBLVEP as VCFANNOTATEPANEL } from '../../../subworkflows/nf-core/vcf_annotate_ensemblvep_panel/main' -include { POSTPROCESS_VEP_ANNOTATION as POSTPROCESSVEPPANEL } from '../../../modules/local/process_annotation/panel/main' +include { POSTPROCESS_VEP_ANNOTATION as POSTPROCESSVEPPANEL } from '../../../modules/local/process_annotation/panel/main' -include { CUSTOM_ANNOTATION_PROCESSING as CUSTOMPROCESSING } from '../../../modules/local/process_annotation/panelcustom/main' -include { CUSTOM_ANNOTATION_PROCESSING as CUSTOMPROCESSINGRICH } from '../../../modules/local/process_annotation/panelcustom/main' +include { CUSTOM_ANNOTATION_PROCESSING as CUSTOMPROCESSING } from '../../../modules/local/process_annotation/panelcustom/main' +include { CUSTOM_ANNOTATION_PROCESSING as CUSTOMPROCESSINGRICH } from '../../../modules/local/process_annotation/panelcustom/main' -include { DOMAIN_ANNOTATION as DOMAINANNOTATION } from '../../../modules/local/process_annotation/domain/main' +include { DOMAIN_ANNOTATION as DOMAINANNOTATION } from '../../../modules/local/process_annotation/domain/main' -include { CREATECAPTUREDPANELS } from '../../../modules/local/createpanels/captured/main' +include { CREATECAPTUREDPANELS } from '../../../modules/local/createpanels/captured/main' -include { CREATESAMPLEPANELS as CREATESAMPLEPANELSALL } from '../../../modules/local/createpanels/sample/main' -include { CREATESAMPLEPANELS as CREATESAMPLEPANELSPROTAFFECT } from '../../../modules/local/createpanels/sample/main' -include { CREATESAMPLEPANELS as CREATESAMPLEPANELSNONPROTAFFECT } from '../../../modules/local/createpanels/sample/main' -include { CREATESAMPLEPANELS as CREATESAMPLEPANELSEXONS } from '../../../modules/local/createpanels/sample/main' -include { CREATESAMPLEPANELS as CREATESAMPLEPANELSINTRONS } from '../../../modules/local/createpanels/sample/main' -include { CREATESAMPLEPANELS as CREATESAMPLEPANELSSYNONYMOUS } from '../../../modules/local/createpanels/sample/main' +include { CREATESAMPLEPANELS as CREATESAMPLEPANELSALL } from '../../../modules/local/createpanels/sample/main' +include { CREATESAMPLEPANELS as CREATESAMPLEPANELSPROTAFFECT } from '../../../modules/local/createpanels/sample/main' +include { CREATESAMPLEPANELS as CREATESAMPLEPANELSNONPROTAFFECT } from '../../../modules/local/createpanels/sample/main' +include { CREATESAMPLEPANELS as CREATESAMPLEPANELSEXONS } from '../../../modules/local/createpanels/sample/main' +include { CREATESAMPLEPANELS as CREATESAMPLEPANELSINTRONS } from '../../../modules/local/createpanels/sample/main' +include { CREATESAMPLEPANELS as CREATESAMPLEPANELSSYNONYMOUS } from '../../../modules/local/createpanels/sample/main' -include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSALL } from '../../../modules/local/createpanels/consensus/main' -include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSPROTAFFECT } from '../../../modules/local/createpanels/consensus/main' -include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSNONPROTAFFECT } from '../../../modules/local/createpanels/consensus/main' -include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSEXONS } from '../../../modules/local/createpanels/consensus/main' -include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSINTRONS } from '../../../modules/local/createpanels/consensus/main' -include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSSYNONYMOUS } from '../../../modules/local/createpanels/consensus/main' +include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSALL } from '../../../modules/local/createpanels/consensus/main' +include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSPROTAFFECT } from '../../../modules/local/createpanels/consensus/main' +include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSNONPROTAFFECT } from '../../../modules/local/createpanels/consensus/main' +include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSEXONS } from '../../../modules/local/createpanels/consensus/main' +include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSINTRONS } from '../../../modules/local/createpanels/consensus/main' +include { CREATECONSENSUSPANELS as CREATECONSENSUSPANELSSYNONYMOUS } from '../../../modules/local/createpanels/consensus/main' def restructurePanel(panel) { - // return panel.map{ it -> [[id: it[0].name.tokenize('.')[0..1].join('.')], it[1]] } - // return panel.map { it -> [[id: it.name.tokenize('.')[0..1].join('.')], it] } - return panel.map { it -> [[id: it.name.tokenize('.')[1]], it] } - } + // return panel.map{ it -> [[id: it[0].name.tokenize('.')[0..1].join('.')], it[1]] } + // return panel.map { it -> [[id: it.name.tokenize('.')[0..1].join('.')], it] } + return panel.map { it -> [[id: it.name.tokenize('.')[1]], it] } +} def restructureSamplePanel(panel) { - // return panel.map{ it -> [[id: it[0].name.tokenize('.')[0..1].join('.')], it[1]] } - // return panel.map { it -> [[id: it.name.tokenize('.')[0..1].join('.')], it] } - return panel.map { it -> [[id: it.name.tokenize('.')[0]], it] } - } + // return panel.map{ it -> [[id: it[0].name.tokenize('.')[0..1].join('.')], it[1]] } + // return panel.map { it -> [[id: it.name.tokenize('.')[0..1].join('.')], it] } + return panel.map { it -> [[id: it.name.tokenize('.')[0]], it] } +} workflow CREATE_PANELS { - take: depths @@ -54,16 +53,18 @@ workflow CREATE_PANELS { SITESFROMPOSITIONS(depths) // Create a tuple for VEP annotation (mandatory) - SITESFROMPOSITIONS.out.annotated_panel_reg.map{ it -> [[ id : "captured_panel"], it[1]] }.set{ sites_annotation } + SITESFROMPOSITIONS.out.annotated_panel_reg.map { it -> [[id: "captured_panel"], it[1]] }.set { sites_annotation } // Annotate all possible mutations in the captured panel - VCFANNOTATEPANEL(sites_annotation, - params.fasta, - params.vep_genome, - params.vep_species, - params.vep_cache_version, - params.vep_cache, - []) + VCFANNOTATEPANEL( + sites_annotation, + params.fasta, + params.vep_genome, + params.vep_species, + params.vep_cache_version, + params.vep_cache, + [], + ) // Postprocess annotations to get one annotation per mutation POSTPROCESSVEPPANEL(VCFANNOTATEPANEL.out.tab) @@ -79,8 +80,8 @@ workflow CREATE_PANELS { rich_annotated = CUSTOMPROCESSINGRICH.out.custom_panel_annotation added_regions = CUSTOMPROCESSINGRICH.out.added_regions - - } else { + } + else { complete_annotated_panel = POSTPROCESSVEPPANEL.out.compact_panel_annotation rich_annotated = POSTPROCESSVEPPANEL.out.rich_panel_annotation added_regions = Channel.empty() @@ -92,20 +93,20 @@ workflow CREATE_PANELS { // Create captured-specific panels: all modalities CREATECAPTUREDPANELS(complete_annotated_panel) - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_all).set{all_panel} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_all_bed).set{all_bed} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_protein_affecting).set{prot_panel} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_protein_affecting_bed).set{prot_bed} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_non_protein_affecting).set{nonprot_panel} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_non_protein_affecting_bed).set{nonprot_bed} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_exons_splice_sites).set{exons_panel} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_exons_splice_sites_bed).set{exons_bed} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_introns_intergenic).set{introns_panel} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_introns_intergenic_bed).set{introns_bed} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_synonymous).set{synonymous_panel} - restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_synonymous_bed).set{synonymous_bed} - - if (params.create_sample_panels){ + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_all).set { all_panel } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_all_bed).set { all_bed } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_protein_affecting).set { prot_panel } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_protein_affecting_bed).set { prot_bed } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_non_protein_affecting).set { nonprot_panel } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_non_protein_affecting_bed).set { nonprot_bed } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_exons_splice_sites).set { exons_panel } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_exons_splice_sites_bed).set { exons_bed } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_introns_intergenic).set { introns_panel } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_introns_intergenic_bed).set { introns_bed } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_synonymous).set { synonymous_panel } + restructurePanel(CREATECAPTUREDPANELS.out.captured_panel_synonymous_bed).set { synonymous_bed } + + if (params.create_sample_panels) { // Create sample-specific panels: all modalities CREATESAMPLEPANELSALL(all_panel, depths, params.sample_panel_min_depth) CREATESAMPLEPANELSPROTAFFECT(prot_panel, depths, params.sample_panel_min_depth) @@ -125,51 +126,35 @@ workflow CREATE_PANELS { CREATECONSENSUSPANELSSYNONYMOUS(synonymous_panel, depths) emit: - full_panel_annotated = VCFANNOTATEPANEL.out.tab - all_panel = all_panel.first() - all_bed = all_bed.first() - prot_panel = prot_panel.first() - prot_bed = prot_bed.first() - nonprot_panel = nonprot_panel.first() - nonprot_bed = nonprot_bed.first() - exons_panel = exons_panel.first() - exons_bed = exons_bed.first() - introns_panel = introns_panel.first() - introns_bed = introns_bed.first() - synonymous_panel = synonymous_panel.first() - synonymous_bed = synonymous_bed.first() - - - all_consensus_panel = CREATECONSENSUSPANELSALL.out.consensus_panel.first() - all_consensus_bed = CREATECONSENSUSPANELSALL.out.consensus_panel_bed.first() - prot_consensus_panel = CREATECONSENSUSPANELSPROTAFFECT.out.consensus_panel.first() - prot_consensus_bed = CREATECONSENSUSPANELSPROTAFFECT.out.consensus_panel_bed.first() - nonprot_consensus_panel = CREATECONSENSUSPANELSNONPROTAFFECT.out.consensus_panel.first() - nonprot_consensus_bed = CREATECONSENSUSPANELSNONPROTAFFECT.out.consensus_panel_bed.first() - exons_consensus_panel = CREATECONSENSUSPANELSEXONS.out.consensus_panel.first() - exons_consensus_bed = CREATECONSENSUSPANELSEXONS.out.consensus_panel_bed.first() - introns_consensus_panel = CREATECONSENSUSPANELSINTRONS.out.consensus_panel.first() - introns_consensus_bed = CREATECONSENSUSPANELSINTRONS.out.consensus_panel_bed.first() - synonymous_consensus_panel = CREATECONSENSUSPANELSSYNONYMOUS.out.consensus_panel.first() - synonymous_consensus_bed = CREATECONSENSUSPANELSSYNONYMOUS.out.consensus_panel_bed.first() - - panel_annotated_rich = rich_annotated - added_custom_regions = added_regions - domains_panel_bed = DOMAINANNOTATION.out.domains_bed - domains_in_panel = DOMAINANNOTATION.out.domains_tsv - - postprocessed_panel = POSTPROCESSVEPPANEL.out.compact_panel_annotation - postprocessed_panel_rich = POSTPROCESSVEPPANEL.out.rich_panel_annotation - - // all_sample_panel = restructureSamplePanel(CREATESAMPLEPANELSALL.out.sample_specific_panel.flatten()) - // all_sample_bed = restructureSamplePanel(CREATESAMPLEPANELSALL.out.sample_specific_panel_bed.flatten()) - // prot_sample_panel = restructureSamplePanel(CREATESAMPLEPANELSPROTAFFECT.out.sample_specific_panel.flatten()) - // prot_sample_bed = restructureSamplePanel(CREATESAMPLEPANELSPROTAFFECT.out.sample_specific_panel_bed.flatten()) - // nonprot_sample_panel = restructureSamplePanel(CREATESAMPLEPANELSNONPROTAFFECT.out.sample_specific_panel.flatten()) - // nonprot_sample_bed = restructureSamplePanel(CREATESAMPLEPANELSNONPROTAFFECT.out.sample_specific_panel_bed.flatten()) - // exons_sample_panel = restructureSamplePanel(CREATESAMPLEPANELSEXONS.out.sample_specific_panel.flatten()) - // exons_sample_bed = restructureSamplePanel(CREATESAMPLEPANELSEXONS.out.sample_specific_panel_bed.flatten()) - // introns_sample_panel = restructureSamplePanel(CREATESAMPLEPANELSINTRONS.out.sample_specific_panel.flatten()) - // introns_sample_bed = restructureSamplePanel(CREATESAMPLEPANELSINTRONS.out.sample_specific_panel_bed.flatten()) - + full_panel_annotated = VCFANNOTATEPANEL.out.tab + all_panel = all_panel.first() + all_bed = all_bed.first() + prot_panel = prot_panel.first() + prot_bed = prot_bed.first() + nonprot_panel = nonprot_panel.first() + nonprot_bed = nonprot_bed.first() + exons_panel = exons_panel.first() + exons_bed = exons_bed.first() + introns_panel = introns_panel.first() + introns_bed = introns_bed.first() + synonymous_panel = synonymous_panel.first() + synonymous_bed = synonymous_bed.first() + all_consensus_panel = CREATECONSENSUSPANELSALL.out.consensus_panel.first() + all_consensus_bed = CREATECONSENSUSPANELSALL.out.consensus_panel_bed.first() + prot_consensus_panel = CREATECONSENSUSPANELSPROTAFFECT.out.consensus_panel.first() + prot_consensus_bed = CREATECONSENSUSPANELSPROTAFFECT.out.consensus_panel_bed.first() + nonprot_consensus_panel = CREATECONSENSUSPANELSNONPROTAFFECT.out.consensus_panel.first() + nonprot_consensus_bed = CREATECONSENSUSPANELSNONPROTAFFECT.out.consensus_panel_bed.first() + exons_consensus_panel = CREATECONSENSUSPANELSEXONS.out.consensus_panel.first() + exons_consensus_bed = CREATECONSENSUSPANELSEXONS.out.consensus_panel_bed.first() + introns_consensus_panel = CREATECONSENSUSPANELSINTRONS.out.consensus_panel.first() + introns_consensus_bed = CREATECONSENSUSPANELSINTRONS.out.consensus_panel_bed.first() + synonymous_consensus_panel = CREATECONSENSUSPANELSSYNONYMOUS.out.consensus_panel.first() + synonymous_consensus_bed = CREATECONSENSUSPANELSSYNONYMOUS.out.consensus_panel_bed.first() + panel_annotated_rich = rich_annotated + added_custom_regions = added_regions + domains_panel_bed = DOMAINANNOTATION.out.domains_bed + domains_in_panel = DOMAINANNOTATION.out.domains_tsv + postprocessed_panel = POSTPROCESSVEPPANEL.out.compact_panel_annotation + postprocessed_panel_rich = POSTPROCESSVEPPANEL.out.rich_panel_annotation } diff --git a/subworkflows/local/depthanalysis/main.nf b/subworkflows/local/depthanalysis/main.nf index 66b3690c..3f229a59 100644 --- a/subworkflows/local/depthanalysis/main.nf +++ b/subworkflows/local/depthanalysis/main.nf @@ -1,8 +1,7 @@ include { COMPUTEDEPTHS } from '../../../modules/local/computedepths/main' -workflow DEPTH_ANALYSIS{ - +workflow DEPTH_ANALYSIS { take: bam_list custom_bed @@ -11,18 +10,11 @@ workflow DEPTH_ANALYSIS{ // Join all samples and put them in a channel to be summarized together - bam_list.map{ it -> it[1] }.collect().map{ it -> [[ id:"all_samples" ], it]}.set{ combined_bams } + bam_list.map { it -> it[1] }.collect().map { it -> [[id: "all_samples"], it] }.set { combined_bams } // Create a table with the depth per positions across samples COMPUTEDEPTHS(combined_bams, custom_bed) - // MAYBE: create different versions of the depth table according to the different panels - // PROCESSDEPTHSTABLE() - - // Create depth stats - // PLOTDEPTHS() - emit: - depths = COMPUTEDEPTHS.out.depths // channel: [ val(meta), file(depths) ] - // plots = PLOTDEPTHS.out.plots // idk how this is output but put it here to remember + depths = COMPUTEDEPTHS.out.depths // channel: [ val(meta), file(depths) ] } diff --git a/subworkflows/local/dnds/main.nf b/subworkflows/local/dnds/main.nf index 1ecbca4f..5a26c31f 100644 --- a/subworkflows/local/dnds/main.nf +++ b/subworkflows/local/dnds/main.nf @@ -1,9 +1,9 @@ -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSET_DNDS } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSET_DNDS } from '../../../modules/local/subsetmaf/main' -include { PREPROCESS_DNDS as PREPROCESSDEPTHS } from '../../../modules/local/dnds/preprocess/main' -include { RUN_DNDS as DNDSRUN } from '../../../modules/local/dnds/run/main' +include { PREPROCESS_DNDS as PREPROCESSDEPTHS } from '../../../modules/local/dnds/preprocess/main' +include { RUN_DNDS as DNDSRUN } from '../../../modules/local/dnds/run/main' workflow DNDS { @@ -15,8 +15,8 @@ workflow DNDS { main: - covariates = params.dnds_covariates ? Channel.fromPath( params.dnds_covariates, checkIfExists: true).first() : Channel.empty() - ref_trans = params.dnds_ref_transcripts ? Channel.fromPath( params.dnds_ref_transcripts, checkIfExists: true).first() : Channel.empty() + covariates = params.dnds_covariates ? Channel.fromPath(params.dnds_covariates, checkIfExists: true).first() : Channel.empty() + ref_trans = params.dnds_ref_transcripts ? Channel.fromPath(params.dnds_ref_transcripts, checkIfExists: true).first() : Channel.empty() SUBSETMUTATIONS(mutations, bedfile) @@ -26,16 +26,11 @@ workflow DNDS { PREPROCESSDEPTHS(depth, panel) SUBSET_DNDS.out.mutations - .join(PREPROCESSDEPTHS.out.depths) - .set{ mutations_n_depth } + .join(PREPROCESSDEPTHS.out.depths) + .set { mutations_n_depth } - ref_trans.map{it -> [ ["id" : "global_RefCDS"] , it ] } - .set{ refcds_global } + ref_trans + .map { it -> [["id": "global_RefCDS"], it] } + .set { refcds_global } DNDSRUN(mutations_n_depth, refcds_global, covariates) - - // // uncomment whenever we can use the custom RefCDS file - // DNDSRUN(mutations_n_depth, ref_trans, covariates) - - // emit: - // dnds_values = DNDSRUN.out.dnds_values } diff --git a/subworkflows/local/indels/main.nf b/subworkflows/local/indels/main.nf index 7c7c660b..0600d2df 100644 --- a/subworkflows/local/indels/main.nf +++ b/subworkflows/local/indels/main.nf @@ -1,12 +1,11 @@ -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSETINDELS } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETINDELS } from '../../../modules/local/subsetmaf/main' -include { INDELS_COMPARISON as INDELS } from '../../../modules/local/indels/main' +include { INDELS_COMPARISON as INDELS } from '../../../modules/local/indels/main' workflow INDELS_SELECTION { - take: mutations bedfile diff --git a/subworkflows/local/input_check.nf b/subworkflows/local/input_check.nf index 856540f4..cc03b0d4 100644 --- a/subworkflows/local/input_check.nf +++ b/subworkflows/local/input_check.nf @@ -9,33 +9,29 @@ workflow INPUT_CHECK { samplesheet // file: /path/to/samplesheet.csv main: - SAMPLESHEET_CHECK ( samplesheet ) - .csv - .splitCsv ( header:true, sep:',' ) - .map { create_input_channel(it) } - .set { mutations } + SAMPLESHEET_CHECK(samplesheet).csv.splitCsv(header: true, sep: ',').map { create_input_channel(it) }.set { mutations } emit: - mutations // channel: [ val(meta), file(row.vcf), file(row.bam) ] + mutations // channel: [ val(meta), file(row.vcf), file(row.bam) ] } // Function to get list of [ meta, [ fastq_1, fastq_2 ] ] def create_input_channel(LinkedHashMap row) { // create meta map def meta = [:] - meta.id = row.sample - meta.batch = row.batch + meta.id = row.sample + meta.batch = row.batch // add path(s) of the fastq file(s) to the meta map def vcf_bam_meta = [] if (!file(row.vcf).exists()) { - exit 1, "ERROR: Please check input samplesheet -> VCF file does not exist!\n${row.vcf}" + exit(1, "ERROR: Please check input samplesheet -> VCF file does not exist!\n${row.vcf}") } if (!file(row.bam).exists()) { - exit 1, "ERROR: Please check input samplesheet -> BAM file does not exist!\n${row.bam}" + exit(1, "ERROR: Please check input samplesheet -> BAM file does not exist!\n${row.bam}") } - vcf_bam_meta = [ meta, file(row.vcf), file(row.bam) ] + vcf_bam_meta = [meta, file(row.vcf), file(row.bam)] return vcf_bam_meta } diff --git a/subworkflows/local/mut_density/main.nf b/subworkflows/local/mut_density/main.nf index 4d21a0b1..27876a62 100644 --- a/subworkflows/local/mut_density/main.nf +++ b/subworkflows/local/mut_density/main.nf @@ -1,11 +1,11 @@ -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSETMUTDENSITYADJUSTED } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETMUTDENSITYADJUSTED } from '../../../modules/local/subsetmaf/main' -include { MUTATION_DENSITY as MUTDENSITYADJ } from '../../../modules/local/mut_density/main' +include { MUTATION_DENSITY as MUTDENSITYADJ } from '../../../modules/local/mut_density/main' -workflow MUTATION_DENSITY{ +workflow MUTATION_DENSITY { take: mutations depth @@ -22,15 +22,14 @@ workflow MUTATION_DENSITY{ SUBSETMUTDENSITYADJUSTED(SUBSETMUTATIONS.out.subset) SUBSETMUTDENSITYADJUSTED.out.mutations - .join(depth) - .join(mutability_file) - .set{ mutations_n_depth_n_profile } + .join(depth) + .join(mutability_file) + .set { mutations_n_depth_n_profile } MUTDENSITYADJ(mutations_n_depth_n_profile, panel, trinucleotide_counts) - emit: - mutdensities = MUTDENSITYADJ.out.mutdensities - mutdensities_flat = MUTDENSITYADJ.out.mutdensities_flat - mutdensities_plots = MUTDENSITYADJ.out.mutdensities_plots + mutdensities = MUTDENSITYADJ.out.mutdensities + mutdensities_flat = MUTDENSITYADJ.out.mutdensities_flat + mutdensities_plots = MUTDENSITYADJ.out.mutdensities_plots } diff --git a/subworkflows/local/mutability/main.nf b/subworkflows/local/mutability/main.nf index 1e5afff4..7b1c5a44 100644 --- a/subworkflows/local/mutability/main.nf +++ b/subworkflows/local/mutability/main.nf @@ -1,16 +1,14 @@ +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { SUBSET_MAF as SUBSETMUTABILITY } from '../../../modules/local/subsetmaf/main' -include { SUBSET_MAF as SUBSETMUTABILITY } from '../../../modules/local/subsetmaf/main' +include { COMPUTE_RELATIVE_MUTABILITY as RELATIVEMUTABILITY } from '../../../modules/local/compute_mutability/main' -include { COMPUTE_RELATIVE_MUTABILITY as RELATIVEMUTABILITY } from '../../../modules/local/compute_mutability/main' - -include { TABIX_BGZIPTABIX as MUTABILITY_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix/main' +include { TABIX_BGZIPTABIX as MUTABILITY_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix/main' workflow MUTABILITY { - take: mutations depth @@ -30,15 +28,14 @@ workflow MUTABILITY { SUBSETMUTABILITY(SUBSETMUTATIONS.out.subset) SUBSETMUTABILITY.out.mutations - .join(profile) - .join(depth) - .set{ mutations_n_profile_n_depth } - - RELATIVEMUTABILITY( mutations_n_profile_n_depth, panel_file) + .join(profile) + .join(depth) + .set { mutations_n_profile_n_depth } - MUTABILITY_BGZIPTABIX( RELATIVEMUTABILITY.out.mutability ) + RELATIVEMUTABILITY(mutations_n_profile_n_depth, panel_file) + MUTABILITY_BGZIPTABIX(RELATIVEMUTABILITY.out.mutability) emit: - mutability = MUTABILITY_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), file(mutabilities), file(mutabilities_index) ] + mutability = MUTABILITY_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), file(mutabilities), file(mutabilities_index) ] } diff --git a/subworkflows/local/mutatedcells/expected/main.nf b/subworkflows/local/mutatedcells/expected/main.nf index ffbfc2ac..aa85c758 100644 --- a/subworkflows/local/mutatedcells/expected/main.nf +++ b/subworkflows/local/mutatedcells/expected/main.nf @@ -1,11 +1,9 @@ - -include { TABIX_BGZIPTABIX_QUERY as SUBSETDEPTHS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' -include { EXPECTED_MUTATED_CELLS as EXPECTEDMUTATEDCELLS } from '../../../../modules/local/mutated_cells_expected/main' -include { CREATECUSTOMBEDFILE as INTERVALSBED } from '../../../../modules/local/createpanels/custombedfile/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETDEPTHS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' +include { EXPECTED_MUTATED_CELLS as EXPECTEDMUTATEDCELLS } from '../../../../modules/local/mutated_cells_expected/main' +include { CREATECUSTOMBEDFILE as INTERVALSBED } from '../../../../modules/local/createpanels/custombedfile/main' workflow EXPECTED_MUTATED_CELLS { - take: mutations bedfile @@ -23,19 +21,17 @@ workflow EXPECTED_MUTATED_CELLS { // SUBSET_MUTEPIVAF(SUBSETMUTATIONS.out.subset) INTERVALSBED(panel) - features_table = params.features_table ? Channel.fromPath( params.features_table, checkIfExists: true) : Channel.fromPath(params.input) - EXPECTEDMUTATEDCELLS(panel, - SUBSETMUTATIONS.out.subset, - SUBSETDEPTHS.out.subset, - raw_annotation, - INTERVALSBED.out.bed, - features_table - ) + features_table = params.features_table ? Channel.fromPath(params.features_table, checkIfExists: true) : Channel.fromPath(params.input) + EXPECTEDMUTATEDCELLS( + panel, + SUBSETMUTATIONS.out.subset, + SUBSETDEPTHS.out.subset, + raw_annotation, + INTERVALSBED.out.bed, + features_table, + ) emit: - // TODO add some other output - // mut_epi_sample = COMPUTEMUTATEDEPITHELIUM.out.mutated_epi_sample - refcds_object = EXPECTEDMUTATEDCELLS.out.rds_file.first() - refcds_object_rda = EXPECTEDMUTATEDCELLS.out.rda_file.first() - + refcds_object = EXPECTEDMUTATEDCELLS.out.rds_file.first() + refcds_object_rda = EXPECTEDMUTATEDCELLS.out.rda_file.first() } diff --git a/subworkflows/local/mutatedcells/vaf/main.nf b/subworkflows/local/mutatedcells/vaf/main.nf index 9801d3e8..13e03cde 100644 --- a/subworkflows/local/mutatedcells/vaf/main.nf +++ b/subworkflows/local/mutatedcells/vaf/main.nf @@ -1,20 +1,17 @@ +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' - -include { SUBSET_MAF as SUBSETMUTEPIVAFAM } from '../../../../modules/local/subsetmaf/main' -include { MUTATED_GENOMES_FROM_VAF as MUTATEDGENOMESFROMVAFAM } from '../../../../modules/local/mutated_genomes_from_vaf/main' -include { MUTATED_CELLS_FROM_VAF as MUTATEDCELLSFROMVAFAM } from '../../../../modules/local/mutated_cells_from_vaf/main' +include { SUBSET_MAF as SUBSETMUTEPIVAFAM } from '../../../../modules/local/subsetmaf/main' +include { MUTATED_GENOMES_FROM_VAF as MUTATEDGENOMESFROMVAFAM } from '../../../../modules/local/mutated_genomes_from_vaf/main' +include { MUTATED_CELLS_FROM_VAF as MUTATEDCELLSFROMVAFAM } from '../../../../modules/local/mutated_cells_from_vaf/main' workflow MUTATED_CELLS_VAF { - take: mutations bedfile omegas clinical_features - main: SUBSETMUTATIONS(mutations, bedfile) @@ -22,15 +19,10 @@ workflow MUTATED_CELLS_VAF { SUBSETMUTEPIVAFAM(SUBSETMUTATIONS.out.subset) SUBSETMUTEPIVAFAM.out.mutations - .join(omegas) - .set{mutations_n_omega} + .join(omegas) + .set { mutations_n_omega } MUTATEDGENOMESFROMVAFAM(mutations_n_omega) - MUTATEDGENOMESFROMVAFAM.out.mutated_gen_sample.map{ it -> it[1] }.collect().map{ it -> [[ id:"all_samples" ], it]}.set{ mut_genomes_am_samples } + MUTATEDGENOMESFROMVAFAM.out.mutated_gen_sample.map { it -> it[1] }.collect().map { it -> [[id: "all_samples"], it] }.set { mut_genomes_am_samples } MUTATEDCELLSFROMVAFAM(mut_genomes_am_samples, clinical_features) - - // emit: - // TODO add some other output - // mut_epi_sample = MUTATEDCELLSFROMVAFAM.out.mutated_cells_sample - } diff --git a/subworkflows/local/mutationdensity/main.nf b/subworkflows/local/mutationdensity/main.nf index 725ded1b..31ab038a 100644 --- a/subworkflows/local/mutationdensity/main.nf +++ b/subworkflows/local/mutationdensity/main.nf @@ -1,11 +1,11 @@ -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSETMUTDENSITY } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETMUTDENSITY } from '../../../modules/local/subsetmaf/main' -include { MUTATION_DENSITY as MUTDENSITY } from '../../../modules/local/computemutdensity/main' +include { MUTATION_DENSITY as MUTDENSITY } from '../../../modules/local/computemutdensity/main' -workflow MUTATION_DENSITY{ +workflow MUTATION_DENSITY { take: mutations depth @@ -20,12 +20,11 @@ workflow MUTATION_DENSITY{ SUBSETMUTDENSITY(SUBSETMUTATIONS.out.subset) SUBSETMUTDENSITY.out.mutations - .join(depth) - .set{ mutations_n_depth } + .join(depth) + .set { mutations_n_depth } MUTDENSITY(mutations_n_depth, panel) - emit: mutdensities = MUTDENSITY.out.mutdensities } diff --git a/subworkflows/local/mutationpreprocessing/main.nf b/subworkflows/local/mutationpreprocessing/main.nf index 7cd96a99..fd230a08 100644 --- a/subworkflows/local/mutationpreprocessing/main.nf +++ b/subworkflows/local/mutationpreprocessing/main.nf @@ -1,27 +1,26 @@ // Annotation -include { VCF_ANNOTATE_ENSEMBLVEP as VCFANNOTATE } from '../../nf-core/vcf_annotate_ensemblvep/main' - - -include { SUMMARIZE_ANNOTATION as SUMANNOTATION } from '../../../modules/local/process_annotation/mutations/main' -include { CUSTOM_MUTATION_PROCESSING as CUSTOMANNOTATION } from '../../../modules/local/process_annotation/mutations_custom/main' -include { VCF2MAF as VCF2MAF } from '../../../modules/local/vcf2maf/main' -include { FILTERBED as FILTERPANEL } from '../../../modules/local/filterbed/main' -include { FILTERBED as FILTEREXONS } from '../../../modules/local/filterbed/main' -include { MERGE_BATCH as MERGEBATCH } from '../../../modules/local/mergemafs/main' -include { FILTER_BATCH as FILTERBATCH } from '../../../modules/local/filtermaf/main' -include { WRITE_MAFS as WRITEMAF } from '../../../modules/local/writemaf/main' -include { SUBSET_MAF as SOMATICMUTATIONS } from '../../../modules/local/subsetmaf/main' -include { SUBSET_MAF as CLEANMUTATIONS } from '../../../modules/local/subsetmaf/main' -include { BLACKLIST_MUTATIONS as BLACKLISTMUTS } from '../../../modules/local/blacklistmuts/main' -include { PLOT_MUTATIONS as PLOTMAF } from '../../../modules/local/plot/mutations_summary/main' -include { PLOT_MUTATIONS as PLOTSOMATICMAF } from '../../../modules/local/plot/mutations_summary/main' -include { PLOT_NEEDLES as PLOTNEEDLES } from '../../../modules/local/plot/needles/main' -include { DOWNSAMPLE_MUTATIONS as DOWNSAMPLEMUTS } from '../../../modules/local/downsample/mutations/main' -include { COMPUTE_CONTAMINATION as CONTAMINATION } from '../../../modules/local/contamination/main' +include { VCF_ANNOTATE_ENSEMBLVEP as VCFANNOTATE } from '../../nf-core/vcf_annotate_ensemblvep/main' + + +include { SUMMARIZE_ANNOTATION as SUMANNOTATION } from '../../../modules/local/process_annotation/mutations/main' +include { CUSTOM_MUTATION_PROCESSING as CUSTOMANNOTATION } from '../../../modules/local/process_annotation/mutations_custom/main' +include { VCF2MAF as VCF2MAF } from '../../../modules/local/vcf2maf/main' +include { FILTERBED as FILTERPANEL } from '../../../modules/local/filterbed/main' +include { FILTERBED as FILTEREXONS } from '../../../modules/local/filterbed/main' +include { MERGE_BATCH as MERGEBATCH } from '../../../modules/local/mergemafs/main' +include { FILTER_BATCH as FILTERBATCH } from '../../../modules/local/filtermaf/main' +include { WRITE_MAFS as WRITEMAF } from '../../../modules/local/writemaf/main' +include { SUBSET_MAF as SOMATICMUTATIONS } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as CLEANMUTATIONS } from '../../../modules/local/subsetmaf/main' +include { BLACKLIST_MUTATIONS as BLACKLISTMUTS } from '../../../modules/local/blacklistmuts/main' +include { PLOT_MUTATIONS as PLOTMAF } from '../../../modules/local/plot/mutations_summary/main' +include { PLOT_MUTATIONS as PLOTSOMATICMAF } from '../../../modules/local/plot/mutations_summary/main' +include { PLOT_NEEDLES as PLOTNEEDLES } from '../../../modules/local/plot/needles/main' +include { DOWNSAMPLE_MUTATIONS as DOWNSAMPLEMUTS } from '../../../modules/local/downsample/mutations/main' +include { COMPUTE_CONTAMINATION as CONTAMINATION } from '../../../modules/local/contamination/main' workflow MUTATION_PREPROCESSING { - take: vcfs bedfile @@ -33,25 +32,28 @@ workflow MUTATION_PREPROCESSING { main: - VCFANNOTATE(vcfs, - params.fasta, - params.vep_genome, - params.vep_species, - params.vep_cache_version, - params.vep_cache, - []) + VCFANNOTATE( + vcfs, + params.fasta, + params.vep_genome, + params.vep_species, + params.vep_cache_version, + params.vep_cache, + [], + ) // Join all annotated samples and put them in a channel to be summarized together - VCFANNOTATE.out.tab.map{ it -> it[1] }.collect().map{ it -> [[ id:"all_samples" ], it]}.set{ annotated_samples } + VCFANNOTATE.out.tab.map { it -> it[1] }.collect().map { it -> [[id: "all_samples"], it] }.set { annotated_samples } - hotspots_definition_file = params.hotspots_annotation ? Channel.fromPath( params.hotspots_definition_file, checkIfExists: true).first() : Channel.fromPath(params.input).first() + hotspots_definition_file = params.hotspots_annotation ? Channel.fromPath(params.hotspots_definition_file, checkIfExists: true).first() : Channel.fromPath(params.input).first() SUMANNOTATION(annotated_samples, hotspots_definition_file) if (params.customize_annotation) { // Update impact of mutations in specific regions based on user preferences CUSTOMANNOTATION(SUMANNOTATION.out.tab, custom_annotation_tsv) summary_of_mutations = CUSTOMANNOTATION.out.mutations.first() - } else { + } + else { summary_of_mutations = SUMANNOTATION.out.tab.first() } @@ -62,7 +64,7 @@ workflow MUTATION_PREPROCESSING { FILTERPANEL(FILTEREXONS.out.maf, bedfile) // Join all samples' MAFs and put them in a channel to be merged - FILTERPANEL.out.maf.map{ it -> it[1] }.collect().map{ it -> [[ id:"all_samples" ], it]}.set{ samples_maf } + FILTERPANEL.out.maf.map { it -> it[1] }.collect().map { it -> [[id: "all_samples"], it] }.set { samples_maf } MERGEBATCH(samples_maf) @@ -73,14 +75,15 @@ workflow MUTATION_PREPROCESSING { WRITEMAF(FILTERBATCH.out.cohort_maf, groups) // Here we flatten the output of the WRITEMAF module to have a channel where each item is a sample-maf pair - WRITEMAF.out.mafs.flatten().map{ it -> [ [id : it.name.tokenize('.')[0]] , it] }.set{ named_mafs } + WRITEMAF.out.mafs.flatten().map { it -> [[id: it.name.tokenize('.')[0]], it] }.set { named_mafs } // Remove mutations that are blacklisted if (params.blacklist_mutations) { - blacklist_mutations = Channel.fromPath( params.blacklist_mutations ?: params.input, checkIfExists: true).first() + blacklist_mutations = Channel.fromPath(params.blacklist_mutations ?: params.input, checkIfExists: true).first() BLACKLISTMUTS(named_mafs, blacklist_mutations) _all_clean_mutations = BLACKLISTMUTS.out.mutations - } else { + } + else { _all_clean_mutations = named_mafs } @@ -88,7 +91,8 @@ workflow MUTATION_PREPROCESSING { if (params.downsample) { DOWNSAMPLEMUTS(_all_clean_mutations) all_clean_mutations = DOWNSAMPLEMUTS.out.downsampled_muts - } else { + } + else { all_clean_mutations = _all_clean_mutations } @@ -98,15 +102,17 @@ workflow MUTATION_PREPROCESSING { // Keep only somatic mutations SOMATICMUTATIONS(CLEANMUTATIONS.out.mutations) - + Channel.of([["id": "all_samples"]]) - .join(named_mafs).first() - .set{raw_muts_all_samples} + .join(named_mafs) + .first() + .set { raw_muts_all_samples } Channel.of([["id": "all_samples"]]) - .join(SOMATICMUTATIONS.out.mutations).first() - .set{muts_all_samples} + .join(SOMATICMUTATIONS.out.mutations) + .first() + .set { muts_all_samples } CONTAMINATION(raw_muts_all_samples, muts_all_samples) @@ -126,15 +132,13 @@ workflow MUTATION_PREPROCESSING { // ?- also non mutated sites that do have lots of Ns // bedfiles.sample_discarded - bedfile.set{ bedfile_updated } - + bedfile.set { bedfile_updated } emit: - mafs = named_mafs - somatic_mafs = SOMATICMUTATIONS.out.mutations - clean_mafs = CLEANMUTATIONS.out.mutations - mutations_all_samples = muts_all_samples - all_raw_vep_annotation = SUMANNOTATION.out.tab_all - bedfile_clean = bedfile_updated - + mafs = named_mafs + somatic_mafs = SOMATICMUTATIONS.out.mutations + clean_mafs = CLEANMUTATIONS.out.mutations + mutations_all_samples = muts_all_samples + all_raw_vep_annotation = SUMANNOTATION.out.tab_all + bedfile_clean = bedfile_updated } diff --git a/subworkflows/local/mutationprofile/main.nf b/subworkflows/local/mutationprofile/main.nf index 4c042074..d1d6b325 100644 --- a/subworkflows/local/mutationprofile/main.nf +++ b/subworkflows/local/mutationprofile/main.nf @@ -1,17 +1,15 @@ +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { SUBSET_MAF as SUBSETMUTPROFILE } from '../../../modules/local/subsetmaf/main' -include { SUBSET_MAF as SUBSETMUTPROFILE } from '../../../modules/local/subsetmaf/main' +include { COMPUTE_MATRIX as COMPUTEMATRIX } from '../../../modules/local/mutation_matrix/main' +include { COMPUTE_TRINUCLEOTIDE as COMPUTETRINUC } from '../../../modules/local/compute_trinucleotide/main' -include { COMPUTE_MATRIX as COMPUTEMATRIX } from '../../../modules/local/mutation_matrix/main' -include { COMPUTE_TRINUCLEOTIDE as COMPUTETRINUC } from '../../../modules/local/compute_trinucleotide/main' - -include { COMPUTE_PROFILE as COMPUTEPROFILE } from '../../../modules/local/compute_profile/main' +include { COMPUTE_PROFILE as COMPUTEPROFILE } from '../../../modules/local/compute_profile/main' workflow MUTATIONAL_PROFILE { - take: mutations depth @@ -29,26 +27,25 @@ workflow MUTATIONAL_PROFILE { COMPUTEMATRIX(SUBSETMUTPROFILE.out.mutations) COMPUTEMATRIX.out.per_sample_sigprof - .join( Channel.of([ [ id: "all_samples" ], [] ]) ) - .map{ it -> [ it[0], it[1]] } - .set{ sigprofiler_matrix } + .join(Channel.of([[id: "all_samples"], []])) + .map { it -> [it[0], it[1]] } + .set { sigprofiler_matrix } COMPUTETRINUC(depth) COMPUTEMATRIX.out.matrix - .join(COMPUTETRINUC.out.trinucleotides) - .set{ matrix_n_trinucleotide } + .join(COMPUTETRINUC.out.trinucleotides) + .set { matrix_n_trinucleotide } COMPUTEPROFILE(matrix_n_trinucleotide, wgs_trinuc) sigprofiler_empty = Channel.of([]) sigprofiler_empty - .concat(COMPUTEPROFILE.out.wgs_sigprofiler) - .set{ sigprofiler_wgs } - + .concat(COMPUTEPROFILE.out.wgs_sigprofiler) + .set { sigprofiler_wgs } emit: - profile = COMPUTEPROFILE.out.profile // channel: [ val(meta), file(profile) ] + profile = COMPUTEPROFILE.out.profile // channel: [ val(meta), file(profile) ] matrix_sigprof = sigprofiler_matrix trinucleotides = COMPUTETRINUC.out.trinucleotides wgs_sigprofiler = sigprofiler_wgs diff --git a/subworkflows/local/omega/main.nf b/subworkflows/local/omega/main.nf index f233f189..e43c2766 100644 --- a/subworkflows/local/omega/main.nf +++ b/subworkflows/local/omega/main.nf @@ -1,31 +1,30 @@ -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSETOMEGA } from '../../../modules/local/subsetmaf/main' -include { SUBSET_MAF as SUBSETOMEGAMULTI } from '../../../modules/local/subsetmaf/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { SUBSET_MAF as SUBSETOMEGA } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETOMEGAMULTI } from '../../../modules/local/subsetmaf/main' -include { TABIX_BGZIPTABIX_QUERY as SUBSETPANEL } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { EXPAND_REGIONS as EXPANDREGIONS } from '../../../modules/local/expand_regions/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETPANEL } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { EXPAND_REGIONS as EXPANDREGIONS } from '../../../modules/local/expand_regions/main' -include { OMEGA_PREPROCESS as PREPROCESSING } from '../../../modules/local/bbgtools/omega/preprocess/main' -include { GROUP_GENES as GROUPGENES } from '../../../modules/local/group_genes/main' -include { OMEGA_ESTIMATOR as ESTIMATOR } from '../../../modules/local/bbgtools/omega/estimator/main' -include { OMEGA_MUTABILITIES as ABSOLUTEMUTABILITIES } from '../../../modules/local/bbgtools/omega/mutabilities/main' -include { PLOT_OMEGA as PLOTOMEGA } from '../../../modules/local/plot/omega/main' -include { SITE_COMPARISON as SITECOMPARISON } from '../../../modules/local/bbgtools/sitecomparison/main' -include { SITE_COMPARISON as SITECOMPARISONMULTI } from '../../../modules/local/bbgtools/sitecomparison/main' +include { OMEGA_PREPROCESS as PREPROCESSING } from '../../../modules/local/bbgtools/omega/preprocess/main' +include { GROUP_GENES as GROUPGENES } from '../../../modules/local/group_genes/main' +include { OMEGA_ESTIMATOR as ESTIMATOR } from '../../../modules/local/bbgtools/omega/estimator/main' +include { OMEGA_MUTABILITIES as ABSOLUTEMUTABILITIES } from '../../../modules/local/bbgtools/omega/mutabilities/main' +include { PLOT_OMEGA as PLOTOMEGA } from '../../../modules/local/plot/omega/main' +include { SITE_COMPARISON as SITECOMPARISON } from '../../../modules/local/bbgtools/sitecomparison/main' +include { SITE_COMPARISON as SITECOMPARISONMULTI } from '../../../modules/local/bbgtools/sitecomparison/main' -include { OMEGA_PREPROCESS as PREPROCESSINGGLOBALLOC } from '../../../modules/local/bbgtools/omega/preprocess/main' -include { OMEGA_ESTIMATOR as ESTIMATORGLOBALLOC } from '../../../modules/local/bbgtools/omega/estimator/main' -include { OMEGA_MUTABILITIES as ABSOLUTEMUTABILITIESGLOBALLOC } from '../../../modules/local/bbgtools/omega/mutabilities/main' -include { PLOT_OMEGA as PLOTOMEGAGLOBALLOC } from '../../../modules/local/plot/omega/main' -include { SITE_COMPARISON as SITECOMPARISONGLOBALLOC } from '../../../modules/local/bbgtools/sitecomparison/main' -include { SITE_COMPARISON as SITECOMPARISONGLOBALLOCMULTI } from '../../../modules/local/bbgtools/sitecomparison/main' +include { OMEGA_PREPROCESS as PREPROCESSINGGLOBALLOC } from '../../../modules/local/bbgtools/omega/preprocess/main' +include { OMEGA_ESTIMATOR as ESTIMATORGLOBALLOC } from '../../../modules/local/bbgtools/omega/estimator/main' +include { OMEGA_MUTABILITIES as ABSOLUTEMUTABILITIESGLOBALLOC } from '../../../modules/local/bbgtools/omega/mutabilities/main' +include { PLOT_OMEGA as PLOTOMEGAGLOBALLOC } from '../../../modules/local/plot/omega/main' +include { SITE_COMPARISON as SITECOMPARISONGLOBALLOC } from '../../../modules/local/bbgtools/sitecomparison/main' +include { SITE_COMPARISON as SITECOMPARISONGLOBALLOCMULTI } from '../../../modules/local/bbgtools/sitecomparison/main' -workflow OMEGA_ANALYSIS{ - +workflow OMEGA_ANALYSIS { take: mutations depth @@ -38,12 +37,12 @@ workflow OMEGA_ANALYSIS{ complete_panel exons_file - main: // Create a channel for the domains file if omega_autodomains is true - domains_ch = params.omega_autodomains ? domains_file : [] // .map{ it -> it[1]} : [] - exons_ch = params.omega_autoexons ? exons_file.map{ it -> it[1]} : [] + domains_ch = params.omega_autodomains ? domains_file : [] + // .map{ it -> it[1]} : [] + exons_ch = params.omega_autoexons ? exons_file.map { it -> it[1] } : [] // Create a channel for the hotspots bedfile if provided subgenic_ch = params.omega_subgenic_bedfile ? file(params.omega_subgenic_bedfile) : [] @@ -61,137 +60,149 @@ workflow OMEGA_ANALYSIS{ SUBSETOMEGAMULTI(SUBSETMUTATIONS.out.subset) SUBSETOMEGA.out.mutations - .join( depth ) - .join( profile ) - .set{ muts_n_depths_n_profile } + .join(depth) + .join(profile) + .set { muts_n_depths_n_profile } - Channel.of([ [ id: "all_samples" ] ]) - .join( profile ).first() - .set{ all_samples_mut_profile } + Channel.of([[id: "all_samples"]]) + .join(profile) + .first() + .set { all_samples_mut_profile } - if (params.omega_withingene){ + if (params.omega_withingene) { EXPANDREGIONS(panel, domains_ch, exons_ch, subgenic_ch) expanded_panel = EXPANDREGIONS.out.panel_increased.first() json_hotspots = EXPANDREGIONS.out.new_regions_json.first() - } else { + } + else { expanded_panel = panel.first() json_hotspots = bedfile.first() } // FIXME here I am using bedfile as a dummy value channel - PREPROCESSING( muts_n_depths_n_profile, - expanded_panel, - bedfile, - all_samples_mut_profile) + PREPROCESSING( + muts_n_depths_n_profile, + expanded_panel, + bedfile, + all_samples_mut_profile, + ) PREPROCESSING.out.mutabs_n_mutations_tsv - .join( depth ) - .set{ preprocess_n_depths } + .join(depth) + .set { preprocess_n_depths } - Channel.of([ [ id: "all_samples" ] ]) - .join( PREPROCESSING.out.syn_muts_tsv ) - .set{ all_samples_muts } + Channel.of([[id: "all_samples"]]) + .join(PREPROCESSING.out.syn_muts_tsv) + .set { all_samples_muts } GROUPGENES(all_samples_muts, custom_gene_groups, json_hotspots) - ESTIMATOR( preprocess_n_depths, expanded_panel, GROUPGENES.out.json_genes.first()) + ESTIMATOR(preprocess_n_depths, expanded_panel, GROUPGENES.out.json_genes.first()) - if (params.omega_plot){ + if (params.omega_plot) { SUBSETMUTATIONS.out.subset - .join(ESTIMATOR.out.results) - .set{mutations_n_omega} + .join(ESTIMATOR.out.results) + .set { mutations_n_omega } PLOTOMEGA(mutations_n_omega) } - if (params.omega_mutabilities){ - ABSOLUTEMUTABILITIES(preprocess_n_depths, - expanded_panel, - GROUPGENES.out.json_genes.first()) + if (params.omega_mutabilities) { + ABSOLUTEMUTABILITIES( + preprocess_n_depths, + expanded_panel, + GROUPGENES.out.json_genes.first(), + ) SUBSETOMEGA.out.mutations - .join(ABSOLUTEMUTABILITIES.out.mutabilities) - .set{mutations_n_mutabilities} + .join(ABSOLUTEMUTABILITIES.out.mutabilities) + .set { mutations_n_mutabilities } - SITECOMPARISON(mutations_n_mutabilities, - SUBSETPANEL.out.subset.first()) + SITECOMPARISON( + mutations_n_mutabilities, + SUBSETPANEL.out.subset.first(), + ) site_comparison_results = SITECOMPARISON.out.comparisons SUBSETOMEGAMULTI.out.mutations - .join(ABSOLUTEMUTABILITIES.out.mutabilities) - .set{mutations_n_mutabilities_globalloc} - - SITECOMPARISONMULTI(mutations_n_mutabilities_globalloc, - SUBSETPANEL.out.subset.first()) - // site_comparison_results = site_comparison_results.join(SITECOMPARISONMULTI.out.comparisons, remainder: true) + .join(ABSOLUTEMUTABILITIES.out.mutabilities) + .set { mutations_n_mutabilities_globalloc } + SITECOMPARISONMULTI( + mutations_n_mutabilities_globalloc, + SUBSETPANEL.out.subset.first(), + ) } if (params.omega_globalloc) { - PREPROCESSINGGLOBALLOC(muts_n_depths_n_profile, - expanded_panel, - mutationdensities.first(), - all_samples_mut_profile) + PREPROCESSINGGLOBALLOC( + muts_n_depths_n_profile, + expanded_panel, + mutationdensities.first(), + all_samples_mut_profile, + ) PREPROCESSINGGLOBALLOC.out.mutabs_n_mutations_tsv - .join( depth ) - .set{ preprocess_globalloc_n_depths } + .join(depth) + .set { preprocess_globalloc_n_depths } - ESTIMATORGLOBALLOC(preprocess_globalloc_n_depths, - expanded_panel, - GROUPGENES.out.json_genes.first()) + ESTIMATORGLOBALLOC( + preprocess_globalloc_n_depths, + expanded_panel, + GROUPGENES.out.json_genes.first(), + ) global_loc_results = ESTIMATORGLOBALLOC.out.results - if (params.omega_plot){ + if (params.omega_plot) { SUBSETMUTATIONS.out.subset - .join(ESTIMATORGLOBALLOC.out.results) - .set{mutations_n_omegagloloc} + .join(ESTIMATORGLOBALLOC.out.results) + .set { mutations_n_omegagloloc } PLOTOMEGAGLOBALLOC(mutations_n_omegagloloc) } - if (params.omega_mutabilities){ - ABSOLUTEMUTABILITIESGLOBALLOC(preprocess_globalloc_n_depths, - expanded_panel, - GROUPGENES.out.json_genes.first()) + if (params.omega_mutabilities) { + ABSOLUTEMUTABILITIESGLOBALLOC( + preprocess_globalloc_n_depths, + expanded_panel, + GROUPGENES.out.json_genes.first(), + ) SUBSETOMEGA.out.mutations - .join(ABSOLUTEMUTABILITIESGLOBALLOC.out.mutabilities) - .set{mutations_n_mutabilities_globalloc} + .join(ABSOLUTEMUTABILITIESGLOBALLOC.out.mutabilities) + .set { mutations_n_mutabilities_globalloc } - SITECOMPARISONGLOBALLOC(mutations_n_mutabilities_globalloc, - SUBSETPANEL.out.subset.first()) + SITECOMPARISONGLOBALLOC( + mutations_n_mutabilities_globalloc, + SUBSETPANEL.out.subset.first(), + ) // site_comparison_results = site_comparison_results.join(SITECOMPARISONGLOBALLOC.out.comparisons, remainder: true) SUBSETOMEGAMULTI.out.mutations - .join(ABSOLUTEMUTABILITIESGLOBALLOC.out.mutabilities) - .set{mutations_n_mutabilities_globalloc} + .join(ABSOLUTEMUTABILITIESGLOBALLOC.out.mutabilities) + .set { mutations_n_mutabilities_globalloc } - SITECOMPARISONGLOBALLOCMULTI(mutations_n_mutabilities_globalloc, - SUBSETPANEL.out.subset.first()) - // site_comparison_results = site_comparison_results.join(SITECOMPARISONGLOBALLOCMULTI.out.comparisons, remainder: true) + SITECOMPARISONGLOBALLOCMULTI( + mutations_n_mutabilities_globalloc, + SUBSETPANEL.out.subset.first(), + ) } - } - site_comparison_results.map { - def meta = it[0] - def all_files = it[1..-1].flatten() - [meta, all_files] - }.set{ site_comparison_results_flattened } - - + site_comparison_results + .map { + def meta = it[0] + def all_files = it[1..-1].flatten() + [meta, all_files] + } + .set { site_comparison_results_flattened } emit: results = ESTIMATOR.out.results results_global = global_loc_results expanded_panel = expanded_panel site_comparison = site_comparison_results_flattened - - - // plots = ONCODRIVE3D.out.plots - } diff --git a/subworkflows/local/oncodrive3d/main.nf b/subworkflows/local/oncodrive3d/main.nf index 54a1834b..83f2d746 100644 --- a/subworkflows/local/oncodrive3d/main.nf +++ b/subworkflows/local/oncodrive3d/main.nf @@ -1,18 +1,17 @@ -include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSETONCODRIVE3D } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETONCODRIVE3D } from '../../../modules/local/subsetmaf/main' -include { ONCODRIVE3D_PREPROCESSING } from '../../../modules/local/bbgtools/oncodrive3d/preprocessing/main' -include { ONCODRIVE3D_RUN } from '../../../modules/local/bbgtools/oncodrive3d/run/main' -include { ONCODRIVE3D_PLOT } from '../../../modules/local/bbgtools/oncodrive3d/plot/main' -include { ONCODRIVE3D_PLOT_CHIMERAX } from '../../../modules/local/bbgtools/oncodrive3d/plot_chimerax/main' +include { ONCODRIVE3D_PREPROCESSING } from '../../../modules/local/bbgtools/oncodrive3d/preprocessing/main' +include { ONCODRIVE3D_RUN } from '../../../modules/local/bbgtools/oncodrive3d/run/main' +include { ONCODRIVE3D_PLOT } from '../../../modules/local/bbgtools/oncodrive3d/plot/main' +include { ONCODRIVE3D_PLOT_CHIMERAX } from '../../../modules/local/bbgtools/oncodrive3d/plot_chimerax/main' // include { ONCODRIVE3D_COMP_PLOT } from '../../../modules/local/bbgtools/oncodrive3d/comparative_plot/main' -workflow ONCODRIVE3D_ANALYSIS{ - +workflow ONCODRIVE3D_ANALYSIS { take: mutations mutabilities @@ -28,17 +27,16 @@ workflow ONCODRIVE3D_ANALYSIS{ // mutations preprocessing - if (params.o3d_raw_vep){ + if (params.o3d_raw_vep) { ONCODRIVE3D_PREPROCESSING(SUBSETONCODRIVE3D.out.mutations, raw_vep) ONCODRIVE3D_PREPROCESSING.out.vep_output4o3d - .join(mutabilities) - .set{ muts_n_mutability } - - } else { + .join(mutabilities) + .set { muts_n_mutability } + } + else { SUBSETONCODRIVE3D.out.mutations - .join(mutabilities) - .set{ muts_n_mutability } - + .join(mutabilities) + .set { muts_n_mutability } } @@ -53,38 +51,21 @@ workflow ONCODRIVE3D_ANALYSIS{ ONCODRIVE3D_RUN(muts_n_mutability, datasets) if (params.o3d_plot) { - ONCODRIVE3D_PLOT(ONCODRIVE3D_RUN.out.csv_genes - | join(ONCODRIVE3D_RUN.out.csv_pos) - | join(ONCODRIVE3D_RUN.out.mut_processed) - | join(ONCODRIVE3D_RUN.out.prob_processed) - | join(ONCODRIVE3D_RUN.out.seq_processed), - datasets, - annotations) + ONCODRIVE3D_PLOT( + ONCODRIVE3D_RUN.out.csv_genes | join(ONCODRIVE3D_RUN.out.csv_pos) | join(ONCODRIVE3D_RUN.out.mut_processed) | join(ONCODRIVE3D_RUN.out.prob_processed) | join(ONCODRIVE3D_RUN.out.seq_processed), + datasets, + annotations, + ) } if (params.o3d_plot_chimerax) { - ONCODRIVE3D_PLOT_CHIMERAX(ONCODRIVE3D_RUN.out.csv_genes - | join(ONCODRIVE3D_RUN.out.csv_pos) - | join(ONCODRIVE3D_RUN.out.prob_processed) - | join(ONCODRIVE3D_RUN.out.seq_processed), - datasets) + ONCODRIVE3D_PLOT_CHIMERAX( + ONCODRIVE3D_RUN.out.csv_genes | join(ONCODRIVE3D_RUN.out.csv_pos) | join(ONCODRIVE3D_RUN.out.prob_processed) | join(ONCODRIVE3D_RUN.out.seq_processed), + datasets, + ) } - emit: - - results = ONCODRIVE3D_RUN.out.csv_genes - results_pos = ONCODRIVE3D_RUN.out.csv_pos - // files_mut = ONCODRIVE3D_RUN.out.mut_processed - // files_prob = ONCODRIVE3D_RUN.out.prob_processed - // files_seq = ONCODRIVE3D_RUN.out.seq_processed - // genes_plot = ONCODRIVE3D_PLOT.out.genes_plot - // summary_plot = ONCODRIVE3D_PLOT.out.logodds_plot - // volcano_plot = ONCODRIVE3D_PLOT.out.volcano_plot - // volcano_plot_gene = ONCODRIVE3D_PLOT.out.volcano_plot_gene - // results_pos_annot = ONCODRIVE3D_PLOT.out.pos_annotated_csv - // chimerax_defattr = ONCODRIVE3D_PLOT_CHIMERAX.out.chimerax_defattr - // chimerax_plot = ONCODRIVE3D_PLOT_CHIMERAX.out.chimerax_plot - // log_files = ONCODRIVE3D_RUN.out.log.mix(ONCODRIVE3D_PLOT.out.log, ONCODRIVE3D_PLOT_CHIMERAX.out.log) - + results = ONCODRIVE3D_RUN.out.csv_genes + results_pos = ONCODRIVE3D_RUN.out.csv_pos } diff --git a/subworkflows/local/oncodriveclustl/main.nf b/subworkflows/local/oncodriveclustl/main.nf index 9639cf42..c3d5962b 100644 --- a/subworkflows/local/oncodriveclustl/main.nf +++ b/subworkflows/local/oncodriveclustl/main.nf @@ -1,14 +1,13 @@ -include { CREATECUSTOMBEDFILE as ONCODRIVECLUSTLBED } from '../../../modules/local/createpanels/custombedfile/main' +include { CREATECUSTOMBEDFILE as ONCODRIVECLUSTLBED } from '../../../modules/local/createpanels/custombedfile/main' -include { SUBSET_MAF as SUBSETONCODRIVECLUSTL } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETONCODRIVECLUSTL } from '../../../modules/local/subsetmaf/main' -include { ONCODRIVECLUSTL } from '../../../modules/local/bbgtools/oncodriveclustl/main' +include { ONCODRIVECLUSTL } from '../../../modules/local/bbgtools/oncodriveclustl/main' // include { ONCODRIVECLUSTL as ONCODRIVECLUSTLSNVS } from '../../../modules/local/bbgtools/oncodriveclustl/main' -workflow ONCODRIVECLUSTL_ANALYSIS{ - +workflow ONCODRIVECLUSTL_ANALYSIS { take: mutations mutabilities @@ -21,13 +20,11 @@ workflow ONCODRIVECLUSTL_ANALYSIS{ SUBSETONCODRIVECLUSTL(mutations) SUBSETONCODRIVECLUSTL.out.mutations - .join(mutabilities) - .set{ muts_n_mutability } + .join(mutabilities) + .set { muts_n_mutability } - ONCODRIVECLUSTL(muts_n_mutability, ONCODRIVECLUSTLBED.out.bed) - // ONCODRIVECLUSTLSNVS(muts_n_mutability, ONCODRIVECLUSTLBED.out.bed) + ONCODRIVECLUSTL(muts_n_mutability, ONCODRIVECLUSTLBED.out.bed) emit: - results = ONCODRIVECLUSTL.out.tsv // channel: [ val(meta), file(results) ] - // results_snvs = ONCODRIVECLUSTLSNVS.out.tsv // channel: [ val(meta), file(results) ] + results = ONCODRIVECLUSTL.out.tsv // channel: [ val(meta), file(results) ] } diff --git a/subworkflows/local/oncodrivefml/main.nf b/subworkflows/local/oncodrivefml/main.nf index ecd17a87..6790aca9 100644 --- a/subworkflows/local/oncodrivefml/main.nf +++ b/subworkflows/local/oncodrivefml/main.nf @@ -1,13 +1,12 @@ -include { CREATECUSTOMBEDFILE as ONCODRIVEFMLBED } from '../../../modules/local/createpanels/custombedfile/main' +include { CREATECUSTOMBEDFILE as ONCODRIVEFMLBED } from '../../../modules/local/createpanels/custombedfile/main' -include { SUBSET_MAF as SUBSETONCODRIVEFML } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETONCODRIVEFML } from '../../../modules/local/subsetmaf/main' -include { ONCODRIVEFML as ONCODRIVEFMLSNVS } from '../../../modules/local/bbgtools/oncodrivefml/main' +include { ONCODRIVEFML as ONCODRIVEFMLSNVS } from '../../../modules/local/bbgtools/oncodrivefml/main' -workflow ONCODRIVEFML_ANALYSIS{ - +workflow ONCODRIVEFML_ANALYSIS { take: mutations mutabilities @@ -21,13 +20,12 @@ workflow ONCODRIVEFML_ANALYSIS{ SUBSETONCODRIVEFML(mutations) SUBSETONCODRIVEFML.out.mutations - .join( mutabilities ) - .set{ muts_n_mutability } + .join(mutabilities) + .set { muts_n_mutability } - ONCODRIVEFMLSNVS(muts_n_mutability, ONCODRIVEFMLBED.out.bed, cadd_scores, mode) + ONCODRIVEFMLSNVS(muts_n_mutability, ONCODRIVEFMLBED.out.bed, cadd_scores, mode) emit: - results_snvs = ONCODRIVEFMLSNVS.out.tsv // channel: [ val(meta), file(results) ] - results_snvs_folder = ONCODRIVEFMLSNVS.out.folder // channel: [ val(meta), file(results) ] - + results_snvs = ONCODRIVEFMLSNVS.out.tsv // channel: [ val(meta), file(results) ] + results_snvs_folder = ONCODRIVEFMLSNVS.out.folder // channel: [ val(meta), file(results) ] } diff --git a/subworkflows/local/plotdepths/main.nf b/subworkflows/local/plotdepths/main.nf index bd57e1d6..5473b274 100644 --- a/subworkflows/local/plotdepths/main.nf +++ b/subworkflows/local/plotdepths/main.nf @@ -1,12 +1,11 @@ -include { TABIX_BGZIPTABIX_QUERY as SUBSETDEPTHS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as SUBSETDEPTHS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { PLOT_DEPTHS as DEPTHSSUMMARY } from '../../../modules/local/plot/depths_summary/main' +include { PLOT_DEPTHS as DEPTHSSUMMARY } from '../../../modules/local/plot/depths_summary/main' -include { CREATECUSTOMBEDFILE as ONCODRIVEFMLBED } from '../../../modules/local/createpanels/custombedfile/main' +include { CREATECUSTOMBEDFILE as ONCODRIVEFMLBED } from '../../../modules/local/createpanels/custombedfile/main' workflow PLOT_DEPTHS { - take: depth bedfile @@ -19,11 +18,9 @@ workflow PLOT_DEPTHS { ONCODRIVEFMLBED(panel) - DEPTHSSUMMARY(SUBSETDEPTHS.out.subset, ONCODRIVEFMLBED.out.bed) - + DEPTHSSUMMARY(SUBSETDEPTHS.out.subset, ONCODRIVEFMLBED.out.bed) emit: - plots = DEPTHSSUMMARY.out.plots - average_depth = DEPTHSSUMMARY.out.average_per_sample - + plots = DEPTHSSUMMARY.out.plots + average_depth = DEPTHSSUMMARY.out.average_per_sample } diff --git a/subworkflows/local/plottingsummary/main.nf b/subworkflows/local/plottingsummary/main.nf index 8c4838a9..dacd7888 100644 --- a/subworkflows/local/plottingsummary/main.nf +++ b/subworkflows/local/plottingsummary/main.nf @@ -1,15 +1,13 @@ - -include { PLOT_SELECTION_METRICS as PLOTSELECTION } from '../../../modules/local/plot/selection_metrics/main' -include { PLOT_SATURATION as PLOTSATURATION } from '../../../modules/local/plot/saturation/main' +include { PLOT_SELECTION_METRICS as PLOTSELECTION } from '../../../modules/local/plot/selection_metrics/main' +include { PLOT_SATURATION as PLOTSATURATION } from '../../../modules/local/plot/saturation/main' // include { PLOT_INTERINDIVIDUAL_VARIABILITY as PLOTINTERINDIVIDUALVARIABILITY } from '../../../modules/local/plot/selection_metrics/main' // include { PLOT_METRICS_QC as PLOTMETRICSQC } from '../../../modules/local/plot/selection_metrics/main' workflow PLOTTING_SUMMARY { - take: positive_selection_results_ready all_mutrates @@ -23,59 +21,33 @@ workflow PLOTTING_SUMMARY { domain_df exons_depths_df - main: - pdb_tool_df = params.annotations3d - ? Channel.fromPath( "${params.annotations3d}/pdb_tool_df.tsv", checkIfExists: true).first() - : Channel.empty() + pdb_tool_df = params.annotations3d + ? Channel.fromPath("${params.annotations3d}/pdb_tool_df.tsv", checkIfExists: true).first() + : Channel.empty() // think if we want to include this here // PLOTNEEDLES(muts_all_samples, sequence_information_df) // plotting only for the entire cohort group - Channel.of([ [ id: "all_samples" ] ]) - .join( positive_selection_results_ready ) - .set{ all_samples_results } + Channel.of([[id: "all_samples"]]) + .join(positive_selection_results_ready) + .set { all_samples_results } PLOTSELECTION(all_samples_results, seqinfo_df) // needles with consequence type // plot selection at cohort/group level, all the different methods available // plot selection per domain at cohort level - Channel.of([ [ id: "all_samples" ] ]) - .join( site_comparison ) - .set{ all_samples_sites } + Channel.of([[id: "all_samples"]]) + .join(site_comparison) + .set { all_samples_sites } PLOTSATURATION(all_samples_results, all_samples_depth, all_samples_sites, panel, seqinfo_df, pdb_tool_df, domain_df, exons_depths_df) - // plot gene + site selection - // omega selection per domain in gene - // ? plot saturation kinetics curves - - - - // PLOTMETRICSQC(all_mutrates, ) - // // mutation density per gene cohort-level - // // mutation density per gene & sample - // // synonymous - // // protein-affecting - // // truncating - // // missense - - - // PLOTINTERINDIVIDUALVARIABILITY() - // // heatmap driver mutations per gene/sample - // // other heatmaps: - // // mutation density - // // mutation burden - // // omega - // // siteselection per group - // // define features based on PLOTMETRICSQC() - emit: - selection_plots = PLOTSELECTION.out.plots - saturation_plots = PLOTSATURATION.out.plots - + selection_plots = PLOTSELECTION.out.plots + saturation_plots = PLOTSATURATION.out.plots } diff --git a/subworkflows/local/regressions/main.nf b/subworkflows/local/regressions/main.nf index 80b8f80c..96333361 100644 --- a/subworkflows/local/regressions/main.nf +++ b/subworkflows/local/regressions/main.nf @@ -1,10 +1,9 @@ -include { RUNREGRESSIONS as RUNREGRESSIONSCOHORT } from '../../../modules/local/runregressions/main' -include { RUNREGRESSIONS as RUNREGRESSIONSIGNORE } from '../../../modules/local/runregressions/main' -include { RUNREGRESSIONS as RUNREGRESSIONSMEAN } from '../../../modules/local/runregressions/main' +include { RUNREGRESSIONS as RUNREGRESSIONSCOHORT } from '../../../modules/local/runregressions/main' +include { RUNREGRESSIONS as RUNREGRESSIONSIGNORE } from '../../../modules/local/runregressions/main' +include { RUNREGRESSIONS as RUNREGRESSIONSMEAN } from '../../../modules/local/runregressions/main' -workflow REGRESSIONS{ - +workflow REGRESSIONS { take: metric_name metric_data @@ -15,38 +14,48 @@ workflow REGRESSIONS{ predictors_file = file(params.predictors_file_regressions) - RUNREGRESSIONSCOHORT(metric_name, - metric_data, metric_params, - params.responses_subset_regressions, params.responses_excluded_regressions, - params.samples_subset_regressions, - predictors_file, params.predictors_plot_config_regressions, - params.multipletesting_join_regressions, - params.multivariate_rules_regressions - ) - - - RUNREGRESSIONSIGNORE(metric_name, - metric_data, metric_params, - params.responses_subset_regressions, params.responses_excluded_regressions, - params.samples_subset_regressions, - predictors_file, params.predictors_plot_config_regressions, - params.multipletesting_join_regressions, - params.multivariate_rules_regressions - ) - - - RUNREGRESSIONSMEAN(metric_name, - metric_data, metric_params, - params.responses_subset_regressions, params.responses_excluded_regressions, - params.samples_subset_regressions, - predictors_file, params.predictors_plot_config_regressions, - params.multipletesting_join_regressions, - params.multivariate_rules_regressions - ) - + RUNREGRESSIONSCOHORT( + metric_name, + metric_data, + metric_params, + params.responses_subset_regressions, + params.responses_excluded_regressions, + params.samples_subset_regressions, + predictors_file, + params.predictors_plot_config_regressions, + params.multipletesting_join_regressions, + params.multivariate_rules_regressions, + ) + + + RUNREGRESSIONSIGNORE( + metric_name, + metric_data, + metric_params, + params.responses_subset_regressions, + params.responses_excluded_regressions, + params.samples_subset_regressions, + predictors_file, + params.predictors_plot_config_regressions, + params.multipletesting_join_regressions, + params.multivariate_rules_regressions, + ) + + + RUNREGRESSIONSMEAN( + metric_name, + metric_data, + metric_params, + params.responses_subset_regressions, + params.responses_excluded_regressions, + params.samples_subset_regressions, + predictors_file, + params.predictors_plot_config_regressions, + params.multipletesting_join_regressions, + params.multivariate_rules_regressions, + ) emit: - res_pdf = RUNREGRESSIONSCOHORT.out.res_pdf + res_pdf = RUNREGRESSIONSCOHORT.out.res_pdf res_tables = RUNREGRESSIONSCOHORT.out.res_tables - } diff --git a/subworkflows/local/signatures/main.nf b/subworkflows/local/signatures/main.nf index 5f483c60..980cd642 100644 --- a/subworkflows/local/signatures/main.nf +++ b/subworkflows/local/signatures/main.nf @@ -1,8 +1,8 @@ -include { MATRIX_CONCAT as MATRIXCONCATWGS } from '../../../modules/local/sig_matrix_concat/main' -include { SIGPROFILERASSIGNMENT } from '../../../modules/local/signatures/sigprofiler/assignment/main' -include { SIGNATURES_PROBABILITIES as SIGPROBS } from '../../../modules/local/combine_sbs/main' +include { MATRIX_CONCAT as MATRIXCONCATWGS } from '../../../modules/local/sig_matrix_concat/main' +include { SIGPROFILERASSIGNMENT } from '../../../modules/local/signatures/sigprofiler/assignment/main' +include { SIGNATURES_PROBABILITIES as SIGPROBS } from '../../../modules/local/combine_sbs/main' // include { MSIGHDP } from '../../../modules/local/signatures/msighdp/main' -include { HDP_EXTRACTION as HDPEXTRACTION } from '../signatures_hdp/main' +include { HDP_EXTRACTION as HDPEXTRACTION } from '../signatures_hdp/main' workflow SIGNATURES { @@ -13,39 +13,35 @@ workflow SIGNATURES { main: // actual code - matrix_wgs.map{ it -> it[1] }.collect().map{ it -> [[ id:"all_samples" ], it]}.set{ all_matrices_wgs } + matrix_wgs.map { it -> it[1] }.collect().map { it -> [[id: "all_samples"], it] }.set { all_matrices_wgs } MATRIXCONCATWGS(all_matrices_wgs, samples) - MATRIXCONCATWGS.out.wgs_tsv.flatten() - .map{ it -> - def parts = it.name.tokenize('.') - [ [id: parts[0]], parts[1], it ] - } - .set{ named_matrices_wgs } - - MATRIXCONCATWGS.out.wgs_tsv_hdp.flatten() - .map{ it -> - def parts = it.name.tokenize('.') - [ [id: parts[0]], parts[1], it ] - } - .set{ named_matrices_wgs_hdp } + MATRIXCONCATWGS.out.wgs_tsv + .flatten() + .map { it -> + def parts = it.name.tokenize('.') + [[id: parts[0]], parts[1], it] + } + .set { named_matrices_wgs } + + MATRIXCONCATWGS.out.wgs_tsv_hdp + .flatten() + .map { it -> + def parts = it.name.tokenize('.') + [[id: parts[0]], parts[1], it] + } + .set { named_matrices_wgs_hdp } SIGPROFILERASSIGNMENT(named_matrices_wgs, reference_signatures) - SIGPROFILERASSIGNMENT.out.mutation_probs.map{ it -> it[1] }.collect().map{ it -> [[ id: "all_samples" ], it]}.set{ all_sigs_probs } + SIGPROFILERASSIGNMENT.out.mutation_probs.map { it -> it[1] }.collect().map { it -> [[id: "all_samples"], it] }.set { all_sigs_probs } SIGPROBS(all_sigs_probs) - SIGPROBS.out.signature_probs.flatten().map{ it -> [ [id : it.name.tokenize('.')[0]] , it] }.set{ signature_probs_samples } + SIGPROBS.out.signature_probs.flatten().map { it -> [[id: it.name.tokenize('.')[0]], it] }.set { signature_probs_samples } HDPEXTRACTION(named_matrices_wgs_hdp, reference_signatures) - // matrix.map{ it -> it[1] }.collect().map{ it -> [[ id:"all_samples" ], it]}.set{ all_matrices } - // MATRIXCONCAT(all_matrices, samples) - // MATRIXCONCAT.out.wgs_tsv.flatten().map{ it -> [ [id : it.name.tokenize('.')[0]] , it] }.set{ named_matrices } - // MSIGHDP(matrix) - emit: - plots = SIGPROFILERASSIGNMENT.out.plots // channel: [ val(meta), file(depths) ] - // plots_extraction = MSIGHDP.out.plots // channel: [ val(meta), file(depths) ] - mutation_probs = signature_probs_samples + plots = SIGPROFILERASSIGNMENT.out.plots // channel: [ val(meta), file(depths) ] + mutation_probs = signature_probs_samples } diff --git a/subworkflows/local/signatures_hdp/main.nf b/subworkflows/local/signatures_hdp/main.nf index 5ec77fa0..0323a79a 100644 --- a/subworkflows/local/signatures_hdp/main.nf +++ b/subworkflows/local/signatures_hdp/main.nf @@ -1,25 +1,24 @@ -include { PREPARE_INPUT } from '../../../modules/local/signatures/hdp/prepareinput/main' -include { RUN_HDP_CHAIN_SAMPLING } from '../../../modules/local/signatures/hdp/chainsampling/main' +include { PREPARE_INPUT } from '../../../modules/local/signatures/hdp/prepareinput/main' +include { RUN_HDP_CHAIN_SAMPLING } from '../../../modules/local/signatures/hdp/chainsampling/main' // include { NORMALIZE_SIGNATURES } from '../../../modules/local/signatures/hdp/normalize_sigs/main' -include { PROCESS_HDP_RESULTS } from '../../../modules/local/signatures/hdp/process_results/main' +include { PROCESS_HDP_RESULTS } from '../../../modules/local/signatures/hdp/process_results/main' // include { COMPARE_SIGNATURES as COMPARENORMALIZEDSIGNATURES } from '../../../modules/local/signatures/hdp/compare_sigs/main' -include { COMPARE_SIGNATURES as COMPARESIGNATURES } from '../../../modules/local/signatures/hdp/compare_sigs/main' +include { COMPARE_SIGNATURES as COMPARESIGNATURES } from '../../../modules/local/signatures/hdp/compare_sigs/main' // include { COMPARE_SIGNATURES as COMPARECANCERSIGNATURES } from '../../../modules/local/signatures/hdp/compare_sigs/main' workflow HDP_EXTRACTION { - take: matrix reference_signatures main: - Channel.of([ [ id: "samples_matrix" ] ]) - .join( matrix ) - .set{ samples_matrix } + Channel.of([[id: "samples_matrix"]]) + .join(matrix) + .set { samples_matrix } PREPARE_INPUT(samples_matrix) @@ -43,12 +42,4 @@ workflow HDP_EXTRACTION { // } COMPARESIGNATURES(PROCESS_HDP_RESULTS.out.processed_results, reference_signatures) - - // final_results_ch = COMPARECANCERSIGNATURES(compared_results_ch, reference_signatures) - - - // emit: - // plots = SIGPROFILERASSIGNMENT.out.plots // channel: [ val(meta), file(depths) ] - // // plots_extraction = MSIGHDP.out.plots // channel: [ val(meta), file(depths) ] - // mutation_probs = signature_probs_samples } diff --git a/subworkflows/local/utils_nfcore_deepcsa/main.nf b/subworkflows/local/utils_nfcore_deepcsa/main.nf index 6086d29b..4a7cdd03 100644 --- a/subworkflows/local/utils_nfcore_deepcsa/main.nf +++ b/subworkflows/local/utils_nfcore_deepcsa/main.nf @@ -23,7 +23,6 @@ include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline' */ workflow PIPELINE_INITIALISATION { - take: version // boolean: Display version and exit help // boolean: Display help text @@ -39,39 +38,38 @@ workflow PIPELINE_INITIALISATION { // // Print version and exit if required and dump pipeline parameters to JSON file // - UTILS_NEXTFLOW_PIPELINE ( + UTILS_NEXTFLOW_PIPELINE( version, true, outdir, - workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1 + workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1, ) // // Validate parameters and generate parameter summary to stdout // - pre_help_text = logo(monochrome_logs) + pre_help_text = logo(monochrome_logs) post_help_text = '\n' + citation(workflow) + '\n' def workflow_command = "nextflow run ${workflow.manifest.name} -profile --input path/to/input/ --outdir path/to/output/" - UTILS_NFVALIDATION_PLUGIN ( + UTILS_NFVALIDATION_PLUGIN( help, workflow_command, pre_help_text, post_help_text, validate_params, - "nextflow_schema.json" + "nextflow_schema.json", ) // // Check config provided to the pipeline // - UTILS_NFCORE_PIPELINE ( + UTILS_NFCORE_PIPELINE( nextflow_cli_args ) - emit: - versions = ch_versions + versions = ch_versions } /* @@ -81,7 +79,6 @@ workflow PIPELINE_INITIALISATION { */ workflow PIPELINE_COMPLETION { - take: email // string: email address email_on_fail // string: email address sent on pipeline failure @@ -124,12 +121,12 @@ def validateInputSamplesheet(input) { def (metas, fastqs) = input[1..2] // Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end - def endedness_ok = metas.collect{ it.single_end }.unique().size == 1 + def endedness_ok = metas.collect { it.single_end }.unique().size == 1 if (!endedness_ok) { error("Please check input samplesheet -> Multiple runs of a sample must be of the same datatype i.e. single-end or paired-end: ${metas[0].id}") } - return [ metas[0], fastqs ] + return [metas[0], fastqs] } // @@ -140,11 +137,11 @@ def toolCitationText() { // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "Tool (Foo et al. 2023)" : "", // Uncomment function in methodsDescriptionText to render in MultiQC report def citation_text = [ - "Tools used in the workflow included:", - "FastQC (Andrews 2010),", - "MultiQC (Ewels et al. 2016)", - "." - ].join(' ').trim() + "Tools used in the workflow included:", + "FastQC (Andrews 2010),", + "MultiQC (Ewels et al. 2016)", + ".", + ].join(' ').trim() return citation_text } @@ -154,9 +151,9 @@ def toolBibliographyText() { // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "
  • Author (2023) Pub name, Journal, DOI
  • " : "", // Uncomment function in methodsDescriptionText to render in MultiQC report def reference_text = [ - "
  • Andrews S, (2010) FastQC, URL: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/).
  • ", - "
  • Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354
  • " - ].join(' ').trim() + "
  • Andrews S, (2010) FastQC, URL: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/).
  • ", + "
  • Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354
  • ", + ].join(' ').trim() return reference_text } @@ -169,7 +166,7 @@ def methodsDescriptionText(mqc_methods_yaml) { // Pipeline DOI meta["doi_text"] = meta.manifest_map.doi ? "(doi: ${meta.manifest_map.doi})" : "" - meta["nodoi_text"] = meta.manifest_map.doi ? "": "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " + meta["nodoi_text"] = meta.manifest_map.doi ? "" : "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " // Tool references meta["tool_citations"] = "" @@ -182,7 +179,7 @@ def methodsDescriptionText(mqc_methods_yaml) { def methods_text = mqc_methods_yaml.text - def engine = new groovy.text.SimpleTemplateEngine() + def engine = new groovy.text.SimpleTemplateEngine() def description_html = engine.createTemplate(methods_text).make(meta) return description_html.toString() @@ -212,12 +209,5 @@ Y88b 888 Y8b. Y8b. 888 d88P Y88b d88P Y88b d88P d8888888888 def citation(workflow) { - return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + - // TODO nf-core: Add Zenodo DOI for pipeline after first release - //"* The pipeline\n" + - //" https://doi.org/10.5281/zenodo.XXXXXXX\n\n" + - "* The nf-core framework\n" + - " https://doi.org/10.1038/s41587-020-0439-x\n\n" + - "* Software dependencies\n" + - " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" + return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + "* The nf-core framework\n" + " https://doi.org/10.1038/s41587-020-0439-x\n\n" + "* Software dependencies\n" + " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" } diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/main.nf b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf index d6e593e8..fbb0e09c 100644 --- a/subworkflows/nf-core/utils_nextflow_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf @@ -72,10 +72,10 @@ def getWorkflowVersion() { // def dumpParametersToJSON(outdir) { def timestamp = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss') - def filename = "params_${timestamp}.json" - def temp_pf = new File(workflow.launchDir.toString(), ".${filename}") - def jsonStr = groovy.json.JsonOutput.toJson(params) - temp_pf.text = groovy.json.JsonOutput.prettyPrint(jsonStr) + def filename = "params_${timestamp}.json" + def temp_pf = new File(workflow.launchDir.toString(), ".${filename}") + def jsonStr = groovy.json.JsonOutput.toJson(params) + temp_pf.text = groovy.json.JsonOutput.prettyPrint(jsonStr) nextflow.extension.FilesEx.copyTo(temp_pf.toPath(), "${outdir}/pipeline_info/params_${timestamp}.json") temp_pf.delete() @@ -111,7 +111,8 @@ def checkCondaChannels() { def channel_priority_violation = required_channels_in_order != channels.findAll { ch -> ch in required_channels_in_order } if (channels_missing | channel_priority_violation) { - log.warn """\ + log.warn( + """\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There is a problem with your Conda configuration! You will need to set-up the conda-forge and bioconda channels correctly. @@ -122,5 +123,6 @@ def checkCondaChannels() { ${required_channels_in_order} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" """.stripIndent(true) + ) } } diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index bfd25876..d8d6c219 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -125,12 +125,12 @@ def paramsSummaryMultiqc(summary_params) { } def yaml_file_text = "id: '${workflow.manifest.name.replace('/', '-')}-summary'\n" as String - yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" - yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\n" - yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" - yaml_file_text += "plot_type: 'html'\n" - yaml_file_text += "data: |\n" - yaml_file_text += "${summary_section}" + yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" + yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\n" + yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" + yaml_file_text += "plot_type: 'html'\n" + yaml_file_text += "data: |\n" + yaml_file_text += "${summary_section}" return yaml_file_text } @@ -138,67 +138,67 @@ def paramsSummaryMultiqc(summary_params) { // // ANSII colours used for terminal logging // -def logColours(monochrome_logs=true) { +def logColours(monochrome_logs = true) { def colorcodes = [:] as Map // Reset / Meta - colorcodes['reset'] = monochrome_logs ? '' : "\033[0m" - colorcodes['bold'] = monochrome_logs ? '' : "\033[1m" - colorcodes['dim'] = monochrome_logs ? '' : "\033[2m" + colorcodes['reset'] = monochrome_logs ? '' : "\033[0m" + colorcodes['bold'] = monochrome_logs ? '' : "\033[1m" + colorcodes['dim'] = monochrome_logs ? '' : "\033[2m" colorcodes['underlined'] = monochrome_logs ? '' : "\033[4m" - colorcodes['blink'] = monochrome_logs ? '' : "\033[5m" - colorcodes['reverse'] = monochrome_logs ? '' : "\033[7m" - colorcodes['hidden'] = monochrome_logs ? '' : "\033[8m" + colorcodes['blink'] = monochrome_logs ? '' : "\033[5m" + colorcodes['reverse'] = monochrome_logs ? '' : "\033[7m" + colorcodes['hidden'] = monochrome_logs ? '' : "\033[8m" // Regular Colors - colorcodes['black'] = monochrome_logs ? '' : "\033[0;30m" - colorcodes['red'] = monochrome_logs ? '' : "\033[0;31m" - colorcodes['green'] = monochrome_logs ? '' : "\033[0;32m" + colorcodes['black'] = monochrome_logs ? '' : "\033[0;30m" + colorcodes['red'] = monochrome_logs ? '' : "\033[0;31m" + colorcodes['green'] = monochrome_logs ? '' : "\033[0;32m" colorcodes['yellow'] = monochrome_logs ? '' : "\033[0;33m" - colorcodes['blue'] = monochrome_logs ? '' : "\033[0;34m" + colorcodes['blue'] = monochrome_logs ? '' : "\033[0;34m" colorcodes['purple'] = monochrome_logs ? '' : "\033[0;35m" - colorcodes['cyan'] = monochrome_logs ? '' : "\033[0;36m" - colorcodes['white'] = monochrome_logs ? '' : "\033[0;37m" + colorcodes['cyan'] = monochrome_logs ? '' : "\033[0;36m" + colorcodes['white'] = monochrome_logs ? '' : "\033[0;37m" // Bold - colorcodes['bblack'] = monochrome_logs ? '' : "\033[1;30m" - colorcodes['bred'] = monochrome_logs ? '' : "\033[1;31m" - colorcodes['bgreen'] = monochrome_logs ? '' : "\033[1;32m" + colorcodes['bblack'] = monochrome_logs ? '' : "\033[1;30m" + colorcodes['bred'] = monochrome_logs ? '' : "\033[1;31m" + colorcodes['bgreen'] = monochrome_logs ? '' : "\033[1;32m" colorcodes['byellow'] = monochrome_logs ? '' : "\033[1;33m" - colorcodes['bblue'] = monochrome_logs ? '' : "\033[1;34m" + colorcodes['bblue'] = monochrome_logs ? '' : "\033[1;34m" colorcodes['bpurple'] = monochrome_logs ? '' : "\033[1;35m" - colorcodes['bcyan'] = monochrome_logs ? '' : "\033[1;36m" - colorcodes['bwhite'] = monochrome_logs ? '' : "\033[1;37m" + colorcodes['bcyan'] = monochrome_logs ? '' : "\033[1;36m" + colorcodes['bwhite'] = monochrome_logs ? '' : "\033[1;37m" // Underline - colorcodes['ublack'] = monochrome_logs ? '' : "\033[4;30m" - colorcodes['ured'] = monochrome_logs ? '' : "\033[4;31m" - colorcodes['ugreen'] = monochrome_logs ? '' : "\033[4;32m" + colorcodes['ublack'] = monochrome_logs ? '' : "\033[4;30m" + colorcodes['ured'] = monochrome_logs ? '' : "\033[4;31m" + colorcodes['ugreen'] = monochrome_logs ? '' : "\033[4;32m" colorcodes['uyellow'] = monochrome_logs ? '' : "\033[4;33m" - colorcodes['ublue'] = monochrome_logs ? '' : "\033[4;34m" + colorcodes['ublue'] = monochrome_logs ? '' : "\033[4;34m" colorcodes['upurple'] = monochrome_logs ? '' : "\033[4;35m" - colorcodes['ucyan'] = monochrome_logs ? '' : "\033[4;36m" - colorcodes['uwhite'] = monochrome_logs ? '' : "\033[4;37m" + colorcodes['ucyan'] = monochrome_logs ? '' : "\033[4;36m" + colorcodes['uwhite'] = monochrome_logs ? '' : "\033[4;37m" // High Intensity - colorcodes['iblack'] = monochrome_logs ? '' : "\033[0;90m" - colorcodes['ired'] = monochrome_logs ? '' : "\033[0;91m" - colorcodes['igreen'] = monochrome_logs ? '' : "\033[0;92m" + colorcodes['iblack'] = monochrome_logs ? '' : "\033[0;90m" + colorcodes['ired'] = monochrome_logs ? '' : "\033[0;91m" + colorcodes['igreen'] = monochrome_logs ? '' : "\033[0;92m" colorcodes['iyellow'] = monochrome_logs ? '' : "\033[0;93m" - colorcodes['iblue'] = monochrome_logs ? '' : "\033[0;94m" + colorcodes['iblue'] = monochrome_logs ? '' : "\033[0;94m" colorcodes['ipurple'] = monochrome_logs ? '' : "\033[0;95m" - colorcodes['icyan'] = monochrome_logs ? '' : "\033[0;96m" - colorcodes['iwhite'] = monochrome_logs ? '' : "\033[0;97m" + colorcodes['icyan'] = monochrome_logs ? '' : "\033[0;96m" + colorcodes['iwhite'] = monochrome_logs ? '' : "\033[0;97m" // Bold High Intensity - colorcodes['biblack'] = monochrome_logs ? '' : "\033[1;90m" - colorcodes['bired'] = monochrome_logs ? '' : "\033[1;91m" - colorcodes['bigreen'] = monochrome_logs ? '' : "\033[1;92m" + colorcodes['biblack'] = monochrome_logs ? '' : "\033[1;90m" + colorcodes['bired'] = monochrome_logs ? '' : "\033[1;91m" + colorcodes['bigreen'] = monochrome_logs ? '' : "\033[1;92m" colorcodes['biyellow'] = monochrome_logs ? '' : "\033[1;93m" - colorcodes['biblue'] = monochrome_logs ? '' : "\033[1;94m" + colorcodes['biblue'] = monochrome_logs ? '' : "\033[1;94m" colorcodes['bipurple'] = monochrome_logs ? '' : "\033[1;95m" - colorcodes['bicyan'] = monochrome_logs ? '' : "\033[1;96m" - colorcodes['biwhite'] = monochrome_logs ? '' : "\033[1;97m" + colorcodes['bicyan'] = monochrome_logs ? '' : "\033[1;96m" + colorcodes['biwhite'] = monochrome_logs ? '' : "\033[1;97m" return colorcodes } @@ -208,17 +208,21 @@ def logColours(monochrome_logs=true) { def getSingleReport(multiqc_reports) { if (multiqc_reports instanceof Path) { return multiqc_reports - } else if (multiqc_reports instanceof List) { + } + else if (multiqc_reports instanceof List) { if (multiqc_reports.size() == 0) { log.warn("[${workflow.manifest.name}] No reports found from process 'MULTIQC'") return null - } else if (multiqc_reports.size() == 1) { + } + else if (multiqc_reports.size() == 1) { return multiqc_reports.first() - } else { + } + else { log.warn("[${workflow.manifest.name}] Found multiple reports from process 'MULTIQC', will use only one") return multiqc_reports.first() } - } else { + } + else { return null } } @@ -226,7 +230,7 @@ def getSingleReport(multiqc_reports) { // // Construct and send completion email // -def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdir, monochrome_logs=true, multiqc_report=null) { +def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdir, monochrome_logs = true, multiqc_report = null) { // Set up the e-mail variables def subject = "[${workflow.manifest.name}] Successful: ${workflow.runName}" @@ -243,35 +247,35 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi } def misc_fields = [:] - misc_fields['Date Started'] = workflow.start - misc_fields['Date Completed'] = workflow.complete + misc_fields['Date Started'] = workflow.start + misc_fields['Date Completed'] = workflow.complete misc_fields['Pipeline script file path'] = workflow.scriptFile - misc_fields['Pipeline script hash ID'] = workflow.scriptId + misc_fields['Pipeline script hash ID'] = workflow.scriptId if (workflow.repository) { - misc_fields['Pipeline repository Git URL'] = workflow.repository + misc_fields['Pipeline repository Git URL'] = workflow.repository } if (workflow.commitId) { misc_fields['Pipeline repository Git Commit'] = workflow.commitId } if (workflow.revision) { - misc_fields['Pipeline Git branch/tag'] = workflow.revision + misc_fields['Pipeline Git branch/tag'] = workflow.revision } - misc_fields['Nextflow Version'] = workflow.nextflow.version - misc_fields['Nextflow Build'] = workflow.nextflow.build + misc_fields['Nextflow Version'] = workflow.nextflow.version + misc_fields['Nextflow Build'] = workflow.nextflow.build misc_fields['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp def email_fields = [:] - email_fields['version'] = getWorkflowVersion() - email_fields['runName'] = workflow.runName - email_fields['success'] = workflow.success + email_fields['version'] = getWorkflowVersion() + email_fields['runName'] = workflow.runName + email_fields['success'] = workflow.success email_fields['dateComplete'] = workflow.complete - email_fields['duration'] = workflow.duration - email_fields['exitStatus'] = workflow.exitStatus + email_fields['duration'] = workflow.duration + email_fields['exitStatus'] = workflow.exitStatus email_fields['errorMessage'] = (workflow.errorMessage ?: 'None') - email_fields['errorReport'] = (workflow.errorReport ?: 'None') - email_fields['commandLine'] = workflow.commandLine - email_fields['projectDir'] = workflow.projectDir - email_fields['summary'] = summary << misc_fields + email_fields['errorReport'] = (workflow.errorReport ?: 'None') + email_fields['commandLine'] = workflow.commandLine + email_fields['projectDir'] = workflow.projectDir + email_fields['summary'] = summary << misc_fields // On success try attach the multiqc report def mqc_report = getSingleReport(multiqc_report) @@ -283,22 +287,22 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi } // Render the TXT template - def engine = new groovy.text.GStringTemplateEngine() - def tf = new File("${workflow.projectDir}/assets/email_template.txt") + def engine = new groovy.text.GStringTemplateEngine() + def tf = new File("${workflow.projectDir}/assets/email_template.txt") def txt_template = engine.createTemplate(tf).make(email_fields) - def email_txt = txt_template.toString() + def email_txt = txt_template.toString() // Render the HTML template - def hf = new File("${workflow.projectDir}/assets/email_template.html") + def hf = new File("${workflow.projectDir}/assets/email_template.html") def html_template = engine.createTemplate(hf).make(email_fields) - def email_html = html_template.toString() + def email_html = html_template.toString() // Render the sendmail template def max_multiqc_email_size = (params.containsKey('max_multiqc_email_size') ? params.max_multiqc_email_size : 0) as MemoryUnit - def smail_fields = [email: email_address, subject: subject, email_txt: email_txt, email_html: email_html, projectDir: "${workflow.projectDir}", mqcFile: mqc_report, mqcMaxSize: max_multiqc_email_size.toBytes()] - def sf = new File("${workflow.projectDir}/assets/sendmail_template.txt") - def sendmail_template = engine.createTemplate(sf).make(smail_fields) - def sendmail_html = sendmail_template.toString() + def smail_fields = [email: email_address, subject: subject, email_txt: email_txt, email_html: email_html, projectDir: "${workflow.projectDir}", mqcFile: mqc_report, mqcMaxSize: max_multiqc_email_size.toBytes()] + def sf = new File("${workflow.projectDir}/assets/sendmail_template.txt") + def sendmail_template = engine.createTemplate(sf).make(smail_fields) + def sendmail_html = sendmail_template.toString() // Send the HTML e-mail def colors = logColours(monochrome_logs) as Map @@ -339,7 +343,7 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi // // Print pipeline summary on completion // -def completionSummary(monochrome_logs=true) { +def completionSummary(monochrome_logs = true) { def colors = logColours(monochrome_logs) as Map if (workflow.success) { if (workflow.stats.ignoredCount == 0) { @@ -367,44 +371,44 @@ def imNotification(summary_params, hook_url) { } def misc_fields = [:] - misc_fields['start'] = workflow.start - misc_fields['complete'] = workflow.complete - misc_fields['scriptfile'] = workflow.scriptFile - misc_fields['scriptid'] = workflow.scriptId + misc_fields['start'] = workflow.start + misc_fields['complete'] = workflow.complete + misc_fields['scriptfile'] = workflow.scriptFile + misc_fields['scriptid'] = workflow.scriptId if (workflow.repository) { misc_fields['repository'] = workflow.repository } if (workflow.commitId) { - misc_fields['commitid'] = workflow.commitId + misc_fields['commitid'] = workflow.commitId } if (workflow.revision) { - misc_fields['revision'] = workflow.revision + misc_fields['revision'] = workflow.revision } - misc_fields['nxf_version'] = workflow.nextflow.version - misc_fields['nxf_build'] = workflow.nextflow.build - misc_fields['nxf_timestamp'] = workflow.nextflow.timestamp + misc_fields['nxf_version'] = workflow.nextflow.version + misc_fields['nxf_build'] = workflow.nextflow.build + misc_fields['nxf_timestamp'] = workflow.nextflow.timestamp def msg_fields = [:] - msg_fields['version'] = getWorkflowVersion() - msg_fields['runName'] = workflow.runName - msg_fields['success'] = workflow.success + msg_fields['version'] = getWorkflowVersion() + msg_fields['runName'] = workflow.runName + msg_fields['success'] = workflow.success msg_fields['dateComplete'] = workflow.complete - msg_fields['duration'] = workflow.duration - msg_fields['exitStatus'] = workflow.exitStatus + msg_fields['duration'] = workflow.duration + msg_fields['exitStatus'] = workflow.exitStatus msg_fields['errorMessage'] = (workflow.errorMessage ?: 'None') - msg_fields['errorReport'] = (workflow.errorReport ?: 'None') - msg_fields['commandLine'] = workflow.commandLine.replaceFirst(/ +--hook_url +[^ ]+/, "") - msg_fields['projectDir'] = workflow.projectDir - msg_fields['summary'] = summary << misc_fields + msg_fields['errorReport'] = (workflow.errorReport ?: 'None') + msg_fields['commandLine'] = workflow.commandLine.replaceFirst(/ +--hook_url +[^ ]+/, "") + msg_fields['projectDir'] = workflow.projectDir + msg_fields['summary'] = summary << misc_fields // Render the JSON template - def engine = new groovy.text.GStringTemplateEngine() + def engine = new groovy.text.GStringTemplateEngine() // Different JSON depending on the service provider // Defaults to "Adaptive Cards" (https://adaptivecards.io), except Slack which has its own format - def json_path = hook_url.contains("hooks.slack.com") ? "slackreport.json" : "adaptivecard.json" - def hf = new File("${workflow.projectDir}/assets/${json_path}") + def json_path = hook_url.contains("hooks.slack.com") ? "slackreport.json" : "adaptivecard.json" + def hf = new File("${workflow.projectDir}/assets/${json_path}") def json_template = engine.createTemplate(hf).make(msg_fields) - def json_message = json_template.toString() + def json_message = json_template.toString() // POST def post = new URL(hook_url).openConnection() diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config b/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config index d0a926bf..a09572e5 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config @@ -3,7 +3,7 @@ manifest { author = """nf-core""" homePage = 'https://127.0.0.1' description = """Dummy pipeline""" - nextflowVersion = '!>=23.04.0' + nextflowVersion = '!>=23.04.0' version = '9.9.9' doi = 'https://doi.org/10.5281/zenodo.5070524' } diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf b/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf index 0338bb24..0b4cfd78 100644 --- a/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf +++ b/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf @@ -32,8 +32,8 @@ workflow UTILS_NFVALIDATION_PLUGIN { log.debug("Using schema file: ${schema_filename}") // Default values for strings - pre_help_text = pre_help_text ?: '' - post_help_text = post_help_text ?: '' + pre_help_text = pre_help_text ?: '' + post_help_text = post_help_text ?: '' workflow_command = workflow_command ?: '' // diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep/main.nf b/subworkflows/nf-core/vcf_annotate_ensemblvep/main.nf index 6cb3129d..d6713bee 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep/main.nf +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep/main.nf @@ -19,12 +19,9 @@ workflow VCF_ANNOTATE_ENSEMBLVEP { ENSEMBLVEP_VEP(vcf, vep_genome, vep_species, vep_cache_version, vep_cache, fasta, vep_extra_files) - // Gather versions of all tools used - emit: - // vcf_tbi = ch_vcf_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] - vcf = ENSEMBLVEP_VEP.out.vcf // channel: [ val(meta), vcf ] - json = ENSEMBLVEP_VEP.out.json // channel: [ val(meta), json ] - tab = ENSEMBLVEP_VEP.out.tab // channel: [ val(meta), tab ] - reports = ENSEMBLVEP_VEP.out.report // channel: [ *.html ] + vcf = ENSEMBLVEP_VEP.out.vcf // channel: [ val(meta), vcf ] + json = ENSEMBLVEP_VEP.out.json // channel: [ val(meta), json ] + tab = ENSEMBLVEP_VEP.out.tab // channel: [ val(meta), tab ] + reports = ENSEMBLVEP_VEP.out.report // channel: [ *.html ] } diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_panel/main.nf b/subworkflows/nf-core/vcf_annotate_ensemblvep_panel/main.nf index 53e3d783..e57a72e7 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_panel/main.nf +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep_panel/main.nf @@ -19,12 +19,9 @@ workflow VCF_ANNOTATE_ENSEMBLVEP { ENSEMBLVEP_VEP(vcf, vep_genome, vep_species, vep_cache_version, vep_cache, fasta, vep_extra_files) - // Gather versions of all tools used - emit: - // vcf_tbi = ch_vcf_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] - vcf = ENSEMBLVEP_VEP.out.vcf // channel: [ val(meta), vcf ] - json = ENSEMBLVEP_VEP.out.json // channel: [ val(meta), json ] - tab = ENSEMBLVEP_VEP.out.tab // channel: [ val(meta), tab ] - reports = ENSEMBLVEP_VEP.out.report // channel: [ *.html ] + vcf = ENSEMBLVEP_VEP.out.vcf // channel: [ val(meta), vcf ] + json = ENSEMBLVEP_VEP.out.json // channel: [ val(meta), json ] + tab = ENSEMBLVEP_VEP.out.tab // channel: [ val(meta), tab ] + reports = ENSEMBLVEP_VEP.out.report // channel: [ *.html ] } diff --git a/workflows/deepcsa.nf b/workflows/deepcsa.nf index a84f4125..4fa92612 100644 --- a/workflows/deepcsa.nf +++ b/workflows/deepcsa.nf @@ -4,9 +4,9 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { paramsSummaryMap } from 'plugin/nf-schema' -include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_deepcsa' +include { paramsSummaryMap } from 'plugin/nf-schema' +include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline' +include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_deepcsa' /* @@ -23,73 +23,73 @@ Consisting of a mix of local and nf-core/modules. */ // SUBWORKFLOW -include { INPUT_CHECK } from '../subworkflows/local/input_check' +include { INPUT_CHECK } from '../subworkflows/local/input_check' -include { DEPTH_ANALYSIS as DEPTHANALYSIS } from '../subworkflows/local/depthanalysis/main' -include { CREATE_PANELS as CREATEPANELS } from '../subworkflows/local/createpanels/main' +include { DEPTH_ANALYSIS as DEPTHANALYSIS } from '../subworkflows/local/depthanalysis/main' +include { CREATE_PANELS as CREATEPANELS } from '../subworkflows/local/createpanels/main' -include { PLOT_DEPTHS as PLOTDEPTHSALLCONS } from '../subworkflows/local/plotdepths/main' -include { PLOT_DEPTHS as PLOTDEPTHSEXONS } from '../subworkflows/local/plotdepths/main' -include { PLOT_DEPTHS as PLOTDEPTHSEXONSCONS } from '../subworkflows/local/plotdepths/main' +include { PLOT_DEPTHS as PLOTDEPTHSALLCONS } from '../subworkflows/local/plotdepths/main' +include { PLOT_DEPTHS as PLOTDEPTHSEXONS } from '../subworkflows/local/plotdepths/main' +include { PLOT_DEPTHS as PLOTDEPTHSEXONSCONS } from '../subworkflows/local/plotdepths/main' -include { MUTATION_PREPROCESSING as MUT_PREPROCESSING } from '../subworkflows/local/mutationpreprocessing/main' +include { MUTATION_PREPROCESSING as MUT_PREPROCESSING } from '../subworkflows/local/mutationpreprocessing/main' -include { MUTATION_DENSITY as MUTDENSITYALL } from '../subworkflows/local/mutationdensity/main' -include { MUTATION_DENSITY as MUTDENSITYPROT } from '../subworkflows/local/mutationdensity/main' -include { MUTATION_DENSITY as MUTDENSITYNONPROT } from '../subworkflows/local/mutationdensity/main' -include { MUTATION_DENSITY as MUTDENSITYSYNONYMOUS } from '../subworkflows/local/mutationdensity/main' +include { MUTATION_DENSITY as MUTDENSITYALL } from '../subworkflows/local/mutationdensity/main' +include { MUTATION_DENSITY as MUTDENSITYPROT } from '../subworkflows/local/mutationdensity/main' +include { MUTATION_DENSITY as MUTDENSITYNONPROT } from '../subworkflows/local/mutationdensity/main' +include { MUTATION_DENSITY as MUTDENSITYSYNONYMOUS } from '../subworkflows/local/mutationdensity/main' -include { MUTATION_DENSITY as MUTDENSITYADJUSTED } from '../subworkflows/local/mut_density/main' +include { MUTATION_DENSITY as MUTDENSITYADJUSTED } from '../subworkflows/local/mut_density/main' -include { MUTATIONAL_PROFILE as MUTPROFILEALL } from '../subworkflows/local/mutationprofile/main' -include { MUTATIONAL_PROFILE as MUTPROFILENONPROT } from '../subworkflows/local/mutationprofile/main' -include { MUTATIONAL_PROFILE as MUTPROFILEEXONS } from '../subworkflows/local/mutationprofile/main' -include { MUTATIONAL_PROFILE as MUTPROFILEINTRONS } from '../subworkflows/local/mutationprofile/main' +include { MUTATIONAL_PROFILE as MUTPROFILEALL } from '../subworkflows/local/mutationprofile/main' +include { MUTATIONAL_PROFILE as MUTPROFILENONPROT } from '../subworkflows/local/mutationprofile/main' +include { MUTATIONAL_PROFILE as MUTPROFILEEXONS } from '../subworkflows/local/mutationprofile/main' +include { MUTATIONAL_PROFILE as MUTPROFILEINTRONS } from '../subworkflows/local/mutationprofile/main' -include { MUTABILITY as MUTABILITYALL } from '../subworkflows/local/mutability/main' -include { MUTABILITY as MUTABILITYNONPROT } from '../subworkflows/local/mutability/main' +include { MUTABILITY as MUTABILITYALL } from '../subworkflows/local/mutability/main' +include { MUTABILITY as MUTABILITYNONPROT } from '../subworkflows/local/mutability/main' -include { ONCODRIVEFML_ANALYSIS as ONCODRIVEFMLALL } from '../subworkflows/local/oncodrivefml/main' -include { ONCODRIVEFML_ANALYSIS as ONCODRIVEFMLNONPROT } from '../subworkflows/local/oncodrivefml/main' -include { ONCODRIVE3D_ANALYSIS as ONCODRIVE3D } from '../subworkflows/local/oncodrive3d/main' -include { ONCODRIVECLUSTL_ANALYSIS as ONCODRIVECLUSTL } from '../subworkflows/local/oncodriveclustl/main' +include { ONCODRIVEFML_ANALYSIS as ONCODRIVEFMLALL } from '../subworkflows/local/oncodrivefml/main' +include { ONCODRIVEFML_ANALYSIS as ONCODRIVEFMLNONPROT } from '../subworkflows/local/oncodrivefml/main' +include { ONCODRIVE3D_ANALYSIS as ONCODRIVE3D } from '../subworkflows/local/oncodrive3d/main' +include { ONCODRIVECLUSTL_ANALYSIS as ONCODRIVECLUSTL } from '../subworkflows/local/oncodriveclustl/main' -include { OMEGA_ANALYSIS as OMEGA } from '../subworkflows/local/omega/main' -include { OMEGA_ANALYSIS as OMEGANONPROT } from '../subworkflows/local/omega/main' -include { OMEGA_ANALYSIS as OMEGAMULTI } from '../subworkflows/local/omega/main' -include { OMEGA_ANALYSIS as OMEGANONPROTMULTI } from '../subworkflows/local/omega/main' +include { OMEGA_ANALYSIS as OMEGA } from '../subworkflows/local/omega/main' +include { OMEGA_ANALYSIS as OMEGANONPROT } from '../subworkflows/local/omega/main' +include { OMEGA_ANALYSIS as OMEGAMULTI } from '../subworkflows/local/omega/main' +include { OMEGA_ANALYSIS as OMEGANONPROTMULTI } from '../subworkflows/local/omega/main' -include { INDELS_SELECTION as INDELSSELECTION } from '../subworkflows/local/indels/main' +include { INDELS_SELECTION as INDELSSELECTION } from '../subworkflows/local/indels/main' -include { MUTATED_CELLS_VAF as MUTATEDCELLSVAF } from '../subworkflows/local/mutatedcells/vaf/main' +include { MUTATED_CELLS_VAF as MUTATEDCELLSVAF } from '../subworkflows/local/mutatedcells/vaf/main' -include { EXPECTED_MUTATED_CELLS as EXPECTEDMUTATEDCELLS } from '../subworkflows/local/mutatedcells/expected/main' +include { EXPECTED_MUTATED_CELLS as EXPECTEDMUTATEDCELLS } from '../subworkflows/local/mutatedcells/expected/main' -include { SIGNATURES as SIGNATURESALL } from '../subworkflows/local/signatures/main' -include { SIGNATURES as SIGNATURESNONPROT } from '../subworkflows/local/signatures/main' -include { SIGNATURES as SIGNATURESEXONS } from '../subworkflows/local/signatures/main' -include { SIGNATURES as SIGNATURESINTRONS } from '../subworkflows/local/signatures/main' +include { SIGNATURES as SIGNATURESALL } from '../subworkflows/local/signatures/main' +include { SIGNATURES as SIGNATURESNONPROT } from '../subworkflows/local/signatures/main' +include { SIGNATURES as SIGNATURESEXONS } from '../subworkflows/local/signatures/main' +include { SIGNATURES as SIGNATURESINTRONS } from '../subworkflows/local/signatures/main' -include { PLOTTING_SUMMARY as PLOTTINGSUMMARY } from '../subworkflows/local/plottingsummary/main' +include { PLOTTING_SUMMARY as PLOTTINGSUMMARY } from '../subworkflows/local/plottingsummary/main' -include { REGRESSIONS as REGRESSIONSMUTDENSITY } from '../subworkflows/local/regressions/main' -include { REGRESSIONS as REGRESSIONSONCODRIVEFML } from '../subworkflows/local/regressions/main' -include { REGRESSIONS as REGRESSIONSOMEGA } from '../subworkflows/local/regressions/main' -include { REGRESSIONS as REGRESSIONSOMEGAGLOB } from '../subworkflows/local/regressions/main' +include { REGRESSIONS as REGRESSIONSMUTDENSITY } from '../subworkflows/local/regressions/main' +include { REGRESSIONS as REGRESSIONSONCODRIVEFML } from '../subworkflows/local/regressions/main' +include { REGRESSIONS as REGRESSIONSOMEGA } from '../subworkflows/local/regressions/main' +include { REGRESSIONS as REGRESSIONSOMEGAGLOB } from '../subworkflows/local/regressions/main' -include { DNDS as DNDS } from '../subworkflows/local/dnds/main' +include { DNDS as DNDS } from '../subworkflows/local/dnds/main' -include { TABIX_BGZIPTABIX_QUERY as DEPTHSALLCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as DEPTHSEXONSCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as DEPTHSPROTCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as DEPTHSNONPROTCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as DEPTHSINTRONSCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' -include { TABIX_BGZIPTABIX_QUERY as DEPTHSSYNONYMOUSCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as DEPTHSALLCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as DEPTHSEXONSCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as DEPTHSPROTCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as DEPTHSNONPROTCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as DEPTHSINTRONSCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' +include { TABIX_BGZIPTABIX_QUERY as DEPTHSSYNONYMOUSCONS } from '../modules/nf-core/tabix/bgziptabixquery/main' -include { SELECT_MUTDENSITIES as SYNMUTDENSITY } from '../modules/local/select_mutdensity/main' -include { SELECT_MUTDENSITIES as SYNMUTREADSRATE } from '../modules/local/select_mutdensity/main' +include { SELECT_MUTDENSITIES as SYNMUTDENSITY } from '../modules/local/select_mutdensity/main' +include { SELECT_MUTDENSITIES as SYNMUTREADSRATE } from '../modules/local/select_mutdensity/main' -include { DNA_2_PROTEIN_MAPPING as DNA2PROTEINMAPPING } from '../modules/local/dna2protein/main' +include { DNA_2_PROTEIN_MAPPING as DNA2PROTEINMAPPING } from '../modules/local/dna2protein/main' /* @@ -100,13 +100,13 @@ Installed directly from nf-core/modules. */ // MODULE -include { MULTIQC } from '../modules/nf-core/multiqc/main' -include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' +include { MULTIQC } from '../modules/nf-core/multiqc/main' +include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' -include { ANNOTATE_DEPTHS as ANNOTATEDEPTHS } from '../modules/local/annotatedepth/main' -include { DOWNSAMPLE_DEPTHS as DOWNSAMPLEDEPTHS } from '../modules/local/downsample/depths/main' -include { TABLE_2_GROUP as TABLE2GROUP } from '../modules/local/table2groups/main' -include { MUTATIONS_2_SIGNATURES as MUTS2SIGS } from '../modules/local/mutations2sbs/main' +include { ANNOTATE_DEPTHS as ANNOTATEDEPTHS } from '../modules/local/annotatedepth/main' +include { DOWNSAMPLE_DEPTHS as DOWNSAMPLEDEPTHS } from '../modules/local/downsample/depths/main' +include { TABLE_2_GROUP as TABLE2GROUP } from '../modules/local/table2groups/main' +include { MUTATIONS_2_SIGNATURES as MUTS2SIGS } from '../modules/local/mutations2sbs/main' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -114,53 +114,55 @@ include { MUTATIONS_2_SIGNATURES as MUTS2SIGS } from '../modules/l ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -workflow DEEPCSA{ +workflow DEEPCSA { // // Input channel definitions - features_table = Channel.fromPath( params.features_table ?: params.input, checkIfExists: true) - - wgs_trinucs = params.wgs_trinuc_counts - ? Channel.fromPath( params.wgs_trinuc_counts, checkIfExists: true).first() - : Channel.empty() - cosmic_ref = params.cosmic_ref_signatures - ? Channel.fromPath( params.cosmic_ref_signatures, checkIfExists: true).first() - : Channel.empty() - datasets3d = params.datasets3d - ? Channel.fromPath( params.datasets3d, checkIfExists: true).first() - : Channel.empty() - annotations3d = params.annotations3d - ? Channel.fromPath( params.annotations3d, checkIfExists: true).first() - : Channel.empty() - seqinfo_df = params.datasets3d - ? Channel.fromPath( "${params.datasets3d}/seq_for_mut_prob.tsv", checkIfExists: true).first() - : Channel.empty() - cadd_scores = params.cadd_scores - ? Channel.of([ - file(params.cadd_scores, checkIfExists : true), - file(params.cadd_scores_ind, checkIfExists : true) - ]).first() - : Channel.empty() + features_table = Channel.fromPath(params.features_table ?: params.input, checkIfExists: true) + + wgs_trinucs = params.wgs_trinuc_counts + ? Channel.fromPath(params.wgs_trinuc_counts, checkIfExists: true).first() + : Channel.empty() + cosmic_ref = params.cosmic_ref_signatures + ? Channel.fromPath(params.cosmic_ref_signatures, checkIfExists: true).first() + : Channel.empty() + datasets3d = params.datasets3d + ? Channel.fromPath(params.datasets3d, checkIfExists: true).first() + : Channel.empty() + annotations3d = params.annotations3d + ? Channel.fromPath(params.annotations3d, checkIfExists: true).first() + : Channel.empty() + seqinfo_df = params.datasets3d + ? Channel.fromPath("${params.datasets3d}/seq_for_mut_prob.tsv", checkIfExists: true).first() + : Channel.empty() + cadd_scores = params.cadd_scores + ? Channel.of( + [ + file(params.cadd_scores, checkIfExists: true), + file(params.cadd_scores_ind, checkIfExists: true), + ] + ).first() + : Channel.empty() // if the user wants to use custom gene groups, import the gene groups table // otherwise I am using the input csv as a dummy value channel custom_groups_table = params.custom_groups_file - ? Channel.fromPath( params.custom_groups_file, checkIfExists: true).first() - : Channel.fromPath(params.input) + ? Channel.fromPath(params.custom_groups_file, checkIfExists: true).first() + : Channel.fromPath(params.input) // if the user wants to use custom BED file for computing the depths, import the BED file // otherwise I am using the input csv as a dummy value channel - custom_bed_file = params.custom_bedfile - ? Channel.fromPath( params.custom_bedfile, checkIfExists: true).first() - : Channel.fromPath( params.input ) + custom_bed_file = params.custom_bedfile + ? Channel.fromPath(params.custom_bedfile, checkIfExists: true).first() + : Channel.fromPath(params.input) // Initialize booleans based on user params - def run_mutabilities = (params.oncodrivefml || params.oncodriveclustl || params.oncodrive3d) - def run_mutdensity = (params.mutationdensity || params.omega) + def run_mutabilities = (params.oncodrivefml || params.oncodriveclustl || params.oncodrive3d) + def run_mutdensity = (params.mutationdensity || params.omega) // // SUBWORKFLOW: Read in samplesheet, validate and stage input files // - INPUT_CHECK ( + INPUT_CHECK( file(params.input) ) @@ -169,16 +171,16 @@ workflow DEEPCSA{ // Separate input BAMs and VCFs // INPUT_CHECK.out.mutations - .map{ it -> [ "id" : it[0].id ]} - .set{ meta_samples_alone } + .map { it -> ["id": it[0].id] } + .set { meta_samples_alone } INPUT_CHECK.out.mutations - .map{ it -> [it[0], it[1]]} - .set{ meta_vcfs_alone } + .map { it -> [it[0], it[1]] } + .set { meta_vcfs_alone } INPUT_CHECK.out.mutations - .map{ it -> [it[0], it[2]]} - .set{ meta_bams_alone } + .map { it -> [it[0], it[2]] } + .set { meta_bams_alone } TABLE2GROUP(features_table) @@ -192,13 +194,14 @@ workflow DEEPCSA{ CREATEPANELS(DEPTHANALYSIS.out.depths) ANNOTATEDEPTHS(DEPTHANALYSIS.out.depths, CREATEPANELS.out.all_panel, TABLE2GROUP.out.json_allgroups, file(params.input)) - ANNOTATEDEPTHS.out.annotated_depths.flatten().map{ it -> [ [id : it.name.tokenize('.')[0]] , it] }.set{ annotated_depths_full } + ANNOTATEDEPTHS.out.annotated_depths.flatten().map { it -> [[id: it.name.tokenize('.')[0]], it] }.set { annotated_depths_full } // if (params.downsample && params.downsample_proportion < 1) { - if (params.downsample ){ + if (params.downsample) { DOWNSAMPLEDEPTHS(annotated_depths_full) annotated_depths = DOWNSAMPLEDEPTHS.out.downsampled_depths - } else { + } + else { annotated_depths = annotated_depths_full } @@ -207,24 +210,25 @@ workflow DEEPCSA{ PLOTDEPTHSEXONSCONS(ANNOTATEDEPTHS.out.all_samples_depths, CREATEPANELS.out.exons_consensus_bed, CREATEPANELS.out.exons_consensus_panel) // Mutation preprocessing - MUT_PREPROCESSING(meta_vcfs_alone, - CREATEPANELS.out.all_consensus_bed, - CREATEPANELS.out.exons_bed, - TABLE2GROUP.out.json_allgroups, - seqinfo_df, - CREATEPANELS.out.added_custom_regions - ) + MUT_PREPROCESSING( + meta_vcfs_alone, + CREATEPANELS.out.all_consensus_bed, + CREATEPANELS.out.exons_bed, + TABLE2GROUP.out.json_allgroups, + seqinfo_df, + CREATEPANELS.out.added_custom_regions, + ) somatic_mutations = MUT_PREPROCESSING.out.somatic_mafs positive_selection_results = somatic_mutations - if (params.vep_species == 'homo_sapiens'){ - DNA2PROTEINMAPPING(MUT_PREPROCESSING.out.mutations_all_samples, - CREATEPANELS.out.exons_consensus_panel, - ANNOTATEDEPTHS.out.all_samples_depths) - // depths_exons_positions - // panel_exons_bed + if (params.vep_species == 'homo_sapiens') { + DNA2PROTEINMAPPING( + MUT_PREPROCESSING.out.mutations_all_samples, + CREATEPANELS.out.exons_consensus_panel, + ANNOTATEDEPTHS.out.all_samples_depths, + ) } @@ -240,16 +244,16 @@ workflow DEEPCSA{ DEPTHSSYNONYMOUSCONS(annotated_depths, CREATEPANELS.out.synonymous_consensus_bed) } - if (run_mutdensity){ + if (run_mutdensity) { // Mutation Density MUTDENSITYALL(somatic_mutations, DEPTHSALLCONS.out.subset, CREATEPANELS.out.all_consensus_bed, CREATEPANELS.out.all_consensus_panel) MUTDENSITYPROT(somatic_mutations, DEPTHSPROTCONS.out.subset, CREATEPANELS.out.prot_consensus_bed, CREATEPANELS.out.prot_consensus_panel) MUTDENSITYNONPROT(somatic_mutations, DEPTHSNONPROTCONS.out.subset, CREATEPANELS.out.nonprot_consensus_bed, CREATEPANELS.out.nonprot_consensus_panel) MUTDENSITYSYNONYMOUS(somatic_mutations, DEPTHSSYNONYMOUSCONS.out.subset, CREATEPANELS.out.synonymous_consensus_bed, CREATEPANELS.out.synonymous_consensus_panel) - Channel.of([ [ id: "all_samples" ] ]) - .join( MUTDENSITYSYNONYMOUS.out.mutdensities ) - .set{ all_samples_syn_mutdensity } + Channel.of([[id: "all_samples"]]) + .join(MUTDENSITYSYNONYMOUS.out.mutdensities) + .set { all_samples_syn_mutdensity } SYNMUTDENSITY(all_samples_syn_mutdensity) @@ -258,78 +262,85 @@ workflow DEEPCSA{ // Concatenate all outputs into a single file Channel.empty() - .concat(MUTDENSITYALL.out.mutdensities.map{ it -> it[1]}.flatten()) - .concat(MUTDENSITYPROT.out.mutdensities.map{ it -> it[1]}.flatten()) - .concat(MUTDENSITYNONPROT.out.mutdensities.map{ it -> it[1]}.flatten()) - .concat(MUTDENSITYSYNONYMOUS.out.mutdensities.map{ it -> it[1]}.flatten()) - .set{ all_mutdensities } - all_mutdensities.collectFile(name: "all_mutdensities.tsv", storeDir:"${params.outdir}/mutdensity", skip: 1, keepHeader: true).set{ all_mutdensities_file } - + .concat(MUTDENSITYALL.out.mutdensities.map { it -> it[1] }.flatten()) + .concat(MUTDENSITYPROT.out.mutdensities.map { it -> it[1] }.flatten()) + .concat(MUTDENSITYNONPROT.out.mutdensities.map { it -> it[1] }.flatten()) + .concat(MUTDENSITYSYNONYMOUS.out.mutdensities.map { it -> it[1] }.flatten()) + .set { all_mutdensities } + all_mutdensities.collectFile(name: "all_mutdensities.tsv", storeDir: "${params.outdir}/mutdensity", skip: 1, keepHeader: true).set { all_mutdensities_file } } // Mutational profile - if (params.profileall){ + if (params.profileall) { MUTPROFILEALL(somatic_mutations, DEPTHSALLCONS.out.subset, CREATEPANELS.out.all_consensus_bed, wgs_trinucs) - if (run_mutdensity){ + if (run_mutdensity) { MUTDENSITYADJUSTED(somatic_mutations, DEPTHSALLCONS.out.subset, CREATEPANELS.out.exons_consensus_bed, CREATEPANELS.out.exons_consensus_panel, MUTPROFILEALL.out.profile, wgs_trinucs) // Concatenate all outputs into a single file - MUTDENSITYADJUSTED.out.mutdensities.map{ it -> it[1]}.flatten() - .set{ all_adjusted_mutdensities } - all_adjusted_mutdensities.collectFile(name: "all_adjusted_mutdensities.tsv", storeDir:"${params.outdir}/mutdensityadj", skip: 1, keepHeader: true) - - MUTDENSITYADJUSTED.out.mutdensities_flat.map{ it -> it[1]}.flatten() - .set{ all_adjusted_mutdensities_flat } - all_adjusted_mutdensities_flat.collectFile(name: "all_adjusted_mutdensities_flat.tsv", storeDir:"${params.outdir}/mutdensityadj", skip: 1, keepHeader: true) + MUTDENSITYADJUSTED.out.mutdensities + .map { it -> it[1] } + .flatten() + .set { all_adjusted_mutdensities } + all_adjusted_mutdensities.collectFile(name: "all_adjusted_mutdensities.tsv", storeDir: "${params.outdir}/mutdensityadj", skip: 1, keepHeader: true) + + MUTDENSITYADJUSTED.out.mutdensities_flat + .map { it -> it[1] } + .flatten() + .set { all_adjusted_mutdensities_flat } + all_adjusted_mutdensities_flat.collectFile(name: "all_adjusted_mutdensities_flat.tsv", storeDir: "${params.outdir}/mutdensityadj", skip: 1, keepHeader: true) } } - if (params.profilenonprot){ + if (params.profilenonprot) { MUTPROFILENONPROT(somatic_mutations, DEPTHSNONPROTCONS.out.subset, CREATEPANELS.out.nonprot_consensus_bed, wgs_trinucs) } - if (params.profileexons){ + if (params.profileexons) { MUTPROFILEEXONS(somatic_mutations, DEPTHSEXONSCONS.out.subset, CREATEPANELS.out.exons_consensus_bed, wgs_trinucs) } - if (params.profileintrons){ + if (params.profileintrons) { DEPTHSINTRONSCONS(annotated_depths, CREATEPANELS.out.introns_consensus_bed) MUTPROFILEINTRONS(somatic_mutations, DEPTHSINTRONSCONS.out.subset, CREATEPANELS.out.introns_consensus_bed, wgs_trinucs) } if (run_mutabilities) { - if (params.profileall){ - MUTABILITYALL(somatic_mutations, - annotated_depths, - MUTPROFILEALL.out.profile, - CREATEPANELS.out.exons_consensus_panel, - CREATEPANELS.out.exons_consensus_bed - ) + if (params.profileall) { + MUTABILITYALL( + somatic_mutations, + annotated_depths, + MUTPROFILEALL.out.profile, + CREATEPANELS.out.exons_consensus_panel, + CREATEPANELS.out.exons_consensus_bed, + ) } - if (params.profilenonprot){ - MUTABILITYNONPROT(somatic_mutations, - annotated_depths, - MUTPROFILENONPROT.out.profile, - CREATEPANELS.out.exons_consensus_panel, - CREATEPANELS.out.exons_consensus_bed - ) + if (params.profilenonprot) { + MUTABILITYNONPROT( + somatic_mutations, + annotated_depths, + MUTPROFILENONPROT.out.profile, + CREATEPANELS.out.exons_consensus_panel, + CREATEPANELS.out.exons_consensus_bed, + ) } } - if (params.indels){ - INDELSSELECTION(somatic_mutations, - CREATEPANELS.out.all_consensus_bed - ) + if (params.indels) { + INDELSSELECTION( + somatic_mutations, + CREATEPANELS.out.all_consensus_bed, + ) positive_selection_results = positive_selection_results.join(INDELSSELECTION.out.indels, remainder: true) } - if (params.expected_mutated_cells){ - EXPECTEDMUTATEDCELLS(MUT_PREPROCESSING.out.mutations_all_samples, - CREATEPANELS.out.exons_consensus_bed, - CREATEPANELS.out.exons_consensus_panel, - ANNOTATEDEPTHS.out.all_samples_depths, - CREATEPANELS.out.full_panel_annotated - ) + if (params.expected_mutated_cells) { + EXPECTEDMUTATEDCELLS( + MUT_PREPROCESSING.out.mutations_all_samples, + CREATEPANELS.out.exons_consensus_bed, + CREATEPANELS.out.exons_consensus_panel, + ANNOTATEDEPTHS.out.all_samples_depths, + CREATEPANELS.out.full_panel_annotated, + ) } // @@ -337,222 +348,235 @@ workflow DEEPCSA{ // // OncodriveFML - if (params.oncodrivefml){ + if (params.oncodrivefml) { oncodrivefml_regressions_files = Channel.empty() - if (params.profileall){ + if (params.profileall) { mode = "all" - ONCODRIVEFMLALL(somatic_mutations, MUTABILITYALL.out.mutability, - CREATEPANELS.out.exons_consensus_panel, - cadd_scores, mode - ) + ONCODRIVEFMLALL( + somatic_mutations, + MUTABILITYALL.out.mutability, + CREATEPANELS.out.exons_consensus_panel, + cadd_scores, + mode, + ) positive_selection_results = positive_selection_results.join(ONCODRIVEFMLALL.out.results_snvs, remainder: true) - if (params.regressions){ - oncodrivefml_regressions_files = oncodrivefml_regressions_files.mix(ONCODRIVEFMLALL.out.results_snvs_folder.map{ it -> it[1] }) + if (params.regressions) { + oncodrivefml_regressions_files = oncodrivefml_regressions_files.mix(ONCODRIVEFMLALL.out.results_snvs_folder.map { it -> it[1] }) } } - if (params.profilenonprot){ + if (params.profilenonprot) { mode = "non_prot_aff" - ONCODRIVEFMLNONPROT(somatic_mutations, MUTABILITYNONPROT.out.mutability, - CREATEPANELS.out.exons_consensus_panel, - cadd_scores, mode - ) - if (params.regressions){ - oncodrivefml_regressions_files = oncodrivefml_regressions_files.mix(ONCODRIVEFMLNONPROT.out.results_snvs_folder.map{ it -> it[1] }) + ONCODRIVEFMLNONPROT( + somatic_mutations, + MUTABILITYNONPROT.out.mutability, + CREATEPANELS.out.exons_consensus_panel, + cadd_scores, + mode, + ) + if (params.regressions) { + oncodrivefml_regressions_files = oncodrivefml_regressions_files.mix(ONCODRIVEFMLNONPROT.out.results_snvs_folder.map { it -> it[1] }) } } } - if (params.oncodrive3d){ - if (params.profileall){ + if (params.oncodrive3d) { + if (params.profileall) { // Oncodrive3D - ONCODRIVE3D(somatic_mutations, MUTABILITYALL.out.mutability, CREATEPANELS.out.exons_consensus_bed, - datasets3d, annotations3d, MUT_PREPROCESSING.out.all_raw_vep_annotation) + ONCODRIVE3D( + somatic_mutations, + MUTABILITYALL.out.mutability, + CREATEPANELS.out.exons_consensus_bed, + datasets3d, + annotations3d, + MUT_PREPROCESSING.out.all_raw_vep_annotation, + ) positive_selection_results = positive_selection_results.join(ONCODRIVE3D.out.results, remainder: true) positive_selection_results = positive_selection_results.join(ONCODRIVE3D.out.results_pos, remainder: true) - } } // if (params.expected_mutated_cells & params.dnds){ - if (params.dnds){ - DNDS(somatic_mutations, - DEPTHSEXONSCONS.out.subset, - CREATEPANELS.out.exons_consensus_bed, - CREATEPANELS.out.exons_consensus_panel - ) + if (params.dnds) { + DNDS( + somatic_mutations, + DEPTHSEXONSCONS.out.subset, + CREATEPANELS.out.exons_consensus_bed, + CREATEPANELS.out.exons_consensus_panel, + ) } - if (params.omega){ + if (params.omega) { omega_regressions_files = Channel.empty() omega_regressions_files_gloc = Channel.empty() // Omega - if (params.profileall){ - OMEGA(somatic_mutations, - DEPTHSEXONSCONS.out.subset, - MUTPROFILEALL.out.profile, - CREATEPANELS.out.exons_consensus_bed, - CREATEPANELS.out.exons_consensus_panel, - custom_groups_table, - CREATEPANELS.out.domains_panel_bed, - SYNMUTDENSITY.out.mutdensity, - CREATEPANELS.out.panel_annotated_rich, - DNA2PROTEINMAPPING.out.panel_exons_bed - ) + if (params.profileall) { + OMEGA( + somatic_mutations, + DEPTHSEXONSCONS.out.subset, + MUTPROFILEALL.out.profile, + CREATEPANELS.out.exons_consensus_bed, + CREATEPANELS.out.exons_consensus_panel, + custom_groups_table, + CREATEPANELS.out.domains_panel_bed, + SYNMUTDENSITY.out.mutdensity, + CREATEPANELS.out.panel_annotated_rich, + DNA2PROTEINMAPPING.out.panel_exons_bed, + ) positive_selection_results = positive_selection_results.join(OMEGA.out.results, remainder: true) positive_selection_results = positive_selection_results.join(OMEGA.out.results_global, remainder: true) site_comparison_results = OMEGA.out.site_comparison - if (params.regressions){ - omega_regressions_files = omega_regressions_files.mix(OMEGA.out.results.map{ it -> it[1] }) - omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGA.out.results_global.map{ it -> it[1] }) + if (params.regressions) { + omega_regressions_files = omega_regressions_files.mix(OMEGA.out.results.map { it -> it[1] }) + omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGA.out.results_global.map { it -> it[1] }) } - if (params.omega_multi){ + if (params.omega_multi) { // Omega multi - OMEGAMULTI(somatic_mutations, - DEPTHSEXONSCONS.out.subset, - MUTPROFILEALL.out.profile, - CREATEPANELS.out.exons_consensus_bed, - CREATEPANELS.out.exons_consensus_panel, - custom_groups_table, - CREATEPANELS.out.domains_panel_bed, - SYNMUTREADSRATE.out.mutdensity, - CREATEPANELS.out.panel_annotated_rich, - DNA2PROTEINMAPPING.out.panel_exons_bed - ) + OMEGAMULTI( + somatic_mutations, + DEPTHSEXONSCONS.out.subset, + MUTPROFILEALL.out.profile, + CREATEPANELS.out.exons_consensus_bed, + CREATEPANELS.out.exons_consensus_panel, + custom_groups_table, + CREATEPANELS.out.domains_panel_bed, + SYNMUTREADSRATE.out.mutdensity, + CREATEPANELS.out.panel_annotated_rich, + DNA2PROTEINMAPPING.out.panel_exons_bed, + ) positive_selection_results = positive_selection_results.join(OMEGAMULTI.out.results, remainder: true) positive_selection_results = positive_selection_results.join(OMEGAMULTI.out.results_global, remainder: true) - if (params.regressions){ - omega_regressions_files = omega_regressions_files.mix(OMEGAMULTI.out.results.map{ it -> it[1] }) - omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGAMULTI.out.results_global.map{ it -> it[1] }) + if (params.regressions) { + omega_regressions_files = omega_regressions_files.mix(OMEGAMULTI.out.results.map { it -> it[1] }) + omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGAMULTI.out.results_global.map { it -> it[1] }) } } } - if (params.profilenonprot){ - OMEGANONPROT(somatic_mutations, - DEPTHSEXONSCONS.out.subset, - MUTPROFILENONPROT.out.profile, - CREATEPANELS.out.exons_consensus_bed, - CREATEPANELS.out.exons_consensus_panel, - custom_groups_table, - CREATEPANELS.out.domains_panel_bed, - SYNMUTDENSITY.out.mutdensity, - CREATEPANELS.out.panel_annotated_rich, - DNA2PROTEINMAPPING.out.panel_exons_bed - ) - if (params.regressions){ - omega_regressions_files = omega_regressions_files.mix(OMEGANONPROT.out.results.map{ it -> it[1] }) - omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGANONPROT.out.results_global.map{ it -> it[1] }) + if (params.profilenonprot) { + OMEGANONPROT( + somatic_mutations, + DEPTHSEXONSCONS.out.subset, + MUTPROFILENONPROT.out.profile, + CREATEPANELS.out.exons_consensus_bed, + CREATEPANELS.out.exons_consensus_panel, + custom_groups_table, + CREATEPANELS.out.domains_panel_bed, + SYNMUTDENSITY.out.mutdensity, + CREATEPANELS.out.panel_annotated_rich, + DNA2PROTEINMAPPING.out.panel_exons_bed, + ) + if (params.regressions) { + omega_regressions_files = omega_regressions_files.mix(OMEGANONPROT.out.results.map { it -> it[1] }) + omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGANONPROT.out.results_global.map { it -> it[1] }) } - if (params.omega_multi){ - OMEGANONPROTMULTI(somatic_mutations, - DEPTHSEXONSCONS.out.subset, - MUTPROFILENONPROT.out.profile, - CREATEPANELS.out.exons_consensus_bed, - CREATEPANELS.out.exons_consensus_panel, - custom_groups_table, - CREATEPANELS.out.domains_panel_bed, - SYNMUTREADSRATE.out.mutdensity, - CREATEPANELS.out.panel_annotated_rich, - DNA2PROTEINMAPPING.out.panel_exons_bed - ) - - if (params.regressions){ - omega_regressions_files = omega_regressions_files.mix(OMEGANONPROTMULTI.out.results.map{ it -> it[1] }) - omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGANONPROTMULTI.out.results_global.map{ it -> it[1] }) + if (params.omega_multi) { + OMEGANONPROTMULTI( + somatic_mutations, + DEPTHSEXONSCONS.out.subset, + MUTPROFILENONPROT.out.profile, + CREATEPANELS.out.exons_consensus_bed, + CREATEPANELS.out.exons_consensus_panel, + custom_groups_table, + CREATEPANELS.out.domains_panel_bed, + SYNMUTREADSRATE.out.mutdensity, + CREATEPANELS.out.panel_annotated_rich, + DNA2PROTEINMAPPING.out.panel_exons_bed, + ) + + if (params.regressions) { + omega_regressions_files = omega_regressions_files.mix(OMEGANONPROTMULTI.out.results.map { it -> it[1] }) + omega_regressions_files_gloc = omega_regressions_files_gloc.mix(OMEGANONPROTMULTI.out.results_global.map { it -> it[1] }) } } - } - } - if (params.mutated_cells_vaf){ + if (params.mutated_cells_vaf) { MUT_PREPROCESSING.out.somatic_mafs - .join(meta_samples_alone) - .set{ sample_mutations_only } - - MUTATEDCELLSVAF(sample_mutations_only, - CREATEPANELS.out.exons_consensus_bed, - OMEGA.out.results_global, - features_table - ) + .join(meta_samples_alone) + .set { sample_mutations_only } + + MUTATEDCELLSVAF( + sample_mutations_only, + CREATEPANELS.out.exons_consensus_bed, + OMEGA.out.results_global, + features_table, + ) } - if (params.oncodriveclustl){ + if (params.oncodriveclustl) { // OncodriveClustl - if (params.profileall){ + if (params.profileall) { ONCODRIVECLUSTL(somatic_mutations, MUTABILITYALL.out.mutability, CREATEPANELS.out.exons_consensus_panel) } } - if (params.signatures){ + if (params.signatures) { // Signature Analysis - if (params.profileall){ + if (params.profileall) { SIGNATURESALL(MUTPROFILEALL.out.wgs_sigprofiler, cosmic_ref, TABLE2GROUP.out.json_samples) somatic_mutations - .join(SIGNATURESALL.out.mutation_probs) - .set{mutations_n_sbs} + .join(SIGNATURESALL.out.mutation_probs) + .set { mutations_n_sbs } MUTS2SIGS(mutations_n_sbs) - - } - if (params.profilenonprot){ + if (params.profilenonprot) { SIGNATURESNONPROT(MUTPROFILENONPROT.out.wgs_sigprofiler, cosmic_ref, TABLE2GROUP.out.json_samples) } - if (params.profileexons){ + if (params.profileexons) { SIGNATURESEXONS(MUTPROFILEEXONS.out.wgs_sigprofiler, cosmic_ref, TABLE2GROUP.out.json_samples) } - if (params.profileintrons){ + if (params.profileintrons) { SIGNATURESINTRONS(MUTPROFILEINTRONS.out.wgs_sigprofiler, cosmic_ref, TABLE2GROUP.out.json_samples) } } - if ( params.omega & params.oncodrive3d & params.oncodrivefml & params.indels & (params.vep_species == 'homo_sapiens') ){ + if (params.omega & params.oncodrive3d & params.oncodrivefml & params.indels & (params.vep_species == 'homo_sapiens')) { positive_selection_results_ready = positive_selection_results.map { element -> [element[0], element[1..-1]] } - PLOTTINGSUMMARY(positive_selection_results_ready, - all_mutdensities_file, - site_comparison_results, - ANNOTATEDEPTHS.out.all_samples_depths, - TABLE2GROUP.out.json_samples, - TABLE2GROUP.out.json_allgroups, - CREATEPANELS.out.exons_consensus_panel, - CREATEPANELS.out.panel_annotated_rich, - seqinfo_df, - CREATEPANELS.out.domains_in_panel, - DNA2PROTEINMAPPING.out.depths_exons_positions - ) + PLOTTINGSUMMARY( + positive_selection_results_ready, + all_mutdensities_file, + site_comparison_results, + ANNOTATEDEPTHS.out.all_samples_depths, + TABLE2GROUP.out.json_samples, + TABLE2GROUP.out.json_allgroups, + CREATEPANELS.out.exons_consensus_panel, + CREATEPANELS.out.panel_annotated_rich, + seqinfo_df, + CREATEPANELS.out.domains_in_panel, + DNA2PROTEINMAPPING.out.depths_exons_positions, + ) } // Regressions - if (params.regressions){ + if (params.regressions) { - if (params.mutationdensity && params.mutdensity_regressions){ + if (params.mutationdensity && params.mutdensity_regressions) { REGRESSIONSMUTDENSITY("mutdensity", all_mutdensities_file, params.mutdensity_regressions) } - if (params.oncodrivefml && params.oncodrivefml_regressions){ + if (params.oncodrivefml && params.oncodrivefml_regressions) { REGRESSIONSONCODRIVEFML("oncodrivefml", oncodrivefml_regressions_files.toList(), params.oncodrivefml_regressions) } - if (params.omega && params.omega_regressions){ + if (params.omega && params.omega_regressions) { REGRESSIONSOMEGA("omega", omega_regressions_files.toList(), params.omega_regressions) } - if (params.omega_globalloc && params.omega_regressions){ + if (params.omega_globalloc && params.omega_regressions) { REGRESSIONSOMEGAGLOB("omegagloballoc", omega_regressions_files_gloc.toList(), params.omega_regressions) } - } - CUSTOM_DUMPSOFTWAREVERSIONS ( + CUSTOM_DUMPSOFTWAREVERSIONS( Channel.topic('versions').unique().collectFile(name: 'collated_versions.yml') ) @@ -560,19 +584,19 @@ workflow DEEPCSA{ // // MODULE: MultiQC // - ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) - ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config, checkIfExists: true ) : Channel.empty() - ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo, checkIfExists: true ) : Channel.empty() - ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) + ch_multiqc_config = Channel.fromPath("${projectDir}/assets/multiqc_config.yml", checkIfExists: true) + ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.empty() + ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath(params.multiqc_logo, checkIfExists: true) : Channel.empty() + ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("${projectDir}/assets/methods_description_template.yml", checkIfExists: true) // Info required for completion email and summary def multiqc_report = [] def summary_params = paramsSummaryMap(workflow) - workflow_summary = paramsSummaryMultiqc(summary_params) + workflow_summary = paramsSummaryMultiqc(summary_params) ch_workflow_summary = Channel.value(workflow_summary) - methods_description = methodsDescriptionText(ch_multiqc_custom_methods_description) + methods_description = methodsDescriptionText(ch_multiqc_custom_methods_description) ch_methods_description = Channel.value(methods_description) ch_multiqc_files = Channel.empty() @@ -580,18 +604,11 @@ workflow DEEPCSA{ ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) ch_multiqc_files = ch_multiqc_files.mix(CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect()) - MULTIQC ( + MULTIQC( ch_multiqc_files.collect(), ch_multiqc_config.toList(), ch_multiqc_custom_config.toList(), - ch_multiqc_logo.toList() + ch_multiqc_logo.toList(), ) multiqc_report = MULTIQC.out.report.toList() } - - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - THE END -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/