diff --git a/bin/compute_mutrate.py b/bin/compute_mutrate.py index b96e2486..7e63d55f 100755 --- a/bin/compute_mutrate.py +++ b/bin/compute_mutrate.py @@ -33,8 +33,8 @@ def mutrate_sample(maf_df, depths_df, depths_adj_df, sample_name, type_list = Fa # mutation rate metrics sample_features = {"N_MUTS" : n_muts, "N_MUTATED" : n_mutated_reads, - "DEPTH" : depths_df[f"{sample_name}"].sum(), - "DEPTH_ADJUSTED": depths_adj_df[f"{sample_name}"].sum() + "DEPTH" : depths_df.drop_duplicates(subset = ["CHROM", "POS"])[f"{sample_name}"].sum(), + "DEPTH_ADJUSTED": depths_adj_df[f"{sample_name}"].sum() # they should be the same for all impacts not for subsets of impacts } sample_features["MUTRATE_MB"] = ( sample_features["N_MUTS"] / sample_features["DEPTH"] * 1000000 ).astype(float) sample_features["MUTRATE_MB_ADJUSTED"] = ( sample_features["N_MUTS"] / sample_features["DEPTH_ADJUSTED"] * 1000000 ).astype(float) @@ -116,22 +116,26 @@ def compute_mutrate(maf_path, depths_path, annot_panel_path, sample_name, panel_ annot_panel_df = pd.read_csv(annot_panel_path, sep = "\t", na_values = custom_na_values) # Subset depths with panel - ## mode 1: each position counts one + ## mode 1: each position counts one (once per gene, be careful that it might be duplicated in different genes) depths_subset_df = depths_df.merge(annot_panel_df[["CHROM", "POS", "GENE"]].drop_duplicates(), on = ["CHROM", "POS"], how = "inner") ## mode 2 (adjusted): each position counts as many times it contributes to the panel depths_df[sample_name.split('.')[0]] = depths_df[sample_name.split('.')[0]] / 3 # the depth per position can contribute to three different mutations depths_subset_adj_df = depths_df.merge(annot_panel_df[["CHROM", "POS", "GENE"]], on = ["CHROM", "POS"], how = "inner") + ## mode 3 (adjusted): each position counts as many times it contributes to the panel, but ONLY ONCE PER SAMPLE + depths_subset_adj_sample_df = depths_df.merge(annot_panel_df.drop_duplicates(subset = ["CHROM", "POS", "REF", "ALT"])[["CHROM", "POS"]], + on = ["CHROM", "POS"], how = "inner") + del depths_df del annot_panel_df # Compute mutation rates ## sample mutation rate - mutrate_sample_allmuts_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_df, sample_name.split('.')[0]) - mutrate_sample_snvs_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_df, sample_name.split('.')[0], ["SNV"]) - mutrate_sample_nonsnvs_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_df, sample_name.split('.')[0], ["INSERTION", "DELETION", "COMPLEX", "MNV"]) - mutrate_sample_indels_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_df, sample_name.split('.')[0], ["INSERTION", "DELETION"]) + mutrate_sample_allmuts_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_sample_df, sample_name.split('.')[0]) + mutrate_sample_snvs_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_sample_df, sample_name.split('.')[0], ["SNV"]) + mutrate_sample_nonsnvs_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_sample_df, sample_name.split('.')[0], ["INSERTION", "DELETION", "COMPLEX", "MNV"]) + mutrate_sample_indels_df = mutrate_sample(maf_df, depths_subset_df, depths_subset_adj_sample_df, sample_name.split('.')[0], ["INSERTION", "DELETION"]) ## per gene mutation rate mutrate_genes_allmuts_df = mutrate_gene(maf_df, depths_subset_df, depths_subset_adj_df, sample_name.split('.')[0]) mutrate_genes_snvs_df = mutrate_gene(maf_df, depths_subset_df, depths_subset_adj_df, sample_name.split('.')[0], ["SNV"]) @@ -145,9 +149,12 @@ def compute_mutrate(maf_path, depths_path, annot_panel_path, sample_name, panel_ # Save mutrate_df[["SAMPLE_ID", "GENE", "REGIONS", "MUTTYPES", - "N_MUTS", "N_MUTATED", "DEPTH", - "MUTRATE_MB", "MUTRATE_MB_ADJUSTED", "MUTRATE_KB", "MUTREADSRATE_KB_ADJUSTED", - "MUTREADSRATE_MB", "MUTREADSRATE_MB_ADJUSTED", "MUTREADSRATE_KB", "MUTREADSRATE_KB_ADJUSTED"]].to_csv(f"{sample_name.split('.')[0]}.{panel_v}.mutrates.tsv", + "DEPTH", + "N_MUTS", "N_MUTATED", + "MUTRATE_MB", "MUTRATE_MB_ADJUSTED", + "MUTRATE_KB", "MUTRATE_KB_ADJUSTED", + "MUTREADSRATE_MB", "MUTREADSRATE_MB_ADJUSTED", + "MUTREADSRATE_KB", "MUTREADSRATE_KB_ADJUSTED"]].to_csv(f"{sample_name.split('.')[0]}.{panel_v}.mutrates.tsv", sep = "\t", header = True, index = False diff --git a/conf/mice.config b/conf/mice.config index 840e99cc..6c19a796 100644 --- a/conf/mice.config +++ b/conf/mice.config @@ -3,15 +3,15 @@ params { config_profile_description = 'Running deepCSA for mice data' // Input data - input = '/workspace/nobackup2/prominent/ucsf_mice/deepUMIcaller/deepCSA_input.med.double_bam.csv' + input = '/data/bbg/nobackup2/prominent/ucsf_mice/deepUMIcaller/deepCSA_input.med.csv' // Fasta references - fasta = '/workspace/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 = "/workspace/nobackup2/prominent/ucsf_mice/2024-08-07_clinical_features_summary.tsv" + features_table = "/data/bbg/nobackup2/prominent/ucsf_mice/2024-10-13_clinical_features_summary.tsv" features_table_separator = 'tab' features_table_dict = ['"unique_identifier" : "sample"', - '"groups_of_interest" : [ ["DMBA"], ["TPA"], ["treatment"], ["sex"] ]' + '"groups_of_interest" : [ ["DMBA"], ["TPA"], ["treatment"], ["sex"], ["timepoint"], ["timepoint", "treatment"], ["timepoint", "TPA"], ["timepoint", "DMBA"] ]' ].join(',\t').trim() use_custom_minimum_depth = 5 @@ -24,15 +24,15 @@ params { vep_out_format = "tab" vep_params = "--no_stats --cache --offline --symbol --protein --canonical" vep_species = "mus_musculus" - vep_cache = "/workspace/datasets/vep/mus_musculus/111_GRCm39" + vep_cache = "/data/bbg/datasets/vep/mus_musculus/111_GRCm39" // oncodrive3d - datasets3d = "/workspace/nobackup/scratch/oncodrive3d/datasets_mouse" + datasets3d = "/data/bbg/nobackup/scratch/oncodrive3d/datasets_mouse" // annotations3d = "/workspace/nobackup/scratch/oncodrive3d/annotations_240506" - omega_hotspots = false - omega_hotspots_bedfile = "/workspace/datasets/transfer/ferriol_deepcsa/mouse_skin_panel.hotspots.bed4.bed" + omega_hotspots = true + omega_hotspots_bedfile = "/data/bbg/datasets/transfer/ferriol_deepcsa/mouse_skin_panel.hotspots.bed4.bed" hotspot_expansion = 30 @@ -43,20 +43,20 @@ params { // o3d_plot = false // o3d_plot_chimerax = false - omega = false + omega = true omega_globalloc = false omega_vaf_distorsioned = false - omega_plot = false + omega_plot = true - signatures = false - mutationrate = false + signatures = true + mutationrate = true mutated_epithelium = false mutated_epithelium_vaf = false indels = false - profileall = false + profileall = true profilenonprot = false profileexons = false profileintrons = false diff --git a/conf/modules.config b/conf/modules.config index 36b1a7ae..5eec249d 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -158,6 +158,16 @@ process { ] } + withName: 'BBG_DEEPCSA:CREATEPANELS:CREATESAMPLEPANELSSYNONYMOUS' { + publishDir = [ + [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/createpanels/samplepanels/createsamplepanelssynonymous" }, + pattern: "*{tsv,bed}" + ] + ] + } + withName: 'SUBSETDEPTHS' { ext.prefix = { "${meta.id}.subset_depths" } @@ -170,6 +180,30 @@ process { enabled : false ] } + if (params.store_depths){ + withName: 'DEPTHS.*CONS' { + ext.prefix = { "${meta.id}.subset_depths" } + ext.args = '' + ext.args2 = '-s 1 -b 2 -e 2' + ext.args3 = '-h' + ext.extension = 'tsv' + ext.header = '1' + } + } else { + withName: 'DEPTHS.*CONS' { + ext.prefix = { "${meta.id}.subset_depths" } + ext.args = '' + ext.args2 = '-s 1 -b 2 -e 2' + ext.args3 = '-h' + ext.extension = 'tsv' + ext.header = '1' + publishDir = [ + enabled : false + ] + } + + } + withName: 'SUBSETMUTATIONS' { ext.prefix = { "${meta.id}.subset_mutations" } @@ -328,7 +362,7 @@ process { // } - withName: 'SUBSET_MUTPROFILE' { + withName: 'SUBSETMUTPROFILE' { ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() } ext.output_fmt = { ['"header": true', @@ -343,7 +377,7 @@ process { } if (params.profilenonprot){ - withName: '.*NONPROT:SUBSET_MUTPROFILE' { + withName: '.*NONPROT:SUBSETMUTPROFILE' { ext.filters = { [ '"TYPE" : "SNV"', '"Protein_affecting": "non_protein_affecting"'].join(',\t').trim() } @@ -360,7 +394,7 @@ process { } - withName: 'SUBSET_MUTABILITY' { + withName: 'SUBSETMUTABILITY' { ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() } ext.output_fmt = { ['"header": true', @@ -399,7 +433,7 @@ process { } if (params.mutationrate) { - withName: 'SUBSET_MUTRATE' { + withName: 'SUBSETMUTRATE' { ext.filters = '' ext.output_fmt = { ['"header": true', @@ -413,7 +447,7 @@ process { ] } - withName: 'BBG_DEEPCSA:MUTRATEPROT:SUBSET_MUTRATE' { + withName: 'BBG_DEEPCSA:MUTRATEPROT:SUBSETMUTRATE' { ext.filters = { ['"Protein_affecting": "protein_affecting"'].join(',\t').trim() } ext.output_fmt = { ['"header": true', @@ -427,7 +461,7 @@ process { ] } - withName: '.*NONPROT:SUBSET_MUTRATE' { + withName: '.*NONPROT:SUBSETMUTRATE' { ext.filters = { ['"Protein_affecting": "non_protein_affecting"'].join(',\t').trim() } ext.output_fmt = { ['"header": true', @@ -441,7 +475,7 @@ process { ] } - withName: '.*SYNONYMOUS:SUBSET_MUTRATE' { + withName: '.*SYNONYMOUS:SUBSETMUTRATE' { ext.filters = { ['"canonical_Consequence_broader": "synonymous"'].join(',\t').trim() } ext.output_fmt = { ['"header": true', @@ -459,7 +493,7 @@ process { if (params.indels) { - withName: 'SUBSET_INDELS' { + withName: 'SUBSETINDELS' { // ext.filters = '' ext.filters = { ['"FILTER": "notcontains repetitive_variant"'].join(',\t').trim() } @@ -478,7 +512,7 @@ process { if (params.mutated_epithelium) { - withName: 'SUBSET_MUTEPI' { + withName: 'SUBSETMUTEPI' { ext.filters = { ['"Protein_affecting": "protein_affecting"', '"TYPE" : "SNV"', '"VAF" : "gt 0"', @@ -504,7 +538,7 @@ process { } if (params.pileup_all_duplex){ - withName: 'SUBSET_MUTEPI' { + withName: 'SUBSETMUTEPI' { ext.filters = { ['"Protein_affecting": "protein_affecting"', '"TYPE" : "SNV"', '"VAF" : "gt 0"', @@ -532,7 +566,7 @@ process { } if (params.mutated_epithelium_vaf) { - withName: 'SUBSET_MUTEPIVAF' { + withName: 'SUBSETMUTEPIVAF' { ext.filters = { ['"Protein_affecting": "protein_affecting"', '"TYPE" : "SNV"', '"VAF" : "gt 0"', @@ -548,7 +582,7 @@ process { ] } if (params.all_duplex_counts){ - withName: 'SUBSET_MUTEPIVAFAM' { + withName: 'SUBSETMUTEPIVAFAM' { ext.filters = { ['"Protein_affecting": "protein_affecting"', '"TYPE" : "SNV"', '"VAF_AM" : "gt 0"', @@ -569,7 +603,7 @@ process { } if (params.oncodrivefml) { - withName: 'SUBSET_ONCODRIVEFML' { + withName: 'SUBSETONCODRIVEFML' { ext.filters = { "" } ext.output_fmt = { ['"header": true', '"columns": ["CHROM_ensembl", "POS_ensembl", "REF_ensembl", "ALT_ensembl", "SAMPLE_ID"]', @@ -591,7 +625,7 @@ process { } if (params.oncodrive3d){ - withName: 'SUBSET_ONCODRIVE3D' { + withName: 'SUBSETONCODRIVE3D' { ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() // '"canonical_Consequence": "contains missense_variant"' } @@ -663,7 +697,7 @@ process { - withName: 'SUBSET_ONCODRIVECLUSTL' { + withName: 'SUBSETONCODRIVECLUSTL' { ext.filters = { "" } // ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() diff --git a/conf/tools/omega.config b/conf/tools/omega.config index 20e4efb0..b910418f 100644 --- a/conf/tools/omega.config +++ b/conf/tools/omega.config @@ -12,7 +12,7 @@ process { - withName: 'SUBSET_OMEGA' { + withName: 'SUBSETOMEGA' { ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() } ext.output_fmt = { ['"header": true', @@ -27,7 +27,7 @@ process { } - withName: '.*MULTI:SUBSET_OMEGA' { + withName: '.*MULTI:SUBSETOMEGA' { ext.filters = { ['"TYPE" : "SNV"'].join(',\t').trim() } ext.output_fmt = { ['"header": true', @@ -163,7 +163,7 @@ process { ] ] } - withName: 'SUBSET_OMEGA_REDUCED' { + withName: 'SUBSETOMEGA_REDUCED' { ext.filters = { ['"TYPE" : "SNV"', '"VAF_distorted_reduced" : true', ].join(',\t').trim() @@ -201,7 +201,7 @@ process { ] ] } - withName: 'SUBSET_OMEGA_EXPANDED' { + withName: 'SUBSETOMEGA_EXPANDED' { ext.filters = { ['"TYPE" : "SNV"', '"VAF_distorted_expanded" : true', ].join(',\t').trim() @@ -239,7 +239,7 @@ process { ] ] } - withName: 'SUBSET_OMEGA_OK' { + withName: 'SUBSETOMEGA_OK' { ext.filters = { ['"TYPE" : "SNV"', '"VAF_distorted" : false', ].join(',\t').trim() diff --git a/modules/local/signatures/sigprofiler/assignment/main.nf b/modules/local/signatures/sigprofiler/assignment/main.nf index 7fe85de9..f07beb31 100644 --- a/modules/local/signatures/sigprofiler/assignment/main.nf +++ b/modules/local/signatures/sigprofiler/assignment/main.nf @@ -29,8 +29,7 @@ process SIGPROFILERASSIGNMENT { // sample_reconstruction_plots=False, verbose=False)" """ #python -c "from SigProfilerAssignment import Analyzer as Analyze; Analyze.cosmic_fit('${matrix}', 'output_${prefix}', input_type='matrix', context_type='96', signature_database='${reference_signatures}', genome_build='${assembly}', sample_reconstruction_plots= 'pdf', exclude_signature_subgroups= ${params.exclude_subgroups})" - python -c "from SigProfilerAssignment import Analyzer as Analyze; Analyze.cosmic_fit('${matrix}', 'output_${prefix}', input_type='matrix', context_type='96', genome_build='${assembly}', exclude_signature_subgroups=${params.exclude_subgroups})" - #python -c "from SigProfilerAssignment import Analyzer as Analyze; Analyze.cosmic_fit('${matrix}', 'output_${prefix}', input_type='matrix', context_type='96', genome_build='${assembly}', signature_database='${reference_signatures}', exclude_signature_subgroups=${params.exclude_subgroups})" + python -c "from SigProfilerAssignment import Analyzer as Analyze; Analyze.cosmic_fit('${matrix}', 'output_${prefix}', input_type='matrix', context_type='96', genome_build='${assembly}', signature_database='${reference_signatures}', exclude_signature_subgroups=${params.exclude_subgroups})" mv output_${prefix}/Assignment_Solution/Activities/Decomposed_MutationType_Probabilities.txt output_${prefix}/Assignment_Solution/Activities/Decomposed_MutationType_Probabilities.${prefix}.txt; diff --git a/nextflow.config b/nextflow.config index bb93713a..c49f5bea 100644 --- a/nextflow.config +++ b/nextflow.config @@ -58,6 +58,7 @@ params { all_duplex_counts = false pileup_all_duplex = false plot_depths = false + store_depths = false // depth and panel diff --git a/subworkflows/local/indels/main.nf b/subworkflows/local/indels/main.nf index 70a65778..a23f0eaf 100644 --- a/subworkflows/local/indels/main.nf +++ b/subworkflows/local/indels/main.nf @@ -1,7 +1,6 @@ -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 { SUBSET_MAF as SUBSET_INDELS } 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' @@ -18,10 +17,10 @@ workflow INDELS_SELECTION { SUBSETMUTATIONS(mutations, bedfile) ch_versions = ch_versions.mix(SUBSETMUTATIONS.out.versions) - SUBSET_INDELS(SUBSETMUTATIONS.out.subset) - ch_versions = ch_versions.mix(SUBSET_INDELS.out.versions) + SUBSETINDELS(SUBSETMUTATIONS.out.subset) + ch_versions = ch_versions.mix(SUBSETINDELS.out.versions) - INDELS(SUBSET_INDELS.out.mutations) + INDELS(SUBSETINDELS.out.mutations) ch_versions = ch_versions.mix(INDELS.out.versions) emit: diff --git a/subworkflows/local/mutability/main.nf b/subworkflows/local/mutability/main.nf index 1505031c..197295e6 100644 --- a/subworkflows/local/mutability/main.nf +++ b/subworkflows/local/mutability/main.nf @@ -1,12 +1,7 @@ -// include { INTERSECT_BED as BED_INTERSECTALL } from '../../modules/local/bedtools/intersect/main' -// include { INTERSECT_BED as BED_INTERSECTPA } from '../../modules/local/bedtools/intersect/main' -// include { INTERSECT_BED as BED_INTERSECTNONPA } from '../../modules/local/bedtools/intersect/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 { SUBSET_MAF as SUBSET_MUTABILITY } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETMUTABILITY } from '../../../modules/local/subsetmaf/main' include { COMPUTE_MUTABILITY as COMPUTEMUTABILITY } from '../../../modules/local/compute_mutability/main' @@ -27,28 +22,16 @@ workflow MUTABILITY { // actual code ch_versions = Channel.empty() - // // Intersect BED of all sites with BED of sample filtered sites - // BED_INTERSECTALL(bedfiles.all_sites, bedfiles.sample_discarded) - - // BED_INTERSECTPA(bedfiles.pa_sites, bedfiles.sample_discarded) - - // BED_INTERSECTNONPA(bedfiles.nonpa_sites, bedfiles.sample_discarded) - - // BED_INTERSECTALL.out.bed - // .join( BED_INTERSECTPA.out.bed ) - // .join( BED_INTERSECTNONPA.out.bed ) - // .set { all_beds } - - // bedfiles.all_sites - // .join( bedfiles.pa_sites ) - // .join( bedfiles.nonpa_sites ) - // .set { all_beds } - - SUBSETDEPTHS(depth, bedfiles) + // this line was not needed nor used in the computation of mutabilities, + // since there is an additional left_join merge in the compute mutabilities code, + // the depths can be the full ones + // SUBSETDEPTHS(depth, bedfiles) SUBSETMUTATIONS(mutations, bedfiles) + ch_versions = ch_versions.mix(SUBSETMUTATIONS.out.versions) + - SUBSET_MUTABILITY(SUBSETMUTATIONS.out.subset) - SUBSET_MUTABILITY.out.mutations + SUBSETMUTABILITY(SUBSETMUTATIONS.out.subset) + SUBSETMUTABILITY.out.mutations .join(profile) .join(depth) .set{ mutations_n_profile_n_depth } diff --git a/subworkflows/local/mutatedepithelium/expected/main.nf b/subworkflows/local/mutatedepithelium/expected/main.nf index 6f0d1f33..0d03d9a0 100644 --- a/subworkflows/local/mutatedepithelium/expected/main.nf +++ b/subworkflows/local/mutatedepithelium/expected/main.nf @@ -1,7 +1,7 @@ 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 { SUBSET_MAF as SUBSET_MUTEPIVAF } from '../../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETMUTEPIVAF } from '../../../../modules/local/subsetmaf/main' include { EXP_MUTRATE as EXPMUTRATE } from '../../../../modules/local/expected_mutrate/main' @@ -25,8 +25,8 @@ workflow EXPECTED_MUTRATE { SUBSETDEPTHS(depth, bedfile) ch_versions = ch_versions.mix(SUBSETDEPTHS.out.versions) - // SUBSET_MUTEPIVAF(SUBSETMUTATIONS.out.subset) - // ch_versions = ch_versions.mix(SUBSET_MUTEPIVAF.out.versions) + // SUBSETMUTEPIVAF(SUBSETMUTATIONS.out.subset) + // ch_versions = ch_versions.mix(SUBSETMUTEPIVAF.out.versions) EXPMUTRATE(panel, SUBSETMUTATIONS.out.subset, SUBSETDEPTHS.out.subset) ch_versions = ch_versions.mix(EXPMUTRATE.out.versions) diff --git a/subworkflows/local/mutatedepithelium/reads/main.nf b/subworkflows/local/mutatedepithelium/reads/main.nf index f988e85f..65e2d3c8 100644 --- a/subworkflows/local/mutatedepithelium/reads/main.nf +++ b/subworkflows/local/mutatedepithelium/reads/main.nf @@ -6,7 +6,7 @@ include { CREATECUSTOMBEDFILE as READSPOSBED } from ' include { READS_PER_REGION as READSPERREGION } from '../../../../modules/local/reads_per_region/main' include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSET_MUTEPI } from '../../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETMUTEPI } from '../../../../modules/local/subsetmaf/main' include { COMPUTE_MUTATED_EPITHELIUM as COMPUTEMUTATEDEPITHELIUM } from '../../../../modules/local/computemutatedepithelium/main' @@ -60,10 +60,10 @@ workflow MUTATED_EPITHELIUM { SUBSETMUTATIONS(mutations, bedfile) ch_versions = ch_versions.mix(SUBSETMUTATIONS.out.versions) - SUBSET_MUTEPI(SUBSETMUTATIONS.out.subset) - ch_versions = ch_versions.mix(SUBSET_MUTEPI.out.versions) + SUBSETMUTEPI(SUBSETMUTATIONS.out.subset) + ch_versions = ch_versions.mix(SUBSETMUTEPI.out.versions) - SUBSET_MUTEPI.out.mutations + SUBSETMUTEPI.out.mutations .join(READSPERREGION.out.read_counts.map{it -> [ ["id" : it[0].id] , it[1] ] }) .set{ mutations_n_reads } diff --git a/subworkflows/local/mutatedepithelium/vaf/main.nf b/subworkflows/local/mutatedepithelium/vaf/main.nf index 078f8545..de6511c9 100644 --- a/subworkflows/local/mutatedepithelium/vaf/main.nf +++ b/subworkflows/local/mutatedepithelium/vaf/main.nf @@ -1,11 +1,11 @@ include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSET_MUTEPIVAF } from '../../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETMUTEPIVAF } from '../../../../modules/local/subsetmaf/main' include { MUTATED_GENOMES_FROM_VAF as MUTATEDGENOMESFROMVAF } from '../../../../modules/local/mutatedgenomesfromvaf/main' if (params.all_duplex_counts){ - include { SUBSET_MAF as SUBSET_MUTEPIVAFAM } from '../../../../modules/local/subsetmaf/main' + include { SUBSET_MAF as SUBSETMUTEPIVAFAM } from '../../../../modules/local/subsetmaf/main' include { MUTATED_GENOMES_FROM_VAF as MUTATEDGENOMESFROMVAFAM } from '../../../../modules/local/mutatedgenomesfromvaf/main' } @@ -23,17 +23,17 @@ workflow MUTATED_EPITHELIUM_VAF { SUBSETMUTATIONS(mutations, bedfile) ch_versions = ch_versions.mix(SUBSETMUTATIONS.out.versions) - SUBSET_MUTEPIVAF(SUBSETMUTATIONS.out.subset) - ch_versions = ch_versions.mix(SUBSET_MUTEPIVAF.out.versions) + SUBSETMUTEPIVAF(SUBSETMUTATIONS.out.subset) + ch_versions = ch_versions.mix(SUBSETMUTEPIVAF.out.versions) - MUTATEDGENOMESFROMVAF(SUBSET_MUTEPIVAF.out.mutations) + MUTATEDGENOMESFROMVAF(SUBSETMUTEPIVAF.out.mutations) ch_versions = ch_versions.mix(MUTATEDGENOMESFROMVAF.out.versions) if (params.all_duplex_counts){ - SUBSET_MUTEPIVAFAM(SUBSETMUTATIONS.out.subset) - ch_versions = ch_versions.mix(SUBSET_MUTEPIVAFAM.out.versions) + SUBSETMUTEPIVAFAM(SUBSETMUTATIONS.out.subset) + ch_versions = ch_versions.mix(SUBSETMUTEPIVAFAM.out.versions) - MUTATEDGENOMESFROMVAFAM(SUBSET_MUTEPIVAFAM.out.mutations) + MUTATEDGENOMESFROMVAFAM(SUBSETMUTEPIVAFAM.out.mutations) ch_versions = ch_versions.mix(MUTATEDGENOMESFROMVAFAM.out.versions) } diff --git a/subworkflows/local/mutationprofile/main.nf b/subworkflows/local/mutationprofile/main.nf index b3a30ba4..5dc98b97 100644 --- a/subworkflows/local/mutationprofile/main.nf +++ b/subworkflows/local/mutationprofile/main.nf @@ -1,8 +1,7 @@ -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 { SUBSET_MAF as SUBSET_MUTPROFILE } 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' @@ -24,19 +23,18 @@ workflow MUTATIONAL_PROFILE { ch_versions = Channel.empty() // Intersect BED of all sites with BED of sample filtered sites - SUBSETDEPTHS(depth, bedfile) SUBSETMUTATIONS(mutations, bedfile) - SUBSET_MUTPROFILE(SUBSETMUTATIONS.out.subset) + SUBSETMUTPROFILE(SUBSETMUTATIONS.out.subset) - COMPUTEMATRIX(SUBSET_MUTPROFILE.out.mutations) + COMPUTEMATRIX(SUBSETMUTPROFILE.out.mutations) COMPUTEMATRIX.out.per_sample_sigprof .join( Channel.of([ [ id: "all_samples" ], [] ]) ) .map{ it -> [ it[0], it[1]] } .set{ sigprofiler_matrix } - COMPUTETRINUC(SUBSETDEPTHS.out.subset) + COMPUTETRINUC(depth) COMPUTEMATRIX.out.matrix .join(COMPUTETRINUC.out.trinucleotides) diff --git a/subworkflows/local/mutationrate/main.nf b/subworkflows/local/mutationrate/main.nf index f41538ac..38d75357 100644 --- a/subworkflows/local/mutationrate/main.nf +++ b/subworkflows/local/mutationrate/main.nf @@ -1,7 +1,6 @@ -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 { SUBSET_MAF as SUBSET_MUTRATE } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETMUTRATE } from '../../../modules/local/subsetmaf/main' include { MUTRATE as MUTRATE } from '../../../modules/local/computemutrate/main' @@ -17,17 +16,14 @@ workflow MUTATION_RATE{ ch_versions = Channel.empty() // Intersect BED of all sites with BED of sample filtered sites - SUBSETDEPTHS(depth, bedfile) - ch_versions = ch_versions.mix(SUBSETDEPTHS.out.versions) - SUBSETMUTATIONS(mutations, bedfile) ch_versions = ch_versions.mix(SUBSETMUTATIONS.out.versions) - SUBSET_MUTRATE(SUBSETMUTATIONS.out.subset) - ch_versions = ch_versions.mix(SUBSET_MUTRATE.out.versions) + SUBSETMUTRATE(SUBSETMUTATIONS.out.subset) + ch_versions = ch_versions.mix(SUBSETMUTRATE.out.versions) - SUBSET_MUTRATE.out.mutations - .join(SUBSETDEPTHS.out.subset) + SUBSETMUTRATE.out.mutations + .join(depth) .set{ mutations_n_depth } MUTRATE(mutations_n_depth, panel) diff --git a/subworkflows/local/omega/main.nf b/subworkflows/local/omega/main.nf index b282afa9..d1d33f65 100644 --- a/subworkflows/local/omega/main.nf +++ b/subworkflows/local/omega/main.nf @@ -1,14 +1,13 @@ -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 { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSET_OMEGA } from '../../../modules/local/subsetmaf/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 { SUBSET_MAF as SUBSETOMEGA } from '../../../modules/local/subsetmaf/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' if (params.omega_hotspots){ - include { EXPAND_REGIONS as EXPANDREGIONS } from '../../../modules/local/expand_regions/main' + include { EXPAND_REGIONS as EXPANDREGIONS } from '../../../modules/local/expand_regions/main' } @@ -20,20 +19,20 @@ if (params.omega_globalloc){ include { OMEGA_PREPROCESS as PREPROCESSINGGLOBALLOC } from '../../../modules/local/bbgtools/omega/preprocess/main' include { OMEGA_ESTIMATOR as ESTIMATORGLOBALLOC } from '../../../modules/local/bbgtools/omega/estimator/main' if (params.omega_plot){ - include { PLOT_OMEGA as PLOTOMEGAGLOBALLOC } from '../../../modules/local/plot/omega/main' + include { PLOT_OMEGA as PLOTOMEGAGLOBALLOC } from '../../../modules/local/plot/omega/main' } } if (params.omega_vaf_distorsioned){ - include { SUBSET_MAF as SUBSET_OMEGA_EXPANDED } from '../../../modules/local/subsetmaf/main' + include { SUBSET_MAF as SUBSETOMEGA_EXPANDED } from '../../../modules/local/subsetmaf/main' include { OMEGA_PREPROCESS as PREPROCESSINGEXP } from '../../../modules/local/bbgtools/omega/preprocess/main' include { OMEGA_ESTIMATOR as ESTIMATOREXP } from '../../../modules/local/bbgtools/omega/estimator/main' - include { SUBSET_MAF as SUBSET_OMEGA_OK } from '../../../modules/local/subsetmaf/main' + include { SUBSET_MAF as SUBSETOMEGA_OK } from '../../../modules/local/subsetmaf/main' include { OMEGA_PREPROCESS as PREPROCESSINGOK } from '../../../modules/local/bbgtools/omega/preprocess/main' include { OMEGA_ESTIMATOR as ESTIMATOROK } from '../../../modules/local/bbgtools/omega/estimator/main' - include { SUBSET_MAF as SUBSET_OMEGA_REDUCED } from '../../../modules/local/subsetmaf/main' + include { SUBSET_MAF as SUBSETOMEGA_REDUCED } from '../../../modules/local/subsetmaf/main' include { OMEGA_PREPROCESS as PREPROCESSINGRED } from '../../../modules/local/bbgtools/omega/preprocess/main' include { OMEGA_ESTIMATOR as ESTIMATORRED } from '../../../modules/local/bbgtools/omega/estimator/main' } @@ -58,17 +57,14 @@ workflow OMEGA_ANALYSIS{ ch_versions = Channel.empty() // Intersect BED of all sites with BED of sample filtered sites - SUBSETDEPTHS(depth, bedfile) - ch_versions = ch_versions.mix(SUBSETDEPTHS.out.versions) - SUBSETMUTATIONS(mutations, bedfile) ch_versions = ch_versions.mix(SUBSETMUTATIONS.out.versions) - SUBSET_OMEGA(SUBSETMUTATIONS.out.subset) - ch_versions = ch_versions.mix(SUBSET_OMEGA.out.versions) + SUBSETOMEGA(SUBSETMUTATIONS.out.subset) + ch_versions = ch_versions.mix(SUBSETOMEGA.out.versions) - SUBSET_OMEGA.out.mutations - .join( SUBSETDEPTHS.out.subset ) + SUBSETOMEGA.out.mutations + .join( depth ) .join( profile ) .set{ muts_n_depths_n_profile } @@ -88,7 +84,7 @@ workflow OMEGA_ANALYSIS{ ch_versions = ch_versions.mix(PREPROCESSING.out.versions) PREPROCESSING.out.mutabs_n_mutations_tsv - .join( SUBSETDEPTHS.out.subset ) + .join( depth ) .set{ preprocess_n_depths } Channel.of([ [ id: "all_samples" ] ]) @@ -121,7 +117,7 @@ workflow OMEGA_ANALYSIS{ ch_versions = ch_versions.mix(PREPROCESSINGGLOBALLOC.out.versions) PREPROCESSINGGLOBALLOC.out.mutabs_n_mutations_tsv - .join( SUBSETDEPTHS.out.subset ) + .join( depth ) .set{ preprocess_globalloc_n_depths } ESTIMATORGLOBALLOC( preprocess_globalloc_n_depths, expanded_panel, GROUPGENES.out.json_genes.first()) @@ -150,11 +146,11 @@ workflow OMEGA_ANALYSIS{ .join( SUBSETMUTATIONS.out.subset ) .set{ all_samples_muts } - SUBSET_OMEGA_EXPANDED(all_samples_muts) - ch_versions = ch_versions.mix(SUBSET_OMEGA_EXPANDED.out.versions) + SUBSETOMEGA_EXPANDED(all_samples_muts) + ch_versions = ch_versions.mix(SUBSETOMEGA_EXPANDED.out.versions) - SUBSET_OMEGA_EXPANDED.out.mutations - .join( SUBSETDEPTHS.out.subset ) + SUBSETOMEGA_EXPANDED.out.mutations + .join( depth ) .join( profile ) .set{ muts_n_depths_n_profile_exp } @@ -163,7 +159,7 @@ workflow OMEGA_ANALYSIS{ ch_versions = ch_versions.mix(PREPROCESSINGEXP.out.versions) PREPROCESSINGEXP.out.mutabs_n_mutations_tsv - .join( SUBSETDEPTHS.out.subset ) + .join( depth ) .set{ preprocess_n_depths_exp } ESTIMATOREXP( preprocess_n_depths_exp, expanded_panel, GROUPGENES.out.json_genes.first()) @@ -172,11 +168,11 @@ workflow OMEGA_ANALYSIS{ - SUBSET_OMEGA_OK(all_samples_muts) - ch_versions = ch_versions.mix(SUBSET_OMEGA_OK.out.versions) + SUBSETOMEGA_OK(all_samples_muts) + ch_versions = ch_versions.mix(SUBSETOMEGA_OK.out.versions) - SUBSET_OMEGA_OK.out.mutations - .join( SUBSETDEPTHS.out.subset ) + SUBSETOMEGA_OK.out.mutations + .join( depth ) .join( profile ) .set{ muts_n_depths_n_profile_ok } @@ -185,7 +181,7 @@ workflow OMEGA_ANALYSIS{ ch_versions = ch_versions.mix(PREPROCESSINGEXP.out.versions) PREPROCESSINGOK.out.mutabs_n_mutations_tsv - .join( SUBSETDEPTHS.out.subset ) + .join( depth ) .set{ preprocess_n_depths_ok } ESTIMATOROK( preprocess_n_depths_ok, expanded_panel, GROUPGENES.out.json_genes.first()) @@ -193,11 +189,11 @@ workflow OMEGA_ANALYSIS{ - SUBSET_OMEGA_REDUCED(all_samples_muts) - ch_versions = ch_versions.mix(SUBSET_OMEGA_REDUCED.out.versions) + SUBSETOMEGA_REDUCED(all_samples_muts) + ch_versions = ch_versions.mix(SUBSETOMEGA_REDUCED.out.versions) - SUBSET_OMEGA_REDUCED.out.mutations - .join( SUBSETDEPTHS.out.subset ) + SUBSETOMEGA_REDUCED.out.mutations + .join( depth ) .join( profile ) .set{ muts_n_depths_n_profile_red } @@ -206,7 +202,7 @@ workflow OMEGA_ANALYSIS{ ch_versions = ch_versions.mix(PREPROCESSINGRED.out.versions) PREPROCESSINGRED.out.mutabs_n_mutations_tsv - .join( SUBSETDEPTHS.out.subset ) + .join( depth ) .set{ preprocess_n_depths_red } ESTIMATORRED( preprocess_n_depths_red, expanded_panel, GROUPGENES.out.json_genes.first()) @@ -221,7 +217,6 @@ workflow OMEGA_ANALYSIS{ - emit: results = ESTIMATOR.out.results results_global = global_loc_results diff --git a/subworkflows/local/oncodrive3d/main.nf b/subworkflows/local/oncodrive3d/main.nf index b2e542d4..9e5bab72 100644 --- a/subworkflows/local/oncodrive3d/main.nf +++ b/subworkflows/local/oncodrive3d/main.nf @@ -1,6 +1,6 @@ include { TABIX_BGZIPTABIX_QUERY as SUBSETMUTATIONS } from '../../../modules/nf-core/tabix/bgziptabixquery/main' -include { SUBSET_MAF as SUBSET_ONCODRIVE3D } 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' @@ -27,19 +27,19 @@ workflow ONCODRIVE3D_ANALYSIS{ SUBSETMUTATIONS(mutations, bedfile) ch_versions = ch_versions.mix(SUBSETMUTATIONS.out.versions) - SUBSET_ONCODRIVE3D(SUBSETMUTATIONS.out.subset) - ch_versions = ch_versions.mix(SUBSET_ONCODRIVE3D.out.versions) + SUBSETONCODRIVE3D(SUBSETMUTATIONS.out.subset) + ch_versions = ch_versions.mix(SUBSETONCODRIVE3D.out.versions) // mutations preprocessing if (params.o3d_raw_vep){ - ONCODRIVE3D_PREPROCESSING(SUBSET_ONCODRIVE3D.out.mutations, raw_vep) + ONCODRIVE3D_PREPROCESSING(SUBSETONCODRIVE3D.out.mutations, raw_vep) ONCODRIVE3D_PREPROCESSING.out.vep_output4o3d .join(mutabilities) .set{ muts_n_mutability } } else { - SUBSET_ONCODRIVE3D.out.mutations + SUBSETONCODRIVE3D.out.mutations .join(mutabilities) .set{ muts_n_mutability } diff --git a/subworkflows/local/oncodriveclustl/main.nf b/subworkflows/local/oncodriveclustl/main.nf index 8df160de..9922a78d 100644 --- a/subworkflows/local/oncodriveclustl/main.nf +++ b/subworkflows/local/oncodriveclustl/main.nf @@ -1,6 +1,6 @@ include { CREATECUSTOMBEDFILE as ONCODRIVECLUSTLBED } from '../../../modules/local/createpanels/custombedfile/main' -include { SUBSET_MAF as SUBSET_ONCODRIVECLUSTL } 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 as ONCODRIVECLUSTLSNVS } from '../../../modules/local/bbgtools/oncodriveclustl/main' @@ -20,10 +20,10 @@ workflow ONCODRIVECLUSTL_ANALYSIS{ ONCODRIVECLUSTLBED(panel_file) ch_versions = ch_versions.mix(ONCODRIVECLUSTLBED.out.versions) - SUBSET_ONCODRIVECLUSTL(mutations) + SUBSETONCODRIVECLUSTL(mutations) ch_versions = ch_versions.mix(ONCODRIVECLUSTLBED.out.versions) - SUBSET_ONCODRIVECLUSTL.out.mutations + SUBSETONCODRIVECLUSTL.out.mutations .join(mutabilities) .set{ muts_n_mutability } diff --git a/subworkflows/local/oncodrivefml/main.nf b/subworkflows/local/oncodrivefml/main.nf index 2cdb31ec..8c2b34c2 100644 --- a/subworkflows/local/oncodrivefml/main.nf +++ b/subworkflows/local/oncodrivefml/main.nf @@ -1,6 +1,6 @@ include { CREATECUSTOMBEDFILE as ONCODRIVEFMLBED } from '../../../modules/local/createpanels/custombedfile/main' -include { SUBSET_MAF as SUBSET_ONCODRIVEFML } from '../../../modules/local/subsetmaf/main' +include { SUBSET_MAF as SUBSETONCODRIVEFML } from '../../../modules/local/subsetmaf/main' include { ONCODRIVEFML } from '../../../modules/local/bbgtools/oncodrivefml/main' include { ONCODRIVEFML as ONCODRIVEFMLSNVS } from '../../../modules/local/bbgtools/oncodrivefml/main' @@ -21,10 +21,10 @@ workflow ONCODRIVEFML_ANALYSIS{ ONCODRIVEFMLBED(panel_file) ch_versions = ch_versions.mix(ONCODRIVEFMLBED.out.versions) - SUBSET_ONCODRIVEFML(mutations) - ch_versions = ch_versions.mix(SUBSET_ONCODRIVEFML.out.versions) + SUBSETONCODRIVEFML(mutations) + ch_versions = ch_versions.mix(SUBSETONCODRIVEFML.out.versions) - SUBSET_ONCODRIVEFML.out.mutations + SUBSETONCODRIVEFML.out.mutations .join( mutabilities ) .set{ muts_n_mutability } diff --git a/workflows/deepcsa.nf b/workflows/deepcsa.nf index cc5f608c..9a739268 100644 --- a/workflows/deepcsa.nf +++ b/workflows/deepcsa.nf @@ -109,10 +109,16 @@ include { SIGNATURES as SIGNATURESINTRONS } from '../subworkfl include { PLOT_SELECTION_METRICS as PLOTSELECTION } from '../modules/local/plot/selection_metrics/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' // Download annotation cache if needed -include { PREPARE_CACHE } from '../subworkflows/local/prepare_cache/main' +include { PREPARE_CACHE } from '../subworkflows/local/prepare_cache/main' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -213,12 +219,22 @@ workflow DEEPCSA{ positive_selection_results = MUT_PREPROCESSING.out.somatic_mafs + // Intersect BED of desired sites with samples' depths + DEPTHSALLCONS(annotated_depths, CREATEPANELS.out.all_consensus_bed) + DEPTHSEXONSCONS(annotated_depths, CREATEPANELS.out.exons_consensus_bed) + DEPTHSPROTCONS(annotated_depths, CREATEPANELS.out.prot_consensus_bed) + DEPTHSNONPROTCONS(annotated_depths, CREATEPANELS.out.nonprot_consensus_bed) + DEPTHSINTRONSCONS(annotated_depths, CREATEPANELS.out.introns_consensus_bed) + DEPTHSSYNONYMOUSCONS(annotated_depths, CREATEPANELS.out.synonymous_consensus_bed) + ch_versions = ch_versions.mix(DEPTHSEXONSCONS.out.versions) + + if (params.mutationrate){ // Mutation Rate - MUTRATEALL(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.all_consensus_bed, CREATEPANELS.out.all_consensus_panel) - MUTRATEPROT(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.prot_consensus_bed, CREATEPANELS.out.prot_consensus_panel) - MUTRATENONPROT(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.nonprot_consensus_bed, CREATEPANELS.out.nonprot_consensus_panel) - MUTRATESYNONYMOUS(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.synonymous_consensus_bed, CREATEPANELS.out.synonymous_consensus_panel) + MUTRATEALL(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSALLCONS.out.subset, CREATEPANELS.out.all_consensus_bed, CREATEPANELS.out.all_consensus_panel) + MUTRATEPROT(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSPROTCONS.out.subset, CREATEPANELS.out.prot_consensus_bed, CREATEPANELS.out.prot_consensus_panel) + MUTRATENONPROT(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSNONPROTCONS.out.subset, CREATEPANELS.out.nonprot_consensus_bed, CREATEPANELS.out.nonprot_consensus_panel) + MUTRATESYNONYMOUS(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSSYNONYMOUSCONS.out.subset, CREATEPANELS.out.synonymous_consensus_bed, CREATEPANELS.out.synonymous_consensus_panel) ch_versions = ch_versions.mix(MUTRATEALL.out.versions) ch_versions = ch_versions.mix(MUTRATEPROT.out.versions) ch_versions = ch_versions.mix(MUTRATENONPROT.out.versions) @@ -239,19 +255,19 @@ workflow DEEPCSA{ // Mutational profile if (params.profileall){ - MUTPROFILEALL(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.all_consensus_bed, wgs_trinucs) + MUTPROFILEALL(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSALLCONS.out.subset, CREATEPANELS.out.all_consensus_bed, wgs_trinucs) ch_versions = ch_versions.mix(MUTPROFILEALL.out.versions) } if (params.profilenonprot){ - MUTPROFILENONPROT(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.nonprot_consensus_bed, wgs_trinucs) + MUTPROFILENONPROT(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSNONPROTCONS.out.subset, CREATEPANELS.out.nonprot_consensus_bed, wgs_trinucs) ch_versions = ch_versions.mix(MUTPROFILENONPROT.out.versions) } if (params.profileexons){ - MUTPROFILEEXONS(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.exons_consensus_bed, wgs_trinucs) + MUTPROFILEEXONS(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSEXONSCONS.out.subset, CREATEPANELS.out.exons_consensus_bed, wgs_trinucs) ch_versions = ch_versions.mix(MUTPROFILEEXONS.out.versions) } if (params.profileintrons){ - MUTPROFILEINTRONS(MUT_PREPROCESSING.out.somatic_mafs, annotated_depths, CREATEPANELS.out.introns_consensus_bed, wgs_trinucs) + MUTPROFILEINTRONS(MUT_PREPROCESSING.out.somatic_mafs, DEPTHSINTRONSCONS.out.subset, CREATEPANELS.out.introns_consensus_bed, wgs_trinucs) ch_versions = ch_versions.mix(MUTPROFILEINTRONS.out.versions) } @@ -408,7 +424,7 @@ workflow DEEPCSA{ // Omega if (params.profileall){ OMEGA(MUT_PREPROCESSING.out.somatic_mafs, - annotated_depths, + DEPTHSEXONSCONS.out.subset, MUTPROFILEALL.out.profile, CREATEPANELS.out.exons_consensus_bed, CREATEPANELS.out.exons_consensus_panel, @@ -421,7 +437,7 @@ workflow DEEPCSA{ // Omega multi OMEGAMULTI(MUT_PREPROCESSING.out.somatic_mafs, - annotated_depths, + DEPTHSEXONSCONS.out.subset, MUTPROFILEALL.out.profile, CREATEPANELS.out.exons_consensus_bed, CREATEPANELS.out.exons_consensus_panel, @@ -434,7 +450,7 @@ workflow DEEPCSA{ } if (params.profilenonprot){ OMEGANONPROT(MUT_PREPROCESSING.out.somatic_mafs, - annotated_depths, + DEPTHSEXONSCONS.out.subset, MUTPROFILENONPROT.out.profile, CREATEPANELS.out.exons_consensus_bed, CREATEPANELS.out.exons_consensus_panel, @@ -444,7 +460,7 @@ workflow DEEPCSA{ ch_versions = ch_versions.mix(OMEGANONPROT.out.versions) OMEGANONPROTMULTI(MUT_PREPROCESSING.out.somatic_mafs, - annotated_depths, + DEPTHSEXONSCONS.out.subset, MUTPROFILENONPROT.out.profile, CREATEPANELS.out.exons_consensus_bed, CREATEPANELS.out.exons_consensus_panel,