From 783ff86a5cf76426b05b31d8bf95eb565436a442 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Wed, 28 Feb 2024 16:25:56 -0600 Subject: [PATCH 01/17] Add output definition Signed-off-by: Ben Sherman --- main.nf | 60 ++++++++++ nextflow.config | 9 -- .../local/prepare_genome/nextflow.config | 78 ------------- workflows/rnaseq/nextflow.config | 107 ------------------ 4 files changed, 60 insertions(+), 194 deletions(-) diff --git a/main.nf b/main.nf index 59001a4f1..3ae9a5c7a 100755 --- a/main.nf +++ b/main.nf @@ -164,6 +164,66 @@ workflow { ) } +output { + path(params.outdir) { + path('genome', enabled: params.save_reference) { + select 'GUNZIP_.*' + select 'MAKE_TRANSCRIPTS_FASTA' + select 'GFFREAD' + select 'GTF2BED' + select 'CAT_ADDITIONAL_FASTA' + select 'PREPROCESS_TRANSCRIPTS_FASTA_GENCODE' + select 'GTF_FILTER' + select 'CUSTOM_GETCHROMSIZES' + } + + path('genome/index', enabled: params.save_reference) { + select 'UNTAR_.*' + select 'STAR_GENOMEGENERATE' + select 'STAR_GENOMEGENERATE_IGENOMES' + select 'HISAT2_BUILD' + select 'HISAT2_EXTRACTSPLICESITES' + select 'SALMON_INDEX' + select 'KALLISTO_INDEX' + select 'RSEM_PREPAREREFERENCE_GENOME' + select 'PREPARE_GENOME:BBMAP_BBSPLIT' + } + + path(params.aligner) { + select '.*:QUANTIFY_STAR_SALMON:SALMON_QUANT' + select '.*:QUANTIFY_STAR_SALMON:CUSTOM_TX2GENE' + select '.*:QUANTIFY_STAR_SALMON:TXIMETA_TXIMPORT' + select '.*:QUANTIFY_STAR_SALMON:SE_.*' + + path('umitools') { + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.tsv' + } + + path('samtools_stats') { + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + } + } + + path(params.aligner, enabled: params.save_align_intermeds || params.save_umi_intermeds) { + select 'NFCORE_RNASEQ:RNASEQ:SAMTOOLS_SORT', pattern: '*.bam' + select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.bam' + path('umitools/log') { + select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.log' + } + + select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT', pattern: '*.bam' + select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX', pattern: '*.bai' + path('samtools_stats') { + select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + } + + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.bam' + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:SAMTOOLS_INDEX', pattern: '*.bai' + } + } +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END diff --git a/nextflow.config b/nextflow.config index 74108e825..3b4823eac 100644 --- a/nextflow.config +++ b/nextflow.config @@ -135,15 +135,6 @@ params { } -// Default publishing logic for pipeline -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 } - ] -} - // Load base.config by default for all pipelines includeConfig 'conf/base.config' diff --git a/subworkflows/local/prepare_genome/nextflow.config b/subworkflows/local/prepare_genome/nextflow.config index 98a4b64fd..62d84f340 100644 --- a/subworkflows/local/prepare_genome/nextflow.config +++ b/subworkflows/local/prepare_genome/nextflow.config @@ -1,39 +1,10 @@ process { - withName: 'GUNZIP_.*|MAKE_TRANSCRIPTS_FASTA' { - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] - } - withName: 'UNTAR_.*' { ext.args2 = '--no-same-owner' } - withName: 'UNTAR_.*|STAR_GENOMEGENERATE|STAR_GENOMEGENERATE_IGENOMES|HISAT2_BUILD' { - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] - } - withName: 'GFFREAD' { ext.args = '--keep-exon-attrs -F -T' - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] - } - - withName: 'HISAT2_EXTRACTSPLICESITES' { - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] } withName: 'SALMON_INDEX' { @@ -41,62 +12,18 @@ process { params.gencode ? '--gencode' : '', params.pseudo_aligner_kmer_size ? "-k ${params.pseudo_aligner_kmer_size}": '' ].join(' ').trim() } - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] } withName: 'KALLISTO_INDEX' { ext.args = params.pseudo_aligner_kmer_size ? "-k ${params.pseudo_aligner_kmer_size}" : '' - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] } withName: 'RSEM_PREPAREREFERENCE_GENOME' { ext.args = '--star' - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] - } - - withName: 'GTF2BED' { - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] - } - - withName: 'CAT_ADDITIONAL_FASTA|PREPROCESS_TRANSCRIPTS_FASTA_GENCODE' { - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] } withName: 'GTF_FILTER' { ext.args = { params.skip_gtf_transcript_filter ?: '--skip_transcript_id_check' } - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] - } - - withName: 'CUSTOM_GETCHROMSIZES' { - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] } } @@ -104,11 +31,6 @@ if (!params.skip_bbsplit && params.bbsplit_fasta_list) { process { withName: 'PREPARE_GENOME:BBMAP_BBSPLIT' { ext.args = 'build=1' - publishDir = [ - path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null } - ] } } } diff --git a/workflows/rnaseq/nextflow.config b/workflows/rnaseq/nextflow.config index f988d3d7c..f5627e666 100644 --- a/workflows/rnaseq/nextflow.config +++ b/workflows/rnaseq/nextflow.config @@ -26,37 +26,12 @@ if (!params.skip_alignment && params.aligner == 'star_salmon') { process { withName: '.*:QUANTIFY_STAR_SALMON:SALMON_QUANT' { ext.args = { params.extra_salmon_quant_args ?: '' } - publishDir = [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('_meta_info.json') ? null : filename } - ] } - - withName: '.*:QUANTIFY_STAR_SALMON:CUSTOM_TX2GENE' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - withName: '.*:QUANTIFY_STAR_SALMON:TXIMETA_TXIMPORT' { ext.prefix = { "${quant_type}.merged" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } - withName: '.*:QUANTIFY_STAR_SALMON:SE_.*' { ext.prefix = { "${params.pseudo_aligner}.merged" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('.log') ? null : filename } - ] } withName: '.*:QUANTIFY_STAR_SALMON:SE_GENE' { ext.prefix = { "${params.pseudo_aligner}.merged.gene_counts" } @@ -77,58 +52,18 @@ if (!params.skip_alignment && params.aligner == 'star_salmon') { withName: 'NFCORE_RNASEQ:RNASEQ:SAMTOOLS_SORT' { ext.args = '-n' ext.prefix = { "${meta.id}.umi_dedup.transcriptome" } - publishDir = [ - path: { params.save_align_intermeds || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bam', - saveAs: { params.save_align_intermeds || params.save_umi_intermeds ? it : null } - ] } withName: 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON' { ext.prefix = { "${meta.id}.umi_dedup.transcriptome.filtered" } - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/umitools/log" }, - mode: params.publish_dir_mode, - pattern: '*.log' - ], - [ - path: { params.save_align_intermeds || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bam', - saveAs: { params.save_align_intermeds || params.save_umi_intermeds ? it : null } - ] - ] } withName: 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT' { ext.prefix = { "${meta.id}.transcriptome.sorted" } - publishDir = [ - path: { params.save_align_intermeds || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bam', - saveAs: { params.save_align_intermeds || params.save_umi_intermeds ? it : null } - ] - } - - withName: 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX' { - publishDir = [ - path: { params.save_align_intermeds || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bai', - saveAs: { params.save_align_intermeds || params.save_umi_intermeds ? it : null } - ] } withName: 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' { ext.prefix = { "${meta.id}.transcriptome.sorted.bam" } - publishDir = [ - path: { params.save_align_intermeds || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}/samtools_stats" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.{stats,flagstat,idxstats}', - saveAs: { params.save_align_intermeds || params.save_umi_intermeds ? it : null } - ] } withName: '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP' { @@ -138,37 +73,10 @@ if (!params.skip_alignment && params.aligner == 'star_salmon') { params.umitools_umi_separator ? "--umi-separator='${params.umitools_umi_separator}'" : '' ].join(' ').trim() } ext.prefix = { "${meta.id}.umi_dedup.transcriptome.sorted" } - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/umitools" }, - mode: params.publish_dir_mode, - pattern: '*.tsv' - ], - [ - path: { params.save_align_intermeds || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bam', - saveAs: { params.save_align_intermeds || params.save_umi_intermeds ? it : null } - ] - ] - } - - withName: '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:SAMTOOLS_INDEX' { - publishDir = [ - path: { params.save_align_intermeds || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bai', - saveAs: { params.save_align_intermeds || params.save_umi_intermeds ? it : null } - ] } withName: '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:BAM_STATS_SAMTOOLS:.*' { ext.prefix = { "${meta.id}.umi_dedup.transcriptome.sorted.bam" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/samtools_stats" }, - mode: params.publish_dir_mode, - pattern: '*.{stats,flagstat,idxstats}' - ] } } } @@ -182,11 +90,6 @@ if (!params.skip_alignment) { process { withName: 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' { ext.prefix = { "${meta.id}.sorted.bam" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/samtools_stats" }, - mode: params.publish_dir_mode, - pattern: "*.{stats,flagstat,idxstats}" - ] } withName: 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT' { @@ -282,8 +185,6 @@ if (!params.skip_alignment && !params.skip_bigwig) { ext.prefix = { "${meta.id}.forward" } publishDir = [ path: { "${params.outdir}/${params.aligner}/bigwig" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] } @@ -298,8 +199,6 @@ if (!params.skip_alignment && !params.skip_bigwig) { ext.prefix = { "${meta.id}.reverse" } publishDir = [ path: { "${params.outdir}/${params.aligner}/bigwig" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] } } @@ -360,8 +259,6 @@ if (!params.skip_pseudo_alignment && params.pseudo_aligner) { withName: '.*:QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' { publishDir = [ path: { "${params.outdir}/${params.pseudo_aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] } @@ -369,8 +266,6 @@ if (!params.skip_pseudo_alignment && params.pseudo_aligner) { ext.prefix = { "${quant_type}.merged" } publishDir = [ path: { "${params.outdir}/${params.pseudo_aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] } @@ -378,8 +273,6 @@ if (!params.skip_pseudo_alignment && params.pseudo_aligner) { ext.args = '--assay_names counts,abundance' publishDir = [ path: { "${params.outdir}/${params.pseudo_aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('.log') ? null : filename } ] } withName: '.*:QUANTIFY_PSEUDO_ALIGNMENT:SE_GENE' { From b572f52bdeb0afb85bdd6a5953da17b78cd96e1d Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Wed, 28 Feb 2024 19:26:30 -0600 Subject: [PATCH 02/17] Add complete output definition Signed-off-by: Ben Sherman --- main.nf | 60 ---- .../local/bedtools_genomecov/nextflow.config | 3 - modules/local/dupradar/nextflow.config | 35 -- .../multiqc_custom_biotype/nextflow.config | 13 - modules/nf-core/bbmap/bbsplit/nextflow.config | 13 - modules/nf-core/cat/fastq/nextflow.config | 9 - modules/nf-core/multiqc/nextflow.config | 8 - .../nf-core/preseq/lcextrap/nextflow.config | 12 - .../nf-core/qualimap/rnaseq/nextflow.config | 13 - modules/nf-core/sortmerna/nextflow.config | 13 - .../stringtie/stringtie/nextflow.config | 5 - .../subread/featurecounts/nextflow.config | 13 - subworkflows/local/align_star/nextflow.config | 19 - subworkflows/local/prepare_genome/main.nf | 30 ++ .../local/quantify_rsem/nextflow.config | 26 -- .../bam_markduplicates_picard/nextflow.config | 22 -- .../nf-core/bam_rseqc/nextflow.config | 153 -------- .../fastq_align_hisat2/nextflow.config | 19 - .../nextflow.config | 36 -- .../nextflow.config | 31 -- .../fastq_subsample_fq_salmon/nextflow.config | 6 - workflows/rnaseq/main.nf | 340 ++++++++++++++++++ workflows/rnaseq/nextflow.config | 88 ----- 23 files changed, 370 insertions(+), 597 deletions(-) delete mode 100644 modules/local/dupradar/nextflow.config delete mode 100644 modules/local/multiqc_custom_biotype/nextflow.config delete mode 100644 modules/nf-core/cat/fastq/nextflow.config delete mode 100644 modules/nf-core/qualimap/rnaseq/nextflow.config delete mode 100644 subworkflows/nf-core/bam_rseqc/nextflow.config diff --git a/main.nf b/main.nf index 3ae9a5c7a..59001a4f1 100755 --- a/main.nf +++ b/main.nf @@ -164,66 +164,6 @@ workflow { ) } -output { - path(params.outdir) { - path('genome', enabled: params.save_reference) { - select 'GUNZIP_.*' - select 'MAKE_TRANSCRIPTS_FASTA' - select 'GFFREAD' - select 'GTF2BED' - select 'CAT_ADDITIONAL_FASTA' - select 'PREPROCESS_TRANSCRIPTS_FASTA_GENCODE' - select 'GTF_FILTER' - select 'CUSTOM_GETCHROMSIZES' - } - - path('genome/index', enabled: params.save_reference) { - select 'UNTAR_.*' - select 'STAR_GENOMEGENERATE' - select 'STAR_GENOMEGENERATE_IGENOMES' - select 'HISAT2_BUILD' - select 'HISAT2_EXTRACTSPLICESITES' - select 'SALMON_INDEX' - select 'KALLISTO_INDEX' - select 'RSEM_PREPAREREFERENCE_GENOME' - select 'PREPARE_GENOME:BBMAP_BBSPLIT' - } - - path(params.aligner) { - select '.*:QUANTIFY_STAR_SALMON:SALMON_QUANT' - select '.*:QUANTIFY_STAR_SALMON:CUSTOM_TX2GENE' - select '.*:QUANTIFY_STAR_SALMON:TXIMETA_TXIMPORT' - select '.*:QUANTIFY_STAR_SALMON:SE_.*' - - path('umitools') { - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.tsv' - } - - path('samtools_stats') { - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - } - } - - path(params.aligner, enabled: params.save_align_intermeds || params.save_umi_intermeds) { - select 'NFCORE_RNASEQ:RNASEQ:SAMTOOLS_SORT', pattern: '*.bam' - select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.bam' - path('umitools/log') { - select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.log' - } - - select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT', pattern: '*.bam' - select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX', pattern: '*.bai' - path('samtools_stats') { - select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - } - - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.bam' - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:SAMTOOLS_INDEX', pattern: '*.bai' - } - } -} - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END diff --git a/modules/local/bedtools_genomecov/nextflow.config b/modules/local/bedtools_genomecov/nextflow.config index 85f3d34ae..f49fe8468 100644 --- a/modules/local/bedtools_genomecov/nextflow.config +++ b/modules/local/bedtools_genomecov/nextflow.config @@ -3,9 +3,6 @@ if (!params.skip_alignment && !params.skip_bigwig) { process { withName: 'BEDTOOLS_GENOMECOV' { ext.args = '-split -du' - publishDir = [ - enabled: false - ] } } } diff --git a/modules/local/dupradar/nextflow.config b/modules/local/dupradar/nextflow.config deleted file mode 100644 index 3ade56ad5..000000000 --- a/modules/local/dupradar/nextflow.config +++ /dev/null @@ -1,35 +0,0 @@ -if (!params.skip_alignment && !params.skip_qc) { - if (!params.skip_dupradar) { - process { - withName: 'DUPRADAR' { - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/dupradar/scatter_plot" }, - mode: params.publish_dir_mode, - pattern: "*Dens.pdf" - ], - [ - path: { "${params.outdir}/${params.aligner}/dupradar/box_plot" }, - mode: params.publish_dir_mode, - pattern: "*Boxplot.pdf" - ], - [ - path: { "${params.outdir}/${params.aligner}/dupradar/histogram" }, - mode: params.publish_dir_mode, - pattern: "*Hist.pdf" - ], - [ - path: { "${params.outdir}/${params.aligner}/dupradar/gene_data" }, - mode: params.publish_dir_mode, - pattern: "*Matrix.txt" - ], - [ - path: { "${params.outdir}/${params.aligner}/dupradar/intercepts_slope" }, - mode: params.publish_dir_mode, - pattern: "*slope.txt" - ] - ] - } - } - } -} diff --git a/modules/local/multiqc_custom_biotype/nextflow.config b/modules/local/multiqc_custom_biotype/nextflow.config deleted file mode 100644 index 68fecaa66..000000000 --- a/modules/local/multiqc_custom_biotype/nextflow.config +++ /dev/null @@ -1,13 +0,0 @@ -if (!params.skip_alignment && !params.skip_qc) { - if (!params.skip_biotype_qc && params.featurecounts_group_type) { - process { - withName: 'MULTIQC_CUSTOM_BIOTYPE' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}/featurecounts" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - } - } -} diff --git a/modules/nf-core/bbmap/bbsplit/nextflow.config b/modules/nf-core/bbmap/bbsplit/nextflow.config index da3ddaf31..0c37662da 100644 --- a/modules/nf-core/bbmap/bbsplit/nextflow.config +++ b/modules/nf-core/bbmap/bbsplit/nextflow.config @@ -2,19 +2,6 @@ if (!params.skip_bbsplit) { process { withName: 'BBMAP_BBSPLIT' { ext.args = 'build=1 ambiguous2=all maxindel=150000' - publishDir = [ - [ - path: { "${params.outdir}/bbsplit" }, - mode: params.publish_dir_mode, - pattern: '*.txt' - ], - [ - path: { params.save_bbsplit_reads ? "${params.outdir}/bbsplit" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.fastq.gz', - saveAs: { params.save_bbsplit_reads ? it : null } - ] - ] } } } \ No newline at end of file diff --git a/modules/nf-core/cat/fastq/nextflow.config b/modules/nf-core/cat/fastq/nextflow.config deleted file mode 100644 index 64de2e49c..000000000 --- a/modules/nf-core/cat/fastq/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - withName: 'CAT_FASTQ' { - publishDir = [ - path: { params.save_merged_fastq ? "${params.outdir}/fastq" : params.outdir }, - mode: params.publish_dir_mode, - saveAs: { filename -> (filename.endsWith('.fastq.gz') && params.save_merged_fastq) ? filename : null } - ] - } -} diff --git a/modules/nf-core/multiqc/nextflow.config b/modules/nf-core/multiqc/nextflow.config index ac178787c..0f1fffdda 100644 --- a/modules/nf-core/multiqc/nextflow.config +++ b/modules/nf-core/multiqc/nextflow.config @@ -3,14 +3,6 @@ if (!params.skip_multiqc) { withName: 'MULTIQC' { ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' } ext.prefix = "multiqc_report" - publishDir = [ - path: { [ - "${params.outdir}/multiqc", - params.skip_alignment? '' : "/${params.aligner}" - ].join('') }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } } } \ No newline at end of file diff --git a/modules/nf-core/preseq/lcextrap/nextflow.config b/modules/nf-core/preseq/lcextrap/nextflow.config index e203e87e7..fdb888749 100644 --- a/modules/nf-core/preseq/lcextrap/nextflow.config +++ b/modules/nf-core/preseq/lcextrap/nextflow.config @@ -3,18 +3,6 @@ if (!params.skip_alignment && !params.skip_qc) { process { withName: 'PRESEQ_LCEXTRAP' { ext.args = '-verbose -bam -seed 1 -seg_len 100000000' - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/preseq" }, - mode: params.publish_dir_mode, - pattern: "*.txt" - ], - [ - path: { "${params.outdir}/${params.aligner}/preseq/log" }, - mode: params.publish_dir_mode, - pattern: "*.log" - ] - ] } } } diff --git a/modules/nf-core/qualimap/rnaseq/nextflow.config b/modules/nf-core/qualimap/rnaseq/nextflow.config deleted file mode 100644 index 9c05fb25a..000000000 --- a/modules/nf-core/qualimap/rnaseq/nextflow.config +++ /dev/null @@ -1,13 +0,0 @@ -if (!params.skip_alignment && !params.skip_qc) { - if (!params.skip_qualimap) { - process { - withName: 'QUALIMAP_RNASEQ' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}/qualimap" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - } - } -} diff --git a/modules/nf-core/sortmerna/nextflow.config b/modules/nf-core/sortmerna/nextflow.config index 8771660ce..2f60c9b7b 100644 --- a/modules/nf-core/sortmerna/nextflow.config +++ b/modules/nf-core/sortmerna/nextflow.config @@ -2,19 +2,6 @@ if (params.remove_ribo_rna) { process { withName: 'SORTMERNA' { ext.args = '--num_alignments 1 -v' - publishDir = [ - [ - path: { "${params.outdir}/sortmerna" }, - mode: params.publish_dir_mode, - pattern: "*.log" - ], - [ - path: { params.save_non_ribo_reads ? "${params.outdir}/sortmerna" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.fastq.gz", - saveAs: { params.save_non_ribo_reads ? it : null } - ] - ] } } } \ No newline at end of file diff --git a/modules/nf-core/stringtie/stringtie/nextflow.config b/modules/nf-core/stringtie/stringtie/nextflow.config index dc0651458..03518ca96 100644 --- a/modules/nf-core/stringtie/stringtie/nextflow.config +++ b/modules/nf-core/stringtie/stringtie/nextflow.config @@ -6,11 +6,6 @@ if (!params.skip_alignment) { '-v', params.stringtie_ignore_gtf ? '' : '-e' ].join(' ').trim() } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/stringtie" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } } } diff --git a/modules/nf-core/subread/featurecounts/nextflow.config b/modules/nf-core/subread/featurecounts/nextflow.config index 3a796d101..c75038ca9 100644 --- a/modules/nf-core/subread/featurecounts/nextflow.config +++ b/modules/nf-core/subread/featurecounts/nextflow.config @@ -7,19 +7,6 @@ if (!params.skip_alignment && !params.skip_qc) { params.gencode ? "-g gene_type" : "-g $params.featurecounts_group_type", "-t $params.featurecounts_feature_type" ].join(' ').trim() } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/featurecounts" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - - withName: 'MULTIQC_CUSTOM_BIOTYPE' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}/featurecounts" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } } } diff --git a/subworkflows/local/align_star/nextflow.config b/subworkflows/local/align_star/nextflow.config index 68bfef562..beeadc15a 100644 --- a/subworkflows/local/align_star/nextflow.config +++ b/subworkflows/local/align_star/nextflow.config @@ -15,25 +15,6 @@ if (!params.skip_alignment && params.aligner == 'star_salmon') { params.save_unaligned ? '--outReadsUnmapped Fastx' : '', params.extra_star_align_args ? params.extra_star_align_args.split("\\s(?=--)") : '' ].flatten().unique(false).join(' ').trim() } - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/log" }, - mode: params.publish_dir_mode, - pattern: '*.{out,tab}' - ], - [ - path: { params.save_align_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bam', - saveAs: { params.save_align_intermeds ? it : null } - ], - [ - path: { params.save_unaligned ? "${params.outdir}/${params.aligner}/unmapped" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.fastq.gz', - saveAs: { params.save_unaligned ? it : null } - ] - ] } } } diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index 58a9b293c..47bd98b60 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -343,3 +343,33 @@ workflow PREPARE_GENOME { kallisto_index = ch_kallisto_index // channel: [ meta, path(kallisto/index/) ] versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] } + +output { + if( !params.save_reference ) + return + + path(params.outdir, mode: params.publish_dir_mode) { + path('genome') { + select 'GUNZIP_.*' + select 'MAKE_TRANSCRIPTS_FASTA' + select 'GFFREAD' + select 'GTF2BED' + select 'CAT_ADDITIONAL_FASTA' + select 'PREPROCESS_TRANSCRIPTS_FASTA_GENCODE' + select 'GTF_FILTER' + select 'CUSTOM_GETCHROMSIZES' + } + + path('genome/index') { + select 'UNTAR_.*' + select 'STAR_GENOMEGENERATE' + select 'STAR_GENOMEGENERATE_IGENOMES' + select 'HISAT2_BUILD' + select 'HISAT2_EXTRACTSPLICESITES' + select 'SALMON_INDEX' + select 'KALLISTO_INDEX' + select 'RSEM_PREPAREREFERENCE_GENOME' + select 'PREPARE_GENOME:BBMAP_BBSPLIT' + } + } +} diff --git a/subworkflows/local/quantify_rsem/nextflow.config b/subworkflows/local/quantify_rsem/nextflow.config index 7b50b86c0..5a03a5576 100644 --- a/subworkflows/local/quantify_rsem/nextflow.config +++ b/subworkflows/local/quantify_rsem/nextflow.config @@ -8,32 +8,6 @@ if (!params.skip_alignment && params.aligner == 'star_rsem') { '--estimate-rspd', '--seed 1' ].join(' ').trim() - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - pattern: "*.{stat,results}" - ], - [ - path: { params.save_align_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.bam", - saveAs: { params.save_align_intermeds ? it : null } - ], - [ - path: { "${params.outdir}/${params.aligner}/log" }, - mode: params.publish_dir_mode, - pattern: "*.log" - ] - ] - } - - withName: '.*:QUANTIFY_RSEM:RSEM_MERGE_COUNTS' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } } } diff --git a/subworkflows/nf-core/bam_markduplicates_picard/nextflow.config b/subworkflows/nf-core/bam_markduplicates_picard/nextflow.config index 2778db78d..f8f3061e7 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/nextflow.config +++ b/subworkflows/nf-core/bam_markduplicates_picard/nextflow.config @@ -4,37 +4,15 @@ if (!params.skip_alignment) { withName: '.*:BAM_MARKDUPLICATES_PICARD:PICARD_MARKDUPLICATES' { ext.args = '--ASSUME_SORTED true --REMOVE_DUPLICATES false --VALIDATION_STRINGENCY LENIENT --TMP_DIR tmp' ext.prefix = { "${meta.id}.markdup.sorted" } - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/picard_metrics" }, - mode: params.publish_dir_mode, - pattern: '*metrics.txt' - ], - [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - pattern: '*.bam' - ] - ] } withName: '.*:BAM_MARKDUPLICATES_PICARD:SAMTOOLS_INDEX' { ext.args = { params.bam_csi_index ? '-c' : '' } ext.prefix = { "${meta.id}.markdup.sorted" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}" }, - mode: params.publish_dir_mode, - pattern: '*.{bai,csi}' - ] } withName: '.*:BAM_MARKDUPLICATES_PICARD:BAM_STATS_SAMTOOLS:.*' { ext.prefix = { "${meta.id}.markdup.sorted.bam" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/samtools_stats" }, - mode: params.publish_dir_mode, - pattern: '*.{stats,flagstat,idxstats}' - ] } } } diff --git a/subworkflows/nf-core/bam_rseqc/nextflow.config b/subworkflows/nf-core/bam_rseqc/nextflow.config deleted file mode 100644 index 4fabc8e99..000000000 --- a/subworkflows/nf-core/bam_rseqc/nextflow.config +++ /dev/null @@ -1,153 +0,0 @@ -def rseqc_modules = params.rseqc_modules ? params.rseqc_modules.split(',').collect{ it.trim().toLowerCase() } : [] - -if (!params.skip_alignment && !params.skip_qc && !params.skip_rseqc) { - if ('bam_stat' in rseqc_modules) { - process { - withName: '.*:BAM_RSEQC:RSEQC_BAMSTAT' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}/rseqc/bam_stat" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - } - } - - if ('infer_experiment' in rseqc_modules) { - process { - withName: '.*:BAM_RSEQC:RSEQC_INFEREXPERIMENT' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}/rseqc/infer_experiment" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - } - } - - if ('junction_annotation' in rseqc_modules) { - process { - withName: '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION' { - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/rseqc/junction_annotation/pdf" }, - mode: params.publish_dir_mode, - pattern: '*.pdf' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/junction_annotation/bed" }, - mode: params.publish_dir_mode, - pattern: '*.bed' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/junction_annotation/xls" }, - mode: params.publish_dir_mode, - pattern: '*.xls' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/junction_annotation/log" }, - mode: params.publish_dir_mode, - pattern: '*.log' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/junction_annotation/rscript" }, - mode: params.publish_dir_mode, - pattern: '*.r' - ] - ] - } - } - } - - if ('junction_saturation' in rseqc_modules) { - process { - withName: '.*:BAM_RSEQC:RSEQC_JUNCTIONSATURATION' { - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/rseqc/junction_saturation/pdf" }, - mode: params.publish_dir_mode, - pattern: '*.pdf' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/junction_saturation/rscript" }, - mode: params.publish_dir_mode, - pattern: '*.r' - ] - ] - } - } - } - - if ('read_duplication' in rseqc_modules) { - process { - withName: '.*:BAM_RSEQC:RSEQC_READDUPLICATION' { - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/rseqc/read_duplication/pdf" }, - mode: params.publish_dir_mode, - pattern: '*.pdf' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/read_duplication/xls" }, - mode: params.publish_dir_mode, - pattern: '*.xls' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/read_duplication/rscript" }, - mode: params.publish_dir_mode, - pattern: '*.r' - ] - ] - } - } - } - - if ('read_distribution' in rseqc_modules && !params.bam_csi_index) { - process { - withName: '.*:BAM_RSEQC:RSEQC_READDISTRIBUTION' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}/rseqc/read_distribution" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - } - } - - if ('inner_distance' in rseqc_modules && !params.bam_csi_index) { - process { - withName: '.*:BAM_RSEQC:RSEQC_INNERDISTANCE' { - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/rseqc/inner_distance/txt" }, - mode: params.publish_dir_mode, - pattern: '*.txt', - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/inner_distance/pdf" }, - mode: params.publish_dir_mode, - pattern: '*.pdf' - ], - [ - path: { "${params.outdir}/${params.aligner}/rseqc/inner_distance/rscript" }, - mode: params.publish_dir_mode, - pattern: '*.r' - ] - ] - } - } - } - - if ('tin' in rseqc_modules && !params.bam_csi_index) { - process { - withName: '.*:BAM_RSEQC:RSEQC_TIN' { - publishDir = [ - path: { "${params.outdir}/${params.aligner}/rseqc/tin" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - } - } -} diff --git a/subworkflows/nf-core/fastq_align_hisat2/nextflow.config b/subworkflows/nf-core/fastq_align_hisat2/nextflow.config index 0f6d1abdc..f358884a5 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/nextflow.config +++ b/subworkflows/nf-core/fastq_align_hisat2/nextflow.config @@ -2,25 +2,6 @@ if (!params.skip_alignment && params.aligner == 'hisat2') { process { withName: '.*:FASTQ_ALIGN_HISAT2:HISAT2_ALIGN' { ext.args = '--met-stderr --new-summary --dta' - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/log" }, - mode: params.publish_dir_mode, - pattern: '*.log' - ], - [ - path: { params.save_align_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bam', - saveAs: { params.save_align_intermeds ? it : null } - ], - [ - path: { params.save_unaligned ? "${params.outdir}/${params.aligner}/unmapped" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.fastq.gz', - saveAs: { params.save_unaligned ? it : null } - ] - ] } } } diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/nextflow.config b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/nextflow.config index 061689d5f..e17897297 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/nextflow.config +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/nextflow.config @@ -7,11 +7,6 @@ if (!(params.skip_fastqc || params.skip_qc)) { withName: '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTQC_TRIM' { ext.args = '--quiet' - publishDir = [ - path: { "${params.outdir}/${params.trimmer}/fastqc" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } } } @@ -22,24 +17,6 @@ if (!params.skip_trimming) { process { withName: '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP' { ext.args = { params.extra_fastp_args ?: '' } - publishDir = [ - [ - path: { "${params.outdir}/${params.trimmer}" }, - mode: params.publish_dir_mode, - pattern: "*.{json,html}" - ], - [ - path: { "${params.outdir}/${params.trimmer}/log" }, - mode: params.publish_dir_mode, - pattern: "*.log" - ], - [ - path: { params.save_trimmed ? "${params.outdir}/${params.trimmer}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.fastq.gz", - saveAs: { params.save_trimmed ? it : null } - ] - ] } } } @@ -54,19 +31,6 @@ if (params.with_umi && !params.skip_umi_extract) { params.umitools_bc_pattern2 ? "--bc-pattern2='${params.umitools_bc_pattern2}'" : '', params.umitools_umi_separator ? "--umi-separator='${params.umitools_umi_separator}'" : '' ].join(' ').trim() } - publishDir = [ - [ - path: { "${params.outdir}/umitools" }, - mode: params.publish_dir_mode, - pattern: "*.log" - ], - [ - path: { params.save_umi_intermeds ? "${params.outdir}/umitools" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.fastq.gz", - saveAs: { params.save_umi_intermeds ? it : null } - ] - ] } } } diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/nextflow.config b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/nextflow.config index 7279111e5..48181b085 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/nextflow.config +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/nextflow.config @@ -18,24 +18,6 @@ if (!params.skip_trimming) { params.extra_trimgalore_args ? params.extra_trimgalore_args.split("\\s(?=--)") : '' ].flatten().unique(false).join(' ').trim() } - publishDir = [ - [ - path: { "${params.outdir}/${params.trimmer}/fastqc" }, - mode: params.publish_dir_mode, - pattern: "*.{html,zip}" - ], - [ - path: { params.save_trimmed ? "${params.outdir}/${params.trimmer}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.fq.gz", - saveAs: { params.save_trimmed ? it : null } - ], - [ - path: { "${params.outdir}/${params.trimmer}" }, - mode: params.publish_dir_mode, - pattern: "*.txt" - ] - ] } } } @@ -50,19 +32,6 @@ if (params.with_umi && !params.skip_umi_extract) { params.umitools_bc_pattern2 ? "--bc-pattern2='${params.umitools_bc_pattern2}'" : '', params.umitools_umi_separator ? "--umi-separator='${params.umitools_umi_separator}'" : '' ].join(' ').trim() } - publishDir = [ - [ - path: { "${params.outdir}/umitools" }, - mode: params.publish_dir_mode, - pattern: "*.log" - ], - [ - path: { params.save_umi_intermeds ? "${params.outdir}/umitools" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.fastq.gz", - saveAs: { params.save_umi_intermeds ? it : null } - ] - ] } } } diff --git a/subworkflows/nf-core/fastq_subsample_fq_salmon/nextflow.config b/subworkflows/nf-core/fastq_subsample_fq_salmon/nextflow.config index 36a8c5d7a..685b68bd5 100644 --- a/subworkflows/nf-core/fastq_subsample_fq_salmon/nextflow.config +++ b/subworkflows/nf-core/fastq_subsample_fq_salmon/nextflow.config @@ -2,15 +2,9 @@ process { withName: '.*:FASTQ_SUBSAMPLE_FQ_SALMON:FQ_SUBSAMPLE' { ext.args = '--record-count 1000000 --seed 1' ext.prefix = { "${meta.id}.subsampled" } - publishDir = [ - enabled: false - ] } withName: '.*:FASTQ_SUBSAMPLE_FQ_SALMON:SALMON_QUANT' { ext.args = '--skipQuant' - publishDir = [ - enabled: false - ] } } diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index 5c7c2b964..2ae735e98 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -787,6 +787,346 @@ workflow RNASEQ { versions = ch_versions // channel: [ path(versions.yml) ] } +output { + path(params.outdir, mode: params.publish_dir_mode) { + // + // STAR Salmon alignment options + // + path(params.aligner) { + select '.*:QUANTIFY_STAR_SALMON:SALMON_QUANT' + select '.*:QUANTIFY_STAR_SALMON:CUSTOM_TX2GENE' + select '.*:QUANTIFY_STAR_SALMON:TXIMETA_TXIMPORT' + select '.*:QUANTIFY_STAR_SALMON:SE_.*' + + if( params.save_align_intermeds || params.save_umi_intermeds ) { + select 'NFCORE_RNASEQ:RNASEQ:SAMTOOLS_SORT', pattern: '*.bam' + path('umitools/log') { + select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.log' + } + select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.bam' + + select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT', pattern: '*.bam' + select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX', pattern: '*.bai' + path('samtools_stats') { + select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + } + } + + path('umitools') { + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.tsv' + } + if( params.save_align_intermeds || params.save_umi_intermeds ) + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.bam' + + if( params.save_align_intermeds || params.save_umi_intermeds ) + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:SAMTOOLS_INDEX', pattern: '*.bai' + + path('samtools_stats') { + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + } + } + + // + // General alignment options + // + path(params.aligner) { + path('samtools_stats') { + select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + } + + def wut = ( ['star_salmon','hisat2'].contains(params.aligner) && + ( params.save_align_intermeds || ( !params.with_umi && params.skip_markduplicates ) ) + ) || params.save_align_intermeds || params.skip_markduplicates + if( wut ) { + select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT', pattern: "*.bam" + select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX', pattern: "*.{bai,csi}" + } + + path('umitools') { + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:UMITOOLS_DEDUP', pattern: '*.tsv' + } + if( params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ) + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:UMITOOLS_DEDUP', pattern: '*.bam' + + if( params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ) + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:SAMTOOLS_INDEX', pattern: '*.{bai,csi}' + + path('samtools_stats') { + select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + } + } + + // + // bigWig coverage options + // + path(params.aligner) { + path('bigwig') { + select '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD:UCSC_BEDGRAPHTOBIGWIG' + select '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE:UCSC_BEDGRAPHTOBIGWIG' + } + } + + // + // DESeq2 QC options + // + path(params.aligner) { + path('deseq2_qc') { + select 'DESEQ2_QC_STAR_SALMON', pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" + select 'DESEQ2_QC_RSEM', pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" + } + } + + // + // Pseudo-alignment options + // + path(params.pseudo_aligner) { + select '.*:QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' + select '.*:QUANTIFY_PSEUDO_ALIGNMENT:TXIMETA_TXIMPORT' + select '.*:QUANTIFY_PSEUDO_ALIGNMENT:SE_.*' + + path('deseq2_qc') { + select 'DESEQ2_QC_PSEUDO', pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" + } + } + + // modules/local/dupradar + path(params.aligner) { + path('dupradar') { + path('scatter_plot') { + select 'DUPRADAR', pattern: "*Dens.pdf" + } + path('box_plot') { + select 'DUPRADAR', pattern: "*Boxplot.pdf" + } + path('histogram') { + select 'DUPRADAR', pattern: "*Hist.pdf" + } + path('gene_data') { + select 'DUPRADAR', pattern: "*Matrix.txt" + } + path('intercepts_slope') { + select 'DUPRADAR', pattern: "*slope.txt" + } + } + } + + // modules/nf-core/bbmap/bbsplit + path('bbsplit') { + select 'BBMAP_BBSPLIT', pattern: '*.txt' + } + + if( params.save_bbsplit_reads ) { + path('bbsplit') { + select 'BBMAP_BBSPLIT', pattern: '*.fastq.gz' + } + } + + // modules/nf-core/cat/fastq + if( params.save_merged_fastq ) { + path('fastq') { + select 'CAT_FASTQ', pattern: '*.fastq.gz' + } + } + + // modules/nf-core/multiqc + def multiqc_path = params.skip_alignment + ? 'multiqc' + : "multiqc/${params.aligner}" + + path(multiqc_path) { + select 'MULTIQC' + } + + // modules/nf-core/preseq/lcextrap + path(params.aligner) { + path('preseq') { + select 'PRESEQ_LCEXTRAP', pattern: "*.txt" + } + path('preseq/log') { + select 'PRESEQ_LCEXTRAP', pattern: "*.log" + } + } + + // modules/nf-core/qualimap/rnaseq + path(params.aligner) { + path('qualimap') { + select 'QUALIMAP_RNASEQ' + } + } + + // modules/nf-core/sortmerna + path('sortmerna') { + select 'SORTMERNA', pattern: "*.log" + if( params.save_non_ribo_reads ) + select 'SORTMERNA', pattern: "*.fastq.gz" + } + + // modules/nf-core/stringtie/stringtie + path(params.aligner) { + path('stringtie') { + select 'STRINGTIE_STRINGTIE' + } + } + + // modules/nf-core/subread/featurecounts + path(params.aligner) { + path('featurecounts') { + select 'SUBREAD_FEATURECOUNTS' + select 'MULTIQC_CUSTOM_BIOTYPE' + } + } + + // subworkflows/local/align_star + path(params.aligner) { + path('log') { + select '.*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES', pattern: '*.{out,tab}' + } + if( params.save_align_intermeds ) + select '.*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES', pattern: '*.bam' + if( params.save_unaligned ) { + path('unmapped') { + select '.*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES', pattern: '*.fastq.gz' + } + } + } + + // subworkflows/local/quantify_rsem + path(params.aligner) { + select '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION', pattern: "*.{stat,results}" + if( params.save_align_intermeds ) + select '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION', pattern: "*.bam" + path('log') { + select '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION', pattern: "*.log" + } + select '.*:QUANTIFY_RSEM:RSEM_MERGE_COUNTS' + } + + // subworkflows/nf-core/bam_markduplicates_picard + path(params.aligner) { + path('picard_metrics') { + select '.*:BAM_MARKDUPLICATES_PICARD:PICARD_MARKDUPLICATES', pattern: '*metrics.txt' + } + select '.*:BAM_MARKDUPLICATES_PICARD:PICARD_MARKDUPLICATES', pattern: '*.bam' + select '.*:BAM_MARKDUPLICATES_PICARD:SAMTOOLS_INDEX', pattern: '*.{bai,csi}' + path('samtools_stats') { + select '.*:BAM_MARKDUPLICATES_PICARD:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' + } + } + + // subworkflows/nf-core/bam_rseqc + path(params.aligner) { + path('rseqc/bam_stat') { + select '.*:BAM_RSEQC:RSEQC_BAMSTAT' + } + path('rseqc/infer_experiment') { + select '.*:BAM_RSEQC:RSEQC_INFEREXPERIMENT' + } + path('rseqc/junction_annotation') { + path('pdf') { + select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.pdf' + } + path('bed') { + select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.bed' + } + path('xls') { + select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.xls' + } + path('log') { + select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.log' + } + path('rscript') { + select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.r' + } + } + path('rseqc/junction_saturation') { + path('pdf') { + select '.*:BAM_RSEQC:RSEQC_JUNCTIONSATURATION', pattern: '*.pdf' + } + path('rscript') { + select '.*:BAM_RSEQC:RSEQC_JUNCTIONSATURATION', pattern: '*.r' + } + } + path('rseqc/read_duplication') { + path('pdf') { + select '.*:BAM_RSEQC:RSEQC_READDUPLICATION', pattern: '*.pdf' + } + path('xls') { + select '.*:BAM_RSEQC:RSEQC_READDUPLICATION', pattern: '*.xls' + } + path('rscript') { + select '.*:BAM_RSEQC:RSEQC_READDUPLICATION', pattern: '*.r' + } + } + path('rseqc/read_distribution') { + select '.*:BAM_RSEQC:RSEQC_READDISTRIBUTION' + } + path('rseqc/inner_distance') { + path('txt') { + select '.*:BAM_RSEQC:RSEQC_INNERDISTANCE', pattern: '*.txt' + } + path('pdf') { + select '.*:BAM_RSEQC:RSEQC_INNERDISTANCE', pattern: '*.pdf' + } + path('rscript') { + select '.*:BAM_RSEQC:RSEQC_INNERDISTANCE', pattern: '*.r' + } + } + path('rseqc/tin') { + select '.*:BAM_RSEQC:RSEQC_TIN' + } + } + + // subworkflows/nf-core/fastq_align_hisat2 + path(params.aligner) { + path('log') { + select '.*:FASTQ_ALIGN_HISAT2:HISAT2_ALIGN', pattern: '*.log' + } + if( params.save_align_intermeds ) + select '.*:FASTQ_ALIGN_HISAT2:HISAT2_ALIGN', pattern: '*.bam' + if( params.save_unaligned ) { + path('unmapped') { + select '.*:FASTQ_ALIGN_HISAT2:HISAT2_ALIGN', pattern: '*.fastq.gz' + } + } + } + + // subworkflows/nf-core/fastq_fastqc_umitools_fastp + path(params.trimmer) { + path('fastqc') { + select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTQC_TRIM' + } + select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP', pattern: "*.{json,html}" + path('log') { + select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP', pattern: "*.log" + } + if( params.save_trimmed ) + select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP', pattern: "*.fastq.gz" + } + + path('umitools') { + select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:UMITOOLS_EXTRACT', pattern: "*.log" + if( params.save_umi_intermeds ) + select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:UMITOOLS_EXTRACT', pattern: "*.fastq.gz" + } + + // subworkflows/nf-core/fastq_fastqc_umitools_trimgalore + path(params.trimmer) { + path('fastqc') { + select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE', pattern: "*.{html,zip}" + } + if( params.save_trimmed ) + select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE', pattern: "*.fq.gz" + select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE', pattern: "*.txt" + } + + path('umitools') { + select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:UMITOOLS_EXTRACT', pattern: "*.log" + if( params.save_umi_intermeds ) + select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:UMITOOLS_EXTRACT', pattern: "*.fastq.gz" + } + } +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END diff --git a/workflows/rnaseq/nextflow.config b/workflows/rnaseq/nextflow.config index f5627e666..487c172b6 100644 --- a/workflows/rnaseq/nextflow.config +++ b/workflows/rnaseq/nextflow.config @@ -1,18 +1,13 @@ includeConfig "../../modules/local/bedtools_genomecov/nextflow.config" -includeConfig "../../modules/local/dupradar/nextflow.config" -includeConfig "../../modules/local/multiqc_custom_biotype/nextflow.config" includeConfig "../../modules/nf-core/bbmap/bbsplit/nextflow.config" -includeConfig "../../modules/nf-core/cat/fastq/nextflow.config" includeConfig "../../modules/nf-core/multiqc/nextflow.config" includeConfig "../../modules/nf-core/preseq/lcextrap/nextflow.config" -includeConfig "../../modules/nf-core/qualimap/rnaseq/nextflow.config" includeConfig "../../modules/nf-core/sortmerna/nextflow.config" includeConfig "../../modules/nf-core/stringtie/stringtie/nextflow.config" includeConfig "../../modules/nf-core/subread/featurecounts/nextflow.config" includeConfig "../../subworkflows/local/align_star/nextflow.config" includeConfig "../../subworkflows/local/quantify_rsem/nextflow.config" includeConfig "../../subworkflows/nf-core/bam_markduplicates_picard/nextflow.config" -includeConfig "../../subworkflows/nf-core/bam_rseqc/nextflow.config" includeConfig "../../subworkflows/nf-core/fastq_align_hisat2/nextflow.config" includeConfig "../../subworkflows/nf-core/fastq_fastqc_umitools_fastp/nextflow.config" includeConfig "../../subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/nextflow.config" @@ -94,30 +89,10 @@ if (!params.skip_alignment) { withName: 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT' { ext.prefix = { "${meta.id}.sorted" } - publishDir = [ - path: { ( ['star_salmon','hisat2'].contains(params.aligner) && - ( params.save_align_intermeds || ( !params.with_umi && params.skip_markduplicates ) ) - ) || params.save_align_intermeds || params.skip_markduplicates ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.bam", - saveAs: { ( ['star_salmon','hisat2'].contains(params.aligner) && - ( params.save_align_intermeds || ( !params.with_umi && params.skip_markduplicates ) ) - ) || params.save_align_intermeds || params.skip_markduplicates ? it : null } - ] } withName: 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX' { ext.args = { params.bam_csi_index ? '-c' : '' } - publishDir = [ - path: { ( ['star_salmon','hisat2'].contains(params.aligner) && - ( params.save_align_intermeds || ( !params.with_umi && params.skip_markduplicates ) ) - ) || params.save_align_intermeds || params.skip_markduplicates ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: "*.{bai,csi}", - saveAs: { ( ['star_salmon','hisat2'].contains(params.aligner) && - ( params.save_align_intermeds || ( !params.with_umi && params.skip_markduplicates ) ) - ) || params.save_align_intermeds || params.skip_markduplicates ? it : null } - ] } } @@ -130,39 +105,15 @@ if (!params.skip_alignment) { params.umitools_umi_separator ? "--umi-separator='${params.umitools_umi_separator}'" : '' ].join(' ').trim() } ext.prefix = { "${meta.id}.umi_dedup.sorted" } - publishDir = [ - [ - path: { "${params.outdir}/${params.aligner}/umitools" }, - mode: params.publish_dir_mode, - pattern: '*.tsv' - ], - [ - path: { params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.bam', - saveAs: { params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ? it : null } - ] - ] } withName: '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:SAMTOOLS_INDEX' { ext.args = { params.bam_csi_index ? '-c' : '' } ext.prefix = { "${meta.id}.umi_dedup.sorted" } - publishDir = [ - path: { params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir }, - mode: params.publish_dir_mode, - pattern: '*.{bai,csi}', - saveAs: { params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ? it : null } - ] } withName: '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:BAM_STATS_SAMTOOLS:.*' { ext.prefix = { "${meta.id}.umi_dedup.sorted.bam" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/samtools_stats" }, - mode: params.publish_dir_mode, - pattern: '*.{stats,flagstat,idxstats}' - ] } } } @@ -176,30 +127,18 @@ if (!params.skip_alignment && !params.skip_bigwig) { process { withName: '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD:UCSC_BEDCLIP' { ext.prefix = { "${meta.id}.clip.forward" } - publishDir = [ - enabled: false - ] } withName: '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD:UCSC_BEDGRAPHTOBIGWIG' { ext.prefix = { "${meta.id}.forward" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/bigwig" }, - ] } withName: '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE:UCSC_BEDCLIP' { ext.prefix = { "${meta.id}.clip.reverse" } - publishDir = [ - enabled: false - ] } withName: '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE:UCSC_BEDGRAPHTOBIGWIG' { ext.prefix = { "${meta.id}.reverse" } - publishDir = [ - path: { "${params.outdir}/${params.aligner}/bigwig" }, - ] } } } @@ -219,11 +158,6 @@ if (!params.skip_alignment && params.aligner == 'star_salmon') { params.deseq2_vst ? '--vst TRUE' : '' ].join(' ').trim() } ext.args2 = 'star_salmon' - publishDir = [ - path: { "${params.outdir}/${params.aligner}/deseq2_qc" }, - mode: params.publish_dir_mode, - pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" - ] } } } @@ -240,11 +174,6 @@ if (!params.skip_alignment && params.aligner == 'star_rsem') { params.deseq2_vst ? '--vst TRUE' : '' ].join(' ').trim() } ext.args2 = 'star_rsem' - publishDir = [ - path: { "${params.outdir}/${params.aligner}/deseq2_qc" }, - mode: params.publish_dir_mode, - pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" - ] } } } @@ -256,24 +185,12 @@ if (!params.skip_alignment && params.aligner == 'star_rsem') { if (!params.skip_pseudo_alignment && params.pseudo_aligner) { process { - withName: '.*:QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' { - publishDir = [ - path: { "${params.outdir}/${params.pseudo_aligner}" }, - ] - } - withName: '.*:QUANTIFY_PSEUDO_ALIGNMENT:TXIMETA_TXIMPORT' { ext.prefix = { "${quant_type}.merged" } - publishDir = [ - path: { "${params.outdir}/${params.pseudo_aligner}" }, - ] } withName: '.*:QUANTIFY_PSEUDO_ALIGNMENT:SE_.*' { ext.args = '--assay_names counts,abundance' - publishDir = [ - path: { "${params.outdir}/${params.pseudo_aligner}" }, - ] } withName: '.*:QUANTIFY_PSEUDO_ALIGNMENT:SE_GENE' { ext.prefix = { "${params.pseudo_aligner}.merged.gene_counts" } @@ -299,11 +216,6 @@ if (!params.skip_pseudo_alignment && params.pseudo_aligner) { params.deseq2_vst ? '--vst TRUE' : '' ].join(' ').trim() } ext.args2 = { params.pseudo_aligner } - publishDir = [ - path: { "${params.outdir}/${params.pseudo_aligner}/deseq2_qc" }, - mode: params.publish_dir_mode, - pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" - ] } } } From 2a93c91fa091d26bc5ad3bedad10374315be4cad Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Mon, 18 Mar 2024 15:24:27 -0500 Subject: [PATCH 03/17] Add explicit inclusion of subworkflow outputs Signed-off-by: Ben Sherman --- workflows/rnaseq/main.nf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index 2ae735e98..098144ec1 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -788,6 +788,8 @@ workflow RNASEQ { } output { + include 'PREPARE_GENOME' + path(params.outdir, mode: params.publish_dir_mode) { // // STAR Salmon alignment options From daf61c7e011ab1f7dbedb2456fa3cac627b4c4c9 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Sat, 30 Mar 2024 12:09:58 -0500 Subject: [PATCH 04/17] Apply updates from upstream Signed-off-by: Ben Sherman --- subworkflows/local/prepare_genome/main.nf | 43 +- workflows/rnaseq/main.nf | 599 ++++++++++++---------- 2 files changed, 337 insertions(+), 305 deletions(-) diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index 47bd98b60..a02b524f5 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -345,31 +345,26 @@ workflow PREPARE_GENOME { } output { - if( !params.save_reference ) - return + directory params.outdir, mode: params.publish_dir_mode, enabled: params.save_reference - path(params.outdir, mode: params.publish_dir_mode) { - path('genome') { - select 'GUNZIP_.*' - select 'MAKE_TRANSCRIPTS_FASTA' - select 'GFFREAD' - select 'GTF2BED' - select 'CAT_ADDITIONAL_FASTA' - select 'PREPROCESS_TRANSCRIPTS_FASTA_GENCODE' - select 'GTF_FILTER' - select 'CUSTOM_GETCHROMSIZES' - } + 'genome' { + from PREPARE_GENOME.out.fasta + from PREPARE_GENOME.out.gtf + // from PREPARE_GENOME.out.gff + // from PREPARE_GENOME.out.add_fasta + from PREPARE_GENOME.out.gene_bed + from PREPARE_GENOME.out.transcript_fasta + from PREPARE_GENOME.out.fai + // from PREPARE_GENOME.out.sizes + } - path('genome/index') { - select 'UNTAR_.*' - select 'STAR_GENOMEGENERATE' - select 'STAR_GENOMEGENERATE_IGENOMES' - select 'HISAT2_BUILD' - select 'HISAT2_EXTRACTSPLICESITES' - select 'SALMON_INDEX' - select 'KALLISTO_INDEX' - select 'RSEM_PREPAREREFERENCE_GENOME' - select 'PREPARE_GENOME:BBMAP_BBSPLIT' - } + 'genome/index' { + from PREPARE_GENOME.out.splicesites + from PREPARE_GENOME.out.bbsplit_index + from PREPARE_GENOME.out.star_index + from PREPARE_GENOME.out.rsem_index + from PREPARE_GENOME.out.hisat2_index + from PREPARE_GENOME.out.salmon_index + from PREPARE_GENOME.out.kallisto_index } } diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index 098144ec1..cb6783b76 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -788,344 +788,381 @@ workflow RNASEQ { } output { - include 'PREPARE_GENOME' + directory params.outdir, mode: params.publish_dir_mode - path(params.outdir, mode: params.publish_dir_mode) { - // - // STAR Salmon alignment options - // - path(params.aligner) { - select '.*:QUANTIFY_STAR_SALMON:SALMON_QUANT' - select '.*:QUANTIFY_STAR_SALMON:CUSTOM_TX2GENE' - select '.*:QUANTIFY_STAR_SALMON:TXIMETA_TXIMPORT' - select '.*:QUANTIFY_STAR_SALMON:SE_.*' - - if( params.save_align_intermeds || params.save_umi_intermeds ) { - select 'NFCORE_RNASEQ:RNASEQ:SAMTOOLS_SORT', pattern: '*.bam' - path('umitools/log') { - select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.log' - } - select 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON', pattern: '*.bam' - - select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT', pattern: '*.bam' - select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX', pattern: '*.bai' - path('samtools_stats') { - select 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - } - } - - path('umitools') { - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.tsv' - } - if( params.save_align_intermeds || params.save_umi_intermeds ) - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:UMITOOLS_DEDUP', pattern: '*.bam' + // + // STAR Salmon alignment options + // + "${params.aligner}" { + from QUANTIFY_STAR_SALMON.out.results + from QUANTIFY_STAR_SALMON.out.tpm_gene + from QUANTIFY_STAR_SALMON.out.counts_gene + from QUANTIFY_STAR_SALMON.out.lengths_gene + from QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled + from QUANTIFY_STAR_SALMON.out.counts_gene_scaled + from QUANTIFY_STAR_SALMON.out.tpm_transcript + from QUANTIFY_STAR_SALMON.out.counts_transcript + from QUANTIFY_STAR_SALMON.out.lengths_transcript + from QUANTIFY_STAR_SALMON.out.merged_gene_rds + from QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled + from QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled + from QUANTIFY_STAR_SALMON.out.merged_transcript_rds + } - if( params.save_align_intermeds || params.save_umi_intermeds ) - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:SAMTOOLS_INDEX', pattern: '*.bai' + "${params.aligner}" { + defaults enabled: params.save_align_intermeds || params.save_umi_intermeds - path('samtools_stats') { - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - } + from SAMTOOLS_SORT.out.bam + 'umitools/log' { + from UMITOOLS_PREPAREFORSALMON.out.log } + from UMITOOLS_PREPAREFORSALMON.out.bam - // - // General alignment options - // - path(params.aligner) { - path('samtools_stats') { - select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - } - - def wut = ( ['star_salmon','hisat2'].contains(params.aligner) && - ( params.save_align_intermeds || ( !params.with_umi && params.skip_markduplicates ) ) - ) || params.save_align_intermeds || params.skip_markduplicates - if( wut ) { - select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT', pattern: "*.bam" - select 'NFCORE_RNASEQ:RNASEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX', pattern: "*.{bai,csi}" - } + from BAM_SORT_STATS_SAMTOOLS.bam + from BAM_SORT_STATS_SAMTOOLS.bai - path('umitools') { - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:UMITOOLS_DEDUP', pattern: '*.tsv' - } - if( params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ) - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:UMITOOLS_DEDUP', pattern: '*.bam' + 'samtools_stats' { + from BAM_SORT_STATS_SAMTOOLS.stats + from BAM_SORT_STATS_SAMTOOLS.flagstat + from BAM_SORT_STATS_SAMTOOLS.idxstats + } + } - if( params.save_align_intermeds || params.with_umi || params.save_umi_intermeds ) - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:SAMTOOLS_INDEX', pattern: '*.{bai,csi}' + "${params.aligner}" { + 'umitools' { + // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.tsv_edit_distance + // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.tsv_per_umi + // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.tsv_umi_per_position + } + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bam, enabled: params.save_align_intermeds || params.save_umi_intermeds + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bai, enabled: params.save_align_intermeds || params.save_umi_intermeds - path('samtools_stats') { - select '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - } + 'samtools_stats' { + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.stats + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.flagstat + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.idxstats } + } - // - // bigWig coverage options - // - path(params.aligner) { - path('bigwig') { - select '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD:UCSC_BEDGRAPHTOBIGWIG' - select '.*:BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE:UCSC_BEDGRAPHTOBIGWIG' - } + // + // General alignment options + // + "${params.aligner}" { + 'umitools' { + // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.tsv_edit_distance + // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.tsv_per_umi + // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.tsv_umi_per_position } + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bam, enabled: params.save_align_intermeds || params.with_umi || params.save_umi_intermeds + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bai, enabled: params.save_align_intermeds || params.with_umi || params.save_umi_intermeds - // - // DESeq2 QC options - // - path(params.aligner) { - path('deseq2_qc') { - select 'DESEQ2_QC_STAR_SALMON', pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" - select 'DESEQ2_QC_RSEM', pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" - } + 'samtools_stats' { + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.stats + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.flagstat + from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.idxstats } + } - // - // Pseudo-alignment options - // - path(params.pseudo_aligner) { - select '.*:QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' - select '.*:QUANTIFY_PSEUDO_ALIGNMENT:TXIMETA_TXIMPORT' - select '.*:QUANTIFY_PSEUDO_ALIGNMENT:SE_.*' + // + // bigWig coverage options + // + "${params.aligner}/bigwig" { + from BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig + from BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig + } - path('deseq2_qc') { - select 'DESEQ2_QC_PSEUDO', pattern: "*{RData,pca.vals.txt,plots.pdf,sample.dists.txt,size_factors,log}" - } - } + // + // DESeq2 QC options + // + "${params.aligner}/deseq2_qc" { + from DESEQ2_QC_STAR_SALMON.out.rdata + from DESEQ2_QC_STAR_SALMON.out.pca_txt + from DESEQ2_QC_STAR_SALMON.out.pdf, pattern: '*.plots.pdf' + from DESEQ2_QC_STAR_SALMON.out.dists_txt + from DESEQ2_QC_STAR_SALMON.out.size_factors + from DESEQ2_QC_STAR_SALMON.out.log + + from DESEQ2_QC_RSEM.out.rdata + from DESEQ2_QC_RSEM.out.pca_txt + from DESEQ2_QC_RSEM.out.pdf, pattern: '*.plots.pdf' + from DESEQ2_QC_RSEM.out.dists_txt + from DESEQ2_QC_RSEM.out.size_factors + from DESEQ2_QC_RSEM.out.log + } - // modules/local/dupradar - path(params.aligner) { - path('dupradar') { - path('scatter_plot') { - select 'DUPRADAR', pattern: "*Dens.pdf" - } - path('box_plot') { - select 'DUPRADAR', pattern: "*Boxplot.pdf" - } - path('histogram') { - select 'DUPRADAR', pattern: "*Hist.pdf" - } - path('gene_data') { - select 'DUPRADAR', pattern: "*Matrix.txt" - } - path('intercepts_slope') { - select 'DUPRADAR', pattern: "*slope.txt" - } - } + // + // Pseudo-alignment options + // + "${params.pseudo_aligner}" { + // from 'QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' + + from QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene + from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene + from QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene + from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled + from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled + from QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript + from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript + from QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript + + from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds + from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled + from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled + from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds + + 'deseq2_qc' { + from DESEQ2_QC_PSEUDO.out.rdata + from DESEQ2_QC_PSEUDO.out.pca_txt + from DESEQ2_QC_PSEUDO.out.pdf, pattern: '*.plots.pdf' + from DESEQ2_QC_PSEUDO.out.dists_txt + from DESEQ2_QC_PSEUDO.out.size_factors + from DESEQ2_QC_PSEUDO.out.log } + } - // modules/nf-core/bbmap/bbsplit - path('bbsplit') { - select 'BBMAP_BBSPLIT', pattern: '*.txt' + // modules/local/dupradar + "${params.aligner}/dupradar" { + 'scatter_plot' { + from DUPRADAR.out.pdf, pattern: "*Dens.pdf" } - - if( params.save_bbsplit_reads ) { - path('bbsplit') { - select 'BBMAP_BBSPLIT', pattern: '*.fastq.gz' - } + 'box_plot' { + from DUPRADAR.out.pdf, pattern: "*Boxplot.pdf" } - - // modules/nf-core/cat/fastq - if( params.save_merged_fastq ) { - path('fastq') { - select 'CAT_FASTQ', pattern: '*.fastq.gz' - } + 'histogram' { + from DUPRADAR.out.pdf, pattern: "*Hist.pdf" + } + 'gene_data' { + from DUPRADAR.out.txt, pattern: "*Matrix.txt" } + 'intercepts_slope' { + from DUPRADAR.out.txt, pattern: "*slope.txt" + } + } - // modules/nf-core/multiqc - def multiqc_path = params.skip_alignment - ? 'multiqc' - : "multiqc/${params.aligner}" + // modules/nf-core/bbmap/bbsplit + 'bbsplit' { + from BBMAP_BBSPLIT.out.stats + from BBMAP_BBSPLIT.out.all_fastq, enabled: params.save_bbsplit_reads + } - path(multiqc_path) { - select 'MULTIQC' - } + // modules/nf-core/cat/fastq + 'fastq' { + from CAT_FASTQ.out.reads, enabled: params.save_merged_fastq + } - // modules/nf-core/preseq/lcextrap - path(params.aligner) { - path('preseq') { - select 'PRESEQ_LCEXTRAP', pattern: "*.txt" - } - path('preseq/log') { - select 'PRESEQ_LCEXTRAP', pattern: "*.log" - } - } + // modules/nf-core/multiqc + def multiqc_path = params.skip_alignment + ? 'multiqc' + : "multiqc/${params.aligner}" - // modules/nf-core/qualimap/rnaseq - path(params.aligner) { - path('qualimap') { - select 'QUALIMAP_RNASEQ' - } - } + "${multiqc_path}" { + from MULTIQC.out.report + from MULTIQC.out.data + from MULTIQC.out.plots + } - // modules/nf-core/sortmerna - path('sortmerna') { - select 'SORTMERNA', pattern: "*.log" - if( params.save_non_ribo_reads ) - select 'SORTMERNA', pattern: "*.fastq.gz" + // modules/nf-core/preseq/lcextrap + "${params.aligner}" { + 'preseq' { + from PRESEQ_LCEXTRAP.out.lc_extrap } - - // modules/nf-core/stringtie/stringtie - path(params.aligner) { - path('stringtie') { - select 'STRINGTIE_STRINGTIE' - } + 'preseq/log' { + from PRESEQ_LCEXTRAP.out.log } + } - // modules/nf-core/subread/featurecounts - path(params.aligner) { - path('featurecounts') { - select 'SUBREAD_FEATURECOUNTS' - select 'MULTIQC_CUSTOM_BIOTYPE' - } + // modules/nf-core/qualimap/rnaseq + "${params.aligner}/qualimap" { + from QUALIMAP_RNASEQ.out.results + } + + // modules/nf-core/sortmerna + 'sortmerna' { + from SORTMERNA.out.log + from SORTMERNA.out.reads, enabled: params.save_non_ribo_reads + } + + // modules/nf-core/stringtie/stringtie + "${params.aligner}/stringtie" { + from STRINGTIE_STRINGTIE.out.transcript_gtf + from STRINGTIE_STRINGTIE.out.abundance + from STRINGTIE_STRINGTIE.out.coverage_gtf + from STRINGTIE_STRINGTIE.out.ballgown + } + + // modules/nf-core/subread/featurecounts + "${params.aligner}/featurecounts" { + from SUBREAD_FEATURECOUNTS.out.counts + from SUBREAD_FEATURECOUNTS.out.summary + from MULTIQC_CUSTOM_BIOTYPE.out.tsv + } + + // subworkflows/local/align_star + "${params.aligner}" { + 'log' { + from ALIGN_STAR.out.log_final + from ALIGN_STAR.out.log_out + from ALIGN_STAR.out.log_progress + from ALIGN_STAR.out.tab } - // subworkflows/local/align_star - path(params.aligner) { - path('log') { - select '.*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES', pattern: '*.{out,tab}' - } - if( params.save_align_intermeds ) - select '.*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES', pattern: '*.bam' - if( params.save_unaligned ) { - path('unmapped') { - select '.*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES', pattern: '*.fastq.gz' - } - } + from ALIGN_STAR.out.orig_bam, enabled: params.save_align_intermeds + from ALIGN_STAR.out.bam_sorted, enabled: params.save_align_intermeds + from ALIGN_STAR.out.bam_transcript, enabled: params.save_align_intermeds + + 'unmapped' { + from ALIGN_STAR.out.fastq, enabled: params.save_unaligned } + } - // subworkflows/local/quantify_rsem - path(params.aligner) { - select '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION', pattern: "*.{stat,results}" - if( params.save_align_intermeds ) - select '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION', pattern: "*.bam" - path('log') { - select '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION', pattern: "*.log" - } - select '.*:QUANTIFY_RSEM:RSEM_MERGE_COUNTS' + // subworkflows/local/quantify_rsem + "${params.aligner}" { + from QUANTIFY_RSEM.out.counts_gene + from QUANTIFY_RSEM.out.counts_transcript + from QUANTIFY_RSEM.out.stat + + from QUANTIFY_RSEM.out.bam_star, enabled: params.save_align_intermeds + from QUANTIFY_RSEM.out.bam_genome, enabled: params.save_align_intermeds + from QUANTIFY_RSEM.out.bam_transcript, enabled: params.save_align_intermeds + + 'log' { + from QUANTIFY_RSEM.out.logs } - // subworkflows/nf-core/bam_markduplicates_picard - path(params.aligner) { - path('picard_metrics') { - select '.*:BAM_MARKDUPLICATES_PICARD:PICARD_MARKDUPLICATES', pattern: '*metrics.txt' - } - select '.*:BAM_MARKDUPLICATES_PICARD:PICARD_MARKDUPLICATES', pattern: '*.bam' - select '.*:BAM_MARKDUPLICATES_PICARD:SAMTOOLS_INDEX', pattern: '*.{bai,csi}' - path('samtools_stats') { - select '.*:BAM_MARKDUPLICATES_PICARD:BAM_STATS_SAMTOOLS:.*', pattern: '*.{stats,flagstat,idxstats}' - } + from QUANTIFY_RSEM.out.merged_counts_gene + from QUANTIFY_RSEM.out.merged_tpm_gene + from QUANTIFY_RSEM.out.merged_counts_transcript + from QUANTIFY_RSEM.out.merged_tpm_transcript + } + + // subworkflows/nf-core/bam_markduplicates_picard + "${params.aligner}" { + 'picard_metrics' { + from BAM_MARKDUPLICATES_PICARD.out.metrics + } + from BAM_MARKDUPLICATES_PICARD.out.bam + from BAM_MARKDUPLICATES_PICARD.out.bai + from BAM_MARKDUPLICATES_PICARD.out.csi + 'samtools_stats' { + from BAM_MARKDUPLICATES_PICARD.out.stats + from BAM_MARKDUPLICATES_PICARD.out.flagstat + from BAM_MARKDUPLICATES_PICARD.out.idxstats } + } - // subworkflows/nf-core/bam_rseqc - path(params.aligner) { - path('rseqc/bam_stat') { - select '.*:BAM_RSEQC:RSEQC_BAMSTAT' + // subworkflows/nf-core/bam_rseqc + "${params.aligner}/rseqc" { + 'bam_stat' { + from BAM_RSEQC.out.bamstat_txt + } + 'infer_experiment' { + from BAM_RSEQC.out.inferexperiment_txt + } + 'junction_annotation' { + 'pdf' { + from BAM_RSEQC.out.junctionannotation_pdf + from BAM_RSEQC.out.junctionannotation_events_pdf } - path('rseqc/infer_experiment') { - select '.*:BAM_RSEQC:RSEQC_INFEREXPERIMENT' + 'bed' { + from BAM_RSEQC.out.junctionannotation_bed + from BAM_RSEQC.out.junctionannotation_interact_bed } - path('rseqc/junction_annotation') { - path('pdf') { - select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.pdf' - } - path('bed') { - select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.bed' - } - path('xls') { - select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.xls' - } - path('log') { - select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.log' - } - path('rscript') { - select '.*:BAM_RSEQC:RSEQC_JUNCTIONANNOTATION', pattern: '*.r' - } + 'xls' { + from BAM_RSEQC.out.junctionannotation_xls } - path('rseqc/junction_saturation') { - path('pdf') { - select '.*:BAM_RSEQC:RSEQC_JUNCTIONSATURATION', pattern: '*.pdf' - } - path('rscript') { - select '.*:BAM_RSEQC:RSEQC_JUNCTIONSATURATION', pattern: '*.r' - } - } - path('rseqc/read_duplication') { - path('pdf') { - select '.*:BAM_RSEQC:RSEQC_READDUPLICATION', pattern: '*.pdf' - } - path('xls') { - select '.*:BAM_RSEQC:RSEQC_READDUPLICATION', pattern: '*.xls' - } - path('rscript') { - select '.*:BAM_RSEQC:RSEQC_READDUPLICATION', pattern: '*.r' - } + 'log' { + from BAM_RSEQC.out.junctionannotation_log } - path('rseqc/read_distribution') { - select '.*:BAM_RSEQC:RSEQC_READDISTRIBUTION' + 'rscript' { + from BAM_RSEQC.out.junctionannotation_rscript } - path('rseqc/inner_distance') { - path('txt') { - select '.*:BAM_RSEQC:RSEQC_INNERDISTANCE', pattern: '*.txt' - } - path('pdf') { - select '.*:BAM_RSEQC:RSEQC_INNERDISTANCE', pattern: '*.pdf' - } - path('rscript') { - select '.*:BAM_RSEQC:RSEQC_INNERDISTANCE', pattern: '*.r' - } + } + 'junction_saturation' { + 'pdf' { + from BAM_RSEQC.out.junctionsaturation_pdf } - path('rseqc/tin') { - select '.*:BAM_RSEQC:RSEQC_TIN' + 'rscript' { + from BAM_RSEQC.out.junctionsaturation_rscript } } - - // subworkflows/nf-core/fastq_align_hisat2 - path(params.aligner) { - path('log') { - select '.*:FASTQ_ALIGN_HISAT2:HISAT2_ALIGN', pattern: '*.log' + 'read_duplication' { + 'pdf' { + from BAM_RSEQC.out.readduplication_pdf } - if( params.save_align_intermeds ) - select '.*:FASTQ_ALIGN_HISAT2:HISAT2_ALIGN', pattern: '*.bam' - if( params.save_unaligned ) { - path('unmapped') { - select '.*:FASTQ_ALIGN_HISAT2:HISAT2_ALIGN', pattern: '*.fastq.gz' - } + 'xls' { + from BAM_RSEQC.out.readduplication_seq_xls + from BAM_RSEQC.out.readduplication_pos_xls + } + 'rscript' { + from BAM_RSEQC.out.readduplication_rscript } } - - // subworkflows/nf-core/fastq_fastqc_umitools_fastp - path(params.trimmer) { - path('fastqc') { - select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTQC_TRIM' + 'read_distribution' { + from BAM_RSEQC.out.readdistribution_txt + } + 'inner_distance' { + 'txt' { + from BAM_RSEQC.out.innerdistance_distance + from BAM_RSEQC.out.innerdistance_freq + from BAM_RSEQC.out.innerdistance_mean + } + 'pdf' { + from BAM_RSEQC.out.innerdistance_pdf } - select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP', pattern: "*.{json,html}" - path('log') { - select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP', pattern: "*.log" + 'rscript' { + from BAM_RSEQC.out.innerdistance_rscript } - if( params.save_trimmed ) - select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:FASTP', pattern: "*.fastq.gz" } + 'tin' { + from BAM_RSEQC.out.tin_txt + } + } - path('umitools') { - select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:UMITOOLS_EXTRACT', pattern: "*.log" - if( params.save_umi_intermeds ) - select '.*:FASTQ_FASTQC_UMITOOLS_FASTP:UMITOOLS_EXTRACT', pattern: "*.fastq.gz" + // subworkflows/nf-core/fastq_align_hisat2 + "${params.aligner}" { + 'log' { + from FASTQ_ALIGN_HISAT2.out.summary } + from FASTQ_ALIGN_HISAT2.out.orig_bam, enabled: params.save_align_intermeds + 'unmapped' { + fom FASTQ_ALIGN_HISAT2.out.fastq, enabled: params.save_unaligned + } + } - // subworkflows/nf-core/fastq_fastqc_umitools_trimgalore - path(params.trimmer) { - path('fastqc') { - select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE', pattern: "*.{html,zip}" - } - if( params.save_trimmed ) - select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE', pattern: "*.fq.gz" - select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE', pattern: "*.txt" + // subworkflows/nf-core/fastq_fastqc_umitools_fastp + "${params.trimmer}" { + 'fastqc' { + from FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_html + from FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_zip + } + from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_json + from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_html + 'log' { + from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_log } + // from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads, enabled: params.save_trimmed + from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_fail, enabled: params.save_trimmed + from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_merged, enabled: params.save_trimmed + } - path('umitools') { - select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:UMITOOLS_EXTRACT', pattern: "*.log" - if( params.save_umi_intermeds ) - select '.*:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:UMITOOLS_EXTRACT', pattern: "*.fastq.gz" + 'umitools' { + from FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_log + // from FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_reads, enabled: params.save_umi_intermeds + } + + // subworkflows/nf-core/fastq_fastqc_umitools_trimgalore + "${params.trimmer}" { + 'fastqc' { + from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_html + from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_zip } + from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_log + // from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_reads, enabled: params.save_trimmed + } + + 'umitools' { + from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_log + // from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_reads, enabled: params.save_umi_intermeds } } From 69f258e079905d56863f90c7ac6a03202a7ded0a Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Sat, 6 Apr 2024 14:26:58 -0500 Subject: [PATCH 05/17] Move output definition to top-level workflow Signed-off-by: Ben Sherman --- main.nf | 234 ++++++++ subworkflows/local/prepare_genome/main.nf | 42 +- .../bam_dedup_stats_samtools_umitools/main.nf | 5 + workflows/rnaseq/main.nf | 553 ++++++------------ 4 files changed, 430 insertions(+), 404 deletions(-) diff --git a/main.nf b/main.nf index 59001a4f1..2771f993c 100755 --- a/main.nf +++ b/main.nf @@ -164,6 +164,240 @@ workflow { ) } +output { + directory params.outdir, mode: params.publish_dir_mode + + // + // Genome preparation + // + 'genome' { + enabled params.save_reference + from 'genome' + } + + 'genome/index' { + enabled params.save_reference + from 'genome-index' + } + + // + // Alignment + // + "${params.aligner}" { + from 'align' + + 'samtools_stats' { + from 'align-samtools-stats' + } + + 'umitools' { + from 'align-umitools' + } + } + + "${params.aligner}" { + enabled params.save_align_intermeds || params.save_umi_intermeds + from 'align-intermeds' + + 'samtools_stats' { + from 'align-intermeds-samtools-stats' + } + 'umitools/log' { + from 'align-intermeds-umitools-log' + } + } + + // + // bigWig coverage + // + "${params.aligner}/bigwig" { + from 'align-bigwig' + } + + // + // DESeq2 QC + // + "${params.aligner}/deseq2_qc" { + from 'align-deseq2' + } + + // + // Pseudo-alignment + // + "${params.pseudo_aligner}" { + from 'pseudo-align' + // TODO: process 'QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' + + 'deseq2_qc' { + from 'pseudo-align-deseq2' + } + } + + // modules/local/dupradar + "${params.aligner}/dupradar" { + 'scatter_plot' { + from 'align-dupradar', pattern: "*Dens.pdf" + } + 'box_plot' { + from 'align-dupradar', pattern: "*Boxplot.pdf" + } + 'histogram' { + from 'align-dupradar', pattern: "*Hist.pdf" + } + 'gene_data' { + from 'align-dupradar', pattern: "*Matrix.txt" + } + 'intercepts_slope' { + from 'align-dupradar', pattern: "*slope.txt" + } + } + + // modules/nf-core/bbmap/bbsplit + 'bbsplit' { + from 'bbsplit' + from 'bbsplit-intermeds', enabled: params.save_bbsplit_reads + } + + // modules/nf-core/cat/fastq + 'fastq' { + enabled params.save_merged_fastq + from 'merged-fastq' + } + + // modules/nf-core/multiqc + def multiqc_path = params.skip_alignment + ? 'multiqc' + : "multiqc/${params.aligner}" + + "${multiqc_path}" { + from 'multiqc' + } + + // modules/nf-core/preseq/lcextrap + "${params.aligner}" { + 'preseq' { + from 'preseq' + } + 'preseq/log' { + from 'preseq-log' + } + } + + // modules/nf-core/qualimap/rnaseq + "${params.aligner}/qualimap" { + from 'qualimap' + } + + // modules/nf-core/sortmerna + 'sortmerna' { + from 'sortmerna' + from 'sortmerna-intermeds', enabled: params.save_non_ribo_reads + } + + // modules/nf-core/stringtie/stringtie + "${params.aligner}/stringtie" { + from 'align-stringtie' + } + + // modules/nf-core/subread/featurecounts + "${params.aligner}/featurecounts" { + from 'align-featurecounts' + } + + // subworkflows/local/align_star + "${params.aligner}" { + 'log' { + from 'align-star-log' + } + + from 'align-star-intermeds' + + 'unmapped' { + from 'align-star-unaligned' + } + } + + // subworkflows/local/quantify_rsem + "${params.aligner}" { + from 'quantify-rsem' + from 'quantify-rsem-intermeds', enabled: params.save_align_intermeds + + 'log' { + from 'quantify-rsem-log' + } + } + + // subworkflows/nf-core/bam_markduplicates_picard + "${params.aligner}" { + from 'align-picard' + 'picard_metrics' { + from 'align-picard-metrics' + } + 'samtools_stats' { + from 'align-picard-stats' + } + } + + // subworkflows/nf-core/bam_rseqc + "${params.aligner}/rseqc" { + 'bam_stat' { + from 'align-rseqc-bamstat' + } + 'infer_experiment' { + from 'align-rseqc-inferexperiment' + } + 'junction_annotation' { + from 'align-rseqc-junctionannotation' + } + 'junction_saturation' { + from 'align-rseqc-junctionsaturation' + } + 'read_duplication' { + from 'align-rseqc-readduplication' + } + 'read_distribution' { + from 'align-rseqc-readdistribution' + } + 'inner_distance' { + from 'align-rseqc-innerdistance' + } + 'tin' { + from 'align-rseqc-tin' + } + } + + // subworkflows/nf-core/fastq_align_hisat2 + "${params.aligner}" { + 'log' { + from 'align-hisat2-log' + } + + from 'align-hisat2-intermeds', enabled: params.save_align_intermeds + + 'unmapped' { + from 'align-hisat2-unaligned', enabled: params.save_unaligned + } + } + + // subworkflows/nf-core/fastq_fastqc_umitools_fastp + // subworkflows/nf-core/fastq_fastqc_umitools_trimgalore + "${params.trimmer}" { + 'fastqc' { + from 'trim-fastqc' + } + from 'trim' + 'log' { + from 'trim-log' + } + from 'trim-intermeds', enabled: params.save_trimmed + } + + 'umitools' { + from 'umitools' + from 'umitools-intermeds', enabled: params.save_umi_intermeds + } +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index a02b524f5..0e1268aac 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -327,6 +327,23 @@ workflow PREPARE_GENOME { } } + topic: + ch_fasta >> 'genome' + ch_gtf >> 'genome' + ch_gff >> 'genome' + ch_add_fasta >> 'genome' + ch_gene_bed >> 'genome' + ch_transcript_fasta >> 'genome' + ch_fai >> 'genome' + ch_sizes >> 'genome' + ch_splicesites >> 'genome-index' + ch_bbsplit_index >> 'genome-index' + ch_star_index >> 'genome-index' + ch_rsem_index >> 'genome-index' + ch_hisat2_index >> 'genome-index' + ch_salmon_index >> 'genome-index' + ch_kallisto_index >> 'genome-index' + emit: fasta = ch_fasta // channel: path(genome.fasta) gtf = ch_gtf // channel: path(genome.gtf) @@ -343,28 +360,3 @@ workflow PREPARE_GENOME { kallisto_index = ch_kallisto_index // channel: [ meta, path(kallisto/index/) ] versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] } - -output { - directory params.outdir, mode: params.publish_dir_mode, enabled: params.save_reference - - 'genome' { - from PREPARE_GENOME.out.fasta - from PREPARE_GENOME.out.gtf - // from PREPARE_GENOME.out.gff - // from PREPARE_GENOME.out.add_fasta - from PREPARE_GENOME.out.gene_bed - from PREPARE_GENOME.out.transcript_fasta - from PREPARE_GENOME.out.fai - // from PREPARE_GENOME.out.sizes - } - - 'genome/index' { - from PREPARE_GENOME.out.splicesites - from PREPARE_GENOME.out.bbsplit_index - from PREPARE_GENOME.out.star_index - from PREPARE_GENOME.out.rsem_index - from PREPARE_GENOME.out.hisat2_index - from PREPARE_GENOME.out.salmon_index - from PREPARE_GENOME.out.kallisto_index - } -} diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf index 7c07084ff..332355f40 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf @@ -42,6 +42,11 @@ workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS { BAM_STATS_SAMTOOLS ( ch_bam_bai_dedup, [ [:], [] ] ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) + topic: + UMITOOLS_DEDUP.out.tsv_edit_distance >> 'align-umitools' + UMITOOLS_DEDUP.out.tsv_per_umi >> 'align-umitools' + UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'align-umitools' + emit: bam = UMITOOLS_DEDUP.out.bam // channel: [ val(meta), path(bam) ] diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index cb6783b76..7892fba91 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -782,390 +782,185 @@ workflow RNASEQ { ch_multiqc_report = MULTIQC.out.report } + topic: + QUANTIFY_STAR_SALMON.out.results >> 'align' + QUANTIFY_STAR_SALMON.out.tpm_gene >> 'align' + QUANTIFY_STAR_SALMON.out.counts_gene >> 'align' + QUANTIFY_STAR_SALMON.out.lengths_gene >> 'align' + QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled >> 'align' + QUANTIFY_STAR_SALMON.out.counts_gene_scaled >> 'align' + QUANTIFY_STAR_SALMON.out.tpm_transcript >> 'align' + QUANTIFY_STAR_SALMON.out.counts_transcript >> 'align' + QUANTIFY_STAR_SALMON.out.lengths_transcript >> 'align' + QUANTIFY_STAR_SALMON.out.merged_gene_rds >> 'align' + QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled >> 'align' + QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled >> 'align' + QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'align' + + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bam >> 'align-intermeds' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bai >> 'align-intermeds' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.stats >> 'align-samtools-stats' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.flagstat >> 'align-samtools-stats' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.idxstats >> 'align-samtools-stats' + BAM_SORT_STATS_SAMTOOLS.out.bam >> 'align-intermeds' + BAM_SORT_STATS_SAMTOOLS.out.bai >> 'align-intermeds' + BAM_SORT_STATS_SAMTOOLS.out.stats >> 'align-intermeds-samtools-stats' + BAM_SORT_STATS_SAMTOOLS.out.flagstat >> 'align-intermeds-samtools-stats' + BAM_SORT_STATS_SAMTOOLS.out.idxstats >> 'align-intermeds-samtools-stats' + SAMTOOLS_SORT.out.bam >> 'align-intermeds' + UMITOOLS_PREPAREFORSALMON.out.bam >> 'align-intermeds' + UMITOOLS_PREPAREFORSALMON.out.log >> 'align-intermeds-umitools-log' + + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bam >> 'align-intermeds' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bai >> 'align-intermeds' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.stats >> 'align-samtools-stats' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.flagstat >> 'align-samtools-stats' + BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.idxstats >> 'align-samtools-stats' + + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig >> 'align-bigwig' + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig >> 'align-bigwig' + + DESEQ2_QC_STAR_SALMON.out.rdata >> 'align-deseq2' + DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'align-deseq2' + DESEQ2_QC_STAR_SALMON.out.pdf >> 'align-deseq2' + DESEQ2_QC_STAR_SALMON.out.dists_txt >> 'align-deseq2' + DESEQ2_QC_STAR_SALMON.out.size_factors >> 'align-deseq2' + DESEQ2_QC_STAR_SALMON.out.log >> 'align-deseq2' + DESEQ2_QC_RSEM.out.rdata >> 'align-deseq2' + DESEQ2_QC_RSEM.out.pca_txt >> 'align-deseq2' + DESEQ2_QC_RSEM.out.pdf >> 'align-deseq2' + DESEQ2_QC_RSEM.out.dists_txt >> 'align-deseq2' + DESEQ2_QC_RSEM.out.size_factors >> 'align-deseq2' + DESEQ2_QC_RSEM.out.log >> 'align-deseq2' + + QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled >> 'pseudo-align' + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds >> 'pseudo-align' + + DESEQ2_QC_PSEUDO.out.rdata >> 'pseudo-align-deseq2' + DESEQ2_QC_PSEUDO.out.pca_txt >> 'pseudo-align-deseq2' + DESEQ2_QC_PSEUDO.out.pdf >> 'pseudo-align-deseq2' + DESEQ2_QC_PSEUDO.out.dists_txt >> 'pseudo-align-deseq2' + DESEQ2_QC_PSEUDO.out.size_factors >> 'pseudo-align-deseq2' + DESEQ2_QC_PSEUDO.out.log >> 'pseudo-align-deseq2' + + DUPRADAR.out.pdf >> 'align-dupradar' + DUPRADAR.out.txt >> 'align-dupradar' + + BBMAP_BBSPLIT.out.stats >> 'bbsplit' + BBMAP_BBSPLIT.out.all_fastq >> 'bbsplit-intermeds' + + CAT_FASTQ.out.reads >> 'merged-fastq' + + MULTIQC.out.report >> 'multiqc' + MULTIQC.out.data >> 'multiqc' + MULTIQC.out.plots >> 'multiqc' + + PRESEQ_LCEXTRAP.out.lc_extrap >> 'align-preseq' + PRESEQ_LCEXTRAP.out.log >> 'align-preseq-log' + + QUALIMAP_RNASEQ.out.results >> 'align-qualimap' + + SORTMERNA.out.log >> 'sortmerna' + SORTMERNA.out.reads >> 'sortmerna-intermeds' + + STRINGTIE_STRINGTIE.out.transcript_gtf >> 'align-stringtie' + STRINGTIE_STRINGTIE.out.abundance >> 'align-stringtie' + STRINGTIE_STRINGTIE.out.coverage_gtf >> 'align-stringtie' + STRINGTIE_STRINGTIE.out.ballgown >> 'align-stringtie' + + SUBREAD_FEATURECOUNTS.out.counts >> 'align-featurecounts' + SUBREAD_FEATURECOUNTS.out.summary >> 'align-featurecounts' + MULTIQC_CUSTOM_BIOTYPE.out.tsv >> 'align-featurecounts' + + ALIGN_STAR.out.log_final >> 'align-star-log' + ALIGN_STAR.out.log_out >> 'align-star-log' + ALIGN_STAR.out.log_progress >> 'align-star-log' + ALIGN_STAR.out.tab >> 'align-star-log' + ALIGN_STAR.out.orig_bam >> 'align-star-intermeds' + ALIGN_STAR.out.bam_sorted >> 'align-star-intermeds' + ALIGN_STAR.out.bam_transcript >> 'align-star-intermeds' + ALIGN_STAR.out.fastq >> 'align-star-unaligned' + + QUANTIFY_RSEM.out.counts_gene >> 'quantify-rsem' + QUANTIFY_RSEM.out.counts_transcript >> 'quantify-rsem' + QUANTIFY_RSEM.out.stat >> 'quantify-rsem' + QUANTIFY_RSEM.out.logs >> 'quantify-rsem-log' + QUANTIFY_RSEM.out.bam_star >> 'quantify-rsem-intermeds' + QUANTIFY_RSEM.out.bam_genome >> 'quantify-rsem-intermeds' + QUANTIFY_RSEM.out.bam_transcript >> 'quantify-rsem-intermeds' + QUANTIFY_RSEM.out.merged_counts_gene >> 'quantify-rsem' + QUANTIFY_RSEM.out.merged_tpm_gene >> 'quantify-rsem' + QUANTIFY_RSEM.out.merged_counts_transcript >> 'quantify-rsem' + QUANTIFY_RSEM.out.merged_tpm_transcript >> 'quantify-rsem' + + BAM_MARKDUPLICATES_PICARD.out.bam >> 'align-picard' + BAM_MARKDUPLICATES_PICARD.out.bai >> 'align-picard' + BAM_MARKDUPLICATES_PICARD.out.csi >> 'align-picard' + BAM_MARKDUPLICATES_PICARD.out.metrics >> 'align-picard-metrics' + BAM_MARKDUPLICATES_PICARD.out.stats >> 'align-picard-stats' + BAM_MARKDUPLICATES_PICARD.out.flagstat >> 'align-picard-stats' + BAM_MARKDUPLICATES_PICARD.out.idxstats >> 'align-picard-stats' + + BAM_RSEQC.out.bamstat_txt >> 'align-rseqc-bamstat' + BAM_RSEQC.out.inferexperiment_txt >> 'align-rseqc-inferexperiment' + BAM_RSEQC.out.junctionannotation_pdf >> 'align-rseqc-junctionannotation' + BAM_RSEQC.out.junctionannotation_events_pdf >> 'align-rseqc-junctionannotation' + BAM_RSEQC.out.junctionannotation_bed >> 'align-rseqc-junctionannotation' + BAM_RSEQC.out.junctionannotation_interact_bed >> 'align-rseqc-junctionannotation' + BAM_RSEQC.out.junctionannotation_xls >> 'align-rseqc-junctionannotation' + BAM_RSEQC.out.junctionannotation_log >> 'align-rseqc-junctionannotation' + BAM_RSEQC.out.junctionannotation_rscript >> 'align-rseqc-junctionannotation' + BAM_RSEQC.out.junctionsaturation_pdf >> 'align-rseqc-junctionsaturation' + BAM_RSEQC.out.junctionsaturation_rscript >> 'align-rseqc-junctionsaturation' + BAM_RSEQC.out.readduplication_pdf >> 'align-rseqc-readduplication' + BAM_RSEQC.out.readduplication_seq_xls >> 'align-rseqc-readduplication' + BAM_RSEQC.out.readduplication_pos_xls >> 'align-rseqc-readduplication' + BAM_RSEQC.out.readduplication_rscript >> 'align-rseqc-readduplication' + BAM_RSEQC.out.readdistribution_txt >> 'align-rseqc-readdistribution' + BAM_RSEQC.out.innerdistance_distance >> 'align-rseqc-innerdistance' + BAM_RSEQC.out.innerdistance_freq >> 'align-rseqc-innerdistance' + BAM_RSEQC.out.innerdistance_mean >> 'align-rseqc-innerdistance' + BAM_RSEQC.out.innerdistance_pdf >> 'align-rseqc-innerdistance' + BAM_RSEQC.out.innerdistance_rscript >> 'align-rseqc-innerdistance' + BAM_RSEQC.out.tin_txt >> 'align-rseqc-tin' + + FASTQ_ALIGN_HISAT2.out.summary >> 'align-hisat2-log' + FASTQ_ALIGN_HISAT2.out.orig_bam >> 'align-hisat2-intermeds' + FASTQ_ALIGN_HISAT2.out.fastq >> 'align-hisat2-unaligned' + + FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_html >> 'trim-fastqc' + FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_zip >> 'trim-fastqc' + FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_json >> 'trim' + FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_html >> 'trim' + FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_log >> 'trim-log' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads >> 'trim-intermeds' + FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_fail >> 'trim-intermeds' + FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_merged >> 'trim-intermeds' + FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_log >> 'umitools' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_reads >> 'umitools-intermeds' + + FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_html >> 'trim-fastqc' + FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_zip >> 'trim-fastqc' + FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_log >> 'trim' + // FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_reads >> 'trim-intermeds' + FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_log >> 'umitools' + // FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_reads >> 'umitools-intermeds' + emit: multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } -output { - directory params.outdir, mode: params.publish_dir_mode - - // - // STAR Salmon alignment options - // - "${params.aligner}" { - from QUANTIFY_STAR_SALMON.out.results - from QUANTIFY_STAR_SALMON.out.tpm_gene - from QUANTIFY_STAR_SALMON.out.counts_gene - from QUANTIFY_STAR_SALMON.out.lengths_gene - from QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled - from QUANTIFY_STAR_SALMON.out.counts_gene_scaled - from QUANTIFY_STAR_SALMON.out.tpm_transcript - from QUANTIFY_STAR_SALMON.out.counts_transcript - from QUANTIFY_STAR_SALMON.out.lengths_transcript - from QUANTIFY_STAR_SALMON.out.merged_gene_rds - from QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled - from QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled - from QUANTIFY_STAR_SALMON.out.merged_transcript_rds - } - - "${params.aligner}" { - defaults enabled: params.save_align_intermeds || params.save_umi_intermeds - - from SAMTOOLS_SORT.out.bam - 'umitools/log' { - from UMITOOLS_PREPAREFORSALMON.out.log - } - from UMITOOLS_PREPAREFORSALMON.out.bam - - from BAM_SORT_STATS_SAMTOOLS.bam - from BAM_SORT_STATS_SAMTOOLS.bai - - 'samtools_stats' { - from BAM_SORT_STATS_SAMTOOLS.stats - from BAM_SORT_STATS_SAMTOOLS.flagstat - from BAM_SORT_STATS_SAMTOOLS.idxstats - } - } - - "${params.aligner}" { - 'umitools' { - // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.tsv_edit_distance - // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.tsv_per_umi - // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.tsv_umi_per_position - } - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bam, enabled: params.save_align_intermeds || params.save_umi_intermeds - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bai, enabled: params.save_align_intermeds || params.save_umi_intermeds - - 'samtools_stats' { - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.stats - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.flagstat - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.idxstats - } - } - - // - // General alignment options - // - "${params.aligner}" { - 'umitools' { - // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.tsv_edit_distance - // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.tsv_per_umi - // from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.tsv_umi_per_position - } - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bam, enabled: params.save_align_intermeds || params.with_umi || params.save_umi_intermeds - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bai, enabled: params.save_align_intermeds || params.with_umi || params.save_umi_intermeds - - 'samtools_stats' { - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.stats - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.flagstat - from BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.idxstats - } - } - - // - // bigWig coverage options - // - "${params.aligner}/bigwig" { - from BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig - from BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig - } - - // - // DESeq2 QC options - // - "${params.aligner}/deseq2_qc" { - from DESEQ2_QC_STAR_SALMON.out.rdata - from DESEQ2_QC_STAR_SALMON.out.pca_txt - from DESEQ2_QC_STAR_SALMON.out.pdf, pattern: '*.plots.pdf' - from DESEQ2_QC_STAR_SALMON.out.dists_txt - from DESEQ2_QC_STAR_SALMON.out.size_factors - from DESEQ2_QC_STAR_SALMON.out.log - - from DESEQ2_QC_RSEM.out.rdata - from DESEQ2_QC_RSEM.out.pca_txt - from DESEQ2_QC_RSEM.out.pdf, pattern: '*.plots.pdf' - from DESEQ2_QC_RSEM.out.dists_txt - from DESEQ2_QC_RSEM.out.size_factors - from DESEQ2_QC_RSEM.out.log - } - - // - // Pseudo-alignment options - // - "${params.pseudo_aligner}" { - // from 'QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' - - from QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene - from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene - from QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene - from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled - from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled - from QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript - from QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript - from QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript - - from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds - from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled - from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled - from QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds - - 'deseq2_qc' { - from DESEQ2_QC_PSEUDO.out.rdata - from DESEQ2_QC_PSEUDO.out.pca_txt - from DESEQ2_QC_PSEUDO.out.pdf, pattern: '*.plots.pdf' - from DESEQ2_QC_PSEUDO.out.dists_txt - from DESEQ2_QC_PSEUDO.out.size_factors - from DESEQ2_QC_PSEUDO.out.log - } - } - - // modules/local/dupradar - "${params.aligner}/dupradar" { - 'scatter_plot' { - from DUPRADAR.out.pdf, pattern: "*Dens.pdf" - } - 'box_plot' { - from DUPRADAR.out.pdf, pattern: "*Boxplot.pdf" - } - 'histogram' { - from DUPRADAR.out.pdf, pattern: "*Hist.pdf" - } - 'gene_data' { - from DUPRADAR.out.txt, pattern: "*Matrix.txt" - } - 'intercepts_slope' { - from DUPRADAR.out.txt, pattern: "*slope.txt" - } - } - - // modules/nf-core/bbmap/bbsplit - 'bbsplit' { - from BBMAP_BBSPLIT.out.stats - from BBMAP_BBSPLIT.out.all_fastq, enabled: params.save_bbsplit_reads - } - - // modules/nf-core/cat/fastq - 'fastq' { - from CAT_FASTQ.out.reads, enabled: params.save_merged_fastq - } - - // modules/nf-core/multiqc - def multiqc_path = params.skip_alignment - ? 'multiqc' - : "multiqc/${params.aligner}" - - "${multiqc_path}" { - from MULTIQC.out.report - from MULTIQC.out.data - from MULTIQC.out.plots - } - - // modules/nf-core/preseq/lcextrap - "${params.aligner}" { - 'preseq' { - from PRESEQ_LCEXTRAP.out.lc_extrap - } - 'preseq/log' { - from PRESEQ_LCEXTRAP.out.log - } - } - - // modules/nf-core/qualimap/rnaseq - "${params.aligner}/qualimap" { - from QUALIMAP_RNASEQ.out.results - } - - // modules/nf-core/sortmerna - 'sortmerna' { - from SORTMERNA.out.log - from SORTMERNA.out.reads, enabled: params.save_non_ribo_reads - } - - // modules/nf-core/stringtie/stringtie - "${params.aligner}/stringtie" { - from STRINGTIE_STRINGTIE.out.transcript_gtf - from STRINGTIE_STRINGTIE.out.abundance - from STRINGTIE_STRINGTIE.out.coverage_gtf - from STRINGTIE_STRINGTIE.out.ballgown - } - - // modules/nf-core/subread/featurecounts - "${params.aligner}/featurecounts" { - from SUBREAD_FEATURECOUNTS.out.counts - from SUBREAD_FEATURECOUNTS.out.summary - from MULTIQC_CUSTOM_BIOTYPE.out.tsv - } - - // subworkflows/local/align_star - "${params.aligner}" { - 'log' { - from ALIGN_STAR.out.log_final - from ALIGN_STAR.out.log_out - from ALIGN_STAR.out.log_progress - from ALIGN_STAR.out.tab - } - - from ALIGN_STAR.out.orig_bam, enabled: params.save_align_intermeds - from ALIGN_STAR.out.bam_sorted, enabled: params.save_align_intermeds - from ALIGN_STAR.out.bam_transcript, enabled: params.save_align_intermeds - - 'unmapped' { - from ALIGN_STAR.out.fastq, enabled: params.save_unaligned - } - } - - // subworkflows/local/quantify_rsem - "${params.aligner}" { - from QUANTIFY_RSEM.out.counts_gene - from QUANTIFY_RSEM.out.counts_transcript - from QUANTIFY_RSEM.out.stat - - from QUANTIFY_RSEM.out.bam_star, enabled: params.save_align_intermeds - from QUANTIFY_RSEM.out.bam_genome, enabled: params.save_align_intermeds - from QUANTIFY_RSEM.out.bam_transcript, enabled: params.save_align_intermeds - - 'log' { - from QUANTIFY_RSEM.out.logs - } - - from QUANTIFY_RSEM.out.merged_counts_gene - from QUANTIFY_RSEM.out.merged_tpm_gene - from QUANTIFY_RSEM.out.merged_counts_transcript - from QUANTIFY_RSEM.out.merged_tpm_transcript - } - - // subworkflows/nf-core/bam_markduplicates_picard - "${params.aligner}" { - 'picard_metrics' { - from BAM_MARKDUPLICATES_PICARD.out.metrics - } - from BAM_MARKDUPLICATES_PICARD.out.bam - from BAM_MARKDUPLICATES_PICARD.out.bai - from BAM_MARKDUPLICATES_PICARD.out.csi - 'samtools_stats' { - from BAM_MARKDUPLICATES_PICARD.out.stats - from BAM_MARKDUPLICATES_PICARD.out.flagstat - from BAM_MARKDUPLICATES_PICARD.out.idxstats - } - } - - // subworkflows/nf-core/bam_rseqc - "${params.aligner}/rseqc" { - 'bam_stat' { - from BAM_RSEQC.out.bamstat_txt - } - 'infer_experiment' { - from BAM_RSEQC.out.inferexperiment_txt - } - 'junction_annotation' { - 'pdf' { - from BAM_RSEQC.out.junctionannotation_pdf - from BAM_RSEQC.out.junctionannotation_events_pdf - } - 'bed' { - from BAM_RSEQC.out.junctionannotation_bed - from BAM_RSEQC.out.junctionannotation_interact_bed - } - 'xls' { - from BAM_RSEQC.out.junctionannotation_xls - } - 'log' { - from BAM_RSEQC.out.junctionannotation_log - } - 'rscript' { - from BAM_RSEQC.out.junctionannotation_rscript - } - } - 'junction_saturation' { - 'pdf' { - from BAM_RSEQC.out.junctionsaturation_pdf - } - 'rscript' { - from BAM_RSEQC.out.junctionsaturation_rscript - } - } - 'read_duplication' { - 'pdf' { - from BAM_RSEQC.out.readduplication_pdf - } - 'xls' { - from BAM_RSEQC.out.readduplication_seq_xls - from BAM_RSEQC.out.readduplication_pos_xls - } - 'rscript' { - from BAM_RSEQC.out.readduplication_rscript - } - } - 'read_distribution' { - from BAM_RSEQC.out.readdistribution_txt - } - 'inner_distance' { - 'txt' { - from BAM_RSEQC.out.innerdistance_distance - from BAM_RSEQC.out.innerdistance_freq - from BAM_RSEQC.out.innerdistance_mean - } - 'pdf' { - from BAM_RSEQC.out.innerdistance_pdf - } - 'rscript' { - from BAM_RSEQC.out.innerdistance_rscript - } - } - 'tin' { - from BAM_RSEQC.out.tin_txt - } - } - - // subworkflows/nf-core/fastq_align_hisat2 - "${params.aligner}" { - 'log' { - from FASTQ_ALIGN_HISAT2.out.summary - } - from FASTQ_ALIGN_HISAT2.out.orig_bam, enabled: params.save_align_intermeds - 'unmapped' { - fom FASTQ_ALIGN_HISAT2.out.fastq, enabled: params.save_unaligned - } - } - - // subworkflows/nf-core/fastq_fastqc_umitools_fastp - "${params.trimmer}" { - 'fastqc' { - from FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_html - from FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_zip - } - from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_json - from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_html - 'log' { - from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_log - } - // from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads, enabled: params.save_trimmed - from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_fail, enabled: params.save_trimmed - from FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_merged, enabled: params.save_trimmed - } - - 'umitools' { - from FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_log - // from FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_reads, enabled: params.save_umi_intermeds - } - - // subworkflows/nf-core/fastq_fastqc_umitools_trimgalore - "${params.trimmer}" { - 'fastqc' { - from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_html - from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_zip - } - from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_log - // from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_reads, enabled: params.save_trimmed - } - - 'umitools' { - from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_log - // from FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_reads, enabled: params.save_umi_intermeds - } -} - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END From 45ec2efddbf9d2b51f575907ff7ad2c2e0b2394e Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Sat, 6 Apr 2024 15:28:27 -0500 Subject: [PATCH 06/17] Fix bugs Signed-off-by: Ben Sherman --- main.nf | 9 +++++---- subworkflows/local/prepare_genome/main.nf | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/main.nf b/main.nf index 2771f993c..c6d6ef9cf 100755 --- a/main.nf +++ b/main.nf @@ -10,6 +10,7 @@ */ nextflow.enable.dsl = 2 +nextflow.preview.topic = true /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -171,12 +172,12 @@ output { // Genome preparation // 'genome' { - enabled params.save_reference + defaults enabled: params.save_reference from 'genome' } 'genome/index' { - enabled params.save_reference + defaults enabled: params.save_reference from 'genome-index' } @@ -196,7 +197,7 @@ output { } "${params.aligner}" { - enabled params.save_align_intermeds || params.save_umi_intermeds + defaults enabled: params.save_align_intermeds || params.save_umi_intermeds from 'align-intermeds' 'samtools_stats' { @@ -260,7 +261,7 @@ output { // modules/nf-core/cat/fastq 'fastq' { - enabled params.save_merged_fastq + defaults enabled: params.save_merged_fastq from 'merged-fastq' } diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index 0e1268aac..0caf4d4bb 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -82,6 +82,7 @@ workflow PREPARE_GENOME { } else { ch_gtf = Channel.value(file(gtf)) } + ch_gff = Channel.empty() } else if (gff) { if (gff.endsWith('.gz')) { ch_gff = GUNZIP_GFF ( [ [:], gff ] ).gunzip.map { it[1] } @@ -335,7 +336,7 @@ workflow PREPARE_GENOME { ch_gene_bed >> 'genome' ch_transcript_fasta >> 'genome' ch_fai >> 'genome' - ch_sizes >> 'genome' + ch_chrom_sizes >> 'genome' ch_splicesites >> 'genome-index' ch_bbsplit_index >> 'genome-index' ch_star_index >> 'genome-index' From 9af680340766aa847e9e71d7d98e61d09c2825a4 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Sat, 6 Apr 2024 15:29:23 -0500 Subject: [PATCH 07/17] Disable processes not used by test profile (temporary) Signed-off-by: Ben Sherman --- workflows/rnaseq/main.nf | 121 +++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 55 deletions(-) diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index 7892fba91..9c6b134ab 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -797,41 +797,46 @@ workflow RNASEQ { QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled >> 'align' QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'align' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bam >> 'align-intermeds' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bai >> 'align-intermeds' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.stats >> 'align-samtools-stats' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.flagstat >> 'align-samtools-stats' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.idxstats >> 'align-samtools-stats' - BAM_SORT_STATS_SAMTOOLS.out.bam >> 'align-intermeds' - BAM_SORT_STATS_SAMTOOLS.out.bai >> 'align-intermeds' - BAM_SORT_STATS_SAMTOOLS.out.stats >> 'align-intermeds-samtools-stats' - BAM_SORT_STATS_SAMTOOLS.out.flagstat >> 'align-intermeds-samtools-stats' - BAM_SORT_STATS_SAMTOOLS.out.idxstats >> 'align-intermeds-samtools-stats' - SAMTOOLS_SORT.out.bam >> 'align-intermeds' - UMITOOLS_PREPAREFORSALMON.out.bam >> 'align-intermeds' - UMITOOLS_PREPAREFORSALMON.out.log >> 'align-intermeds-umitools-log' - - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bam >> 'align-intermeds' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bai >> 'align-intermeds' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.stats >> 'align-samtools-stats' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.flagstat >> 'align-samtools-stats' - BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.idxstats >> 'align-samtools-stats' + // TODO: !params.skip_alignment && params.aligner == 'star_salmon' && params.with_umi + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bam >> 'align-intermeds' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bai >> 'align-intermeds' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.stats >> 'align-samtools-stats' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.flagstat >> 'align-samtools-stats' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.idxstats >> 'align-samtools-stats' + // BAM_SORT_STATS_SAMTOOLS.out.bam >> 'align-intermeds' + // BAM_SORT_STATS_SAMTOOLS.out.bai >> 'align-intermeds' + // BAM_SORT_STATS_SAMTOOLS.out.stats >> 'align-intermeds-samtools-stats' + // BAM_SORT_STATS_SAMTOOLS.out.flagstat >> 'align-intermeds-samtools-stats' + // BAM_SORT_STATS_SAMTOOLS.out.idxstats >> 'align-intermeds-samtools-stats' + // SAMTOOLS_SORT.out.bam >> 'align-intermeds' + // UMITOOLS_PREPAREFORSALMON.out.bam >> 'align-intermeds' + // UMITOOLS_PREPAREFORSALMON.out.log >> 'align-intermeds-umitools-log' + + // TODO: !params.skip_alignment && params.aligner in ['star_salmon', 'hisat2'] + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bam >> 'align-intermeds' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bai >> 'align-intermeds' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.stats >> 'align-samtools-stats' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.flagstat >> 'align-samtools-stats' + // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.idxstats >> 'align-samtools-stats' BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig >> 'align-bigwig' BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig >> 'align-bigwig' + // TODO: !params.skip_alignment && params.aligner == 'star_salmon' DESEQ2_QC_STAR_SALMON.out.rdata >> 'align-deseq2' DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'align-deseq2' DESEQ2_QC_STAR_SALMON.out.pdf >> 'align-deseq2' DESEQ2_QC_STAR_SALMON.out.dists_txt >> 'align-deseq2' DESEQ2_QC_STAR_SALMON.out.size_factors >> 'align-deseq2' DESEQ2_QC_STAR_SALMON.out.log >> 'align-deseq2' - DESEQ2_QC_RSEM.out.rdata >> 'align-deseq2' - DESEQ2_QC_RSEM.out.pca_txt >> 'align-deseq2' - DESEQ2_QC_RSEM.out.pdf >> 'align-deseq2' - DESEQ2_QC_RSEM.out.dists_txt >> 'align-deseq2' - DESEQ2_QC_RSEM.out.size_factors >> 'align-deseq2' - DESEQ2_QC_RSEM.out.log >> 'align-deseq2' + + // TODO: !params.skip_alignment && params.aligner == 'star_rsem' + // DESEQ2_QC_RSEM.out.rdata >> 'align-deseq2' + // DESEQ2_QC_RSEM.out.pca_txt >> 'align-deseq2' + // DESEQ2_QC_RSEM.out.pdf >> 'align-deseq2' + // DESEQ2_QC_RSEM.out.dists_txt >> 'align-deseq2' + // DESEQ2_QC_RSEM.out.size_factors >> 'align-deseq2' + // DESEQ2_QC_RSEM.out.log >> 'align-deseq2' QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene >> 'pseudo-align' QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene >> 'pseudo-align' @@ -865,13 +870,15 @@ workflow RNASEQ { MULTIQC.out.data >> 'multiqc' MULTIQC.out.plots >> 'multiqc' - PRESEQ_LCEXTRAP.out.lc_extrap >> 'align-preseq' - PRESEQ_LCEXTRAP.out.log >> 'align-preseq-log' + // TODO: !params.skip_alignment && !params.skip_qc && !params.skip_preseq + // PRESEQ_LCEXTRAP.out.lc_extrap >> 'align-preseq' + // PRESEQ_LCEXTRAP.out.log >> 'align-preseq-log' QUALIMAP_RNASEQ.out.results >> 'align-qualimap' - SORTMERNA.out.log >> 'sortmerna' - SORTMERNA.out.reads >> 'sortmerna-intermeds' + // TODO: params.remove_ribo_rna + // SORTMERNA.out.log >> 'sortmerna' + // SORTMERNA.out.reads >> 'sortmerna-intermeds' STRINGTIE_STRINGTIE.out.transcript_gtf >> 'align-stringtie' STRINGTIE_STRINGTIE.out.abundance >> 'align-stringtie' @@ -891,17 +898,18 @@ workflow RNASEQ { ALIGN_STAR.out.bam_transcript >> 'align-star-intermeds' ALIGN_STAR.out.fastq >> 'align-star-unaligned' - QUANTIFY_RSEM.out.counts_gene >> 'quantify-rsem' - QUANTIFY_RSEM.out.counts_transcript >> 'quantify-rsem' - QUANTIFY_RSEM.out.stat >> 'quantify-rsem' - QUANTIFY_RSEM.out.logs >> 'quantify-rsem-log' - QUANTIFY_RSEM.out.bam_star >> 'quantify-rsem-intermeds' - QUANTIFY_RSEM.out.bam_genome >> 'quantify-rsem-intermeds' - QUANTIFY_RSEM.out.bam_transcript >> 'quantify-rsem-intermeds' - QUANTIFY_RSEM.out.merged_counts_gene >> 'quantify-rsem' - QUANTIFY_RSEM.out.merged_tpm_gene >> 'quantify-rsem' - QUANTIFY_RSEM.out.merged_counts_transcript >> 'quantify-rsem' - QUANTIFY_RSEM.out.merged_tpm_transcript >> 'quantify-rsem' + // TODO: !params.skip_alignment && params.aligner == 'star_rsem' + // QUANTIFY_RSEM.out.counts_gene >> 'quantify-rsem' + // QUANTIFY_RSEM.out.counts_transcript >> 'quantify-rsem' + // QUANTIFY_RSEM.out.stat >> 'quantify-rsem' + // QUANTIFY_RSEM.out.logs >> 'quantify-rsem-log' + // QUANTIFY_RSEM.out.bam_star >> 'quantify-rsem-intermeds' + // QUANTIFY_RSEM.out.bam_genome >> 'quantify-rsem-intermeds' + // QUANTIFY_RSEM.out.bam_transcript >> 'quantify-rsem-intermeds' + // QUANTIFY_RSEM.out.merged_counts_gene >> 'quantify-rsem' + // QUANTIFY_RSEM.out.merged_tpm_gene >> 'quantify-rsem' + // QUANTIFY_RSEM.out.merged_counts_transcript >> 'quantify-rsem' + // QUANTIFY_RSEM.out.merged_tpm_transcript >> 'quantify-rsem' BAM_MARKDUPLICATES_PICARD.out.bam >> 'align-picard' BAM_MARKDUPLICATES_PICARD.out.bai >> 'align-picard' @@ -934,21 +942,24 @@ workflow RNASEQ { BAM_RSEQC.out.innerdistance_rscript >> 'align-rseqc-innerdistance' BAM_RSEQC.out.tin_txt >> 'align-rseqc-tin' - FASTQ_ALIGN_HISAT2.out.summary >> 'align-hisat2-log' - FASTQ_ALIGN_HISAT2.out.orig_bam >> 'align-hisat2-intermeds' - FASTQ_ALIGN_HISAT2.out.fastq >> 'align-hisat2-unaligned' - - FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_html >> 'trim-fastqc' - FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_zip >> 'trim-fastqc' - FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_json >> 'trim' - FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_html >> 'trim' - FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_log >> 'trim-log' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads >> 'trim-intermeds' - FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_fail >> 'trim-intermeds' - FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_merged >> 'trim-intermeds' - FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_log >> 'umitools' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_reads >> 'umitools-intermeds' - + // TODO: !params.skip_alignment && params.aligner == 'hisat2' + // FASTQ_ALIGN_HISAT2.out.summary >> 'align-hisat2-log' + // FASTQ_ALIGN_HISAT2.out.orig_bam >> 'align-hisat2-intermeds' + // FASTQ_ALIGN_HISAT2.out.fastq >> 'align-hisat2-unaligned' + + // TODO: params.trimmer == 'fastp' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_html >> 'trim-fastqc' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_zip >> 'trim-fastqc' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_json >> 'trim' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_html >> 'trim' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_log >> 'trim-log' + // // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads >> 'trim-intermeds' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_fail >> 'trim-intermeds' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_merged >> 'trim-intermeds' + // FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_log >> 'umitools' + // // FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_reads >> 'umitools-intermeds' + + // TODO: params.trimmer == 'trimgalore' FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_html >> 'trim-fastqc' FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_zip >> 'trim-fastqc' FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_log >> 'trim' From 635203c91b30a6bf4c36c20e88a7959287d1424b Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Sat, 6 Apr 2024 23:54:59 -0500 Subject: [PATCH 08/17] Move topic mappings to modules and subworkflows Signed-off-by: Ben Sherman --- modules/local/dupradar/main.nf | 4 +- modules/local/multiqc_custom_biotype/main.nf | 2 +- modules/nf-core/cat/fastq/main.nf | 2 +- modules/nf-core/multiqc/main.nf | 6 +- modules/nf-core/preseq/lcextrap/main.nf | 4 +- modules/nf-core/qualimap/rnaseq/main.nf | 2 +- modules/nf-core/sortmerna/main.nf | 4 +- modules/nf-core/stringtie/stringtie/main.nf | 8 +- modules/nf-core/subread/featurecounts/main.nf | 4 +- subworkflows/local/align_star/main.nf | 10 ++ subworkflows/local/quantify_rsem/main.nf | 13 ++ .../bam_dedup_stats_samtools_umitools/main.nf | 5 + .../nf-core/bam_markduplicates_picard/main.nf | 9 ++ subworkflows/nf-core/bam_rseqc/main.nf | 24 ++++ .../bedgraph_bedclip_bedgraphtobigwig/main.nf | 3 + .../nf-core/fastq_align_hisat2/main.nf | 4 + .../fastq_fastqc_umitools_fastp/main.nf | 13 ++ .../fastq_fastqc_umitools_trimgalore/main.nf | 9 ++ workflows/rnaseq/main.nf | 121 ------------------ 19 files changed, 108 insertions(+), 139 deletions(-) diff --git a/modules/local/dupradar/main.nf b/modules/local/dupradar/main.nf index 9f9152d1e..d1037458b 100644 --- a/modules/local/dupradar/main.nf +++ b/modules/local/dupradar/main.nf @@ -12,8 +12,8 @@ process DUPRADAR { path gtf output: - tuple val(meta), path("*.pdf") , emit: pdf - tuple val(meta), path("*.txt") , emit: txt + tuple val(meta), path("*.pdf") , emit: pdf , topic: 'align-dupradar' + tuple val(meta), path("*.txt") , emit: txt , topic: 'align-dupradar' tuple val(meta), path("*_mqc.txt"), emit: multiqc path "versions.yml" , emit: versions diff --git a/modules/local/multiqc_custom_biotype/main.nf b/modules/local/multiqc_custom_biotype/main.nf index 9c0fe94eb..3610adb1b 100644 --- a/modules/local/multiqc_custom_biotype/main.nf +++ b/modules/local/multiqc_custom_biotype/main.nf @@ -11,7 +11,7 @@ process MULTIQC_CUSTOM_BIOTYPE { path header output: - tuple val(meta), path("*.tsv"), emit: tsv + tuple val(meta), path("*.tsv"), emit: tsv , topic: 'align-featurecounts' path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/cat/fastq/main.nf b/modules/nf-core/cat/fastq/main.nf index f132b2adc..738986664 100644 --- a/modules/nf-core/cat/fastq/main.nf +++ b/modules/nf-core/cat/fastq/main.nf @@ -11,7 +11,7 @@ process CAT_FASTQ { tuple val(meta), path(reads, stageAs: "input*/*") output: - tuple val(meta), path("*.merged.fastq.gz"), emit: reads + tuple val(meta), path("*.merged.fastq.gz"), emit: reads , topic: 'merged-fastq' path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 354f4430f..13e5fc5e1 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -13,9 +13,9 @@ process MULTIQC { path(multiqc_logo) output: - path "*multiqc_report.html", emit: report - path "*_data" , emit: data - path "*_plots" , optional:true, emit: plots + path "*multiqc_report.html", emit: report , topic: 'multiqc' + path "*_data" , emit: data , topic: 'multiqc' + path "*_plots" , optional:true, emit: plots , topic: 'multiqc' path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/preseq/lcextrap/main.nf b/modules/nf-core/preseq/lcextrap/main.nf index ebbf215f0..6324005c8 100644 --- a/modules/nf-core/preseq/lcextrap/main.nf +++ b/modules/nf-core/preseq/lcextrap/main.nf @@ -12,8 +12,8 @@ process PRESEQ_LCEXTRAP { tuple val(meta), path(bam) output: - tuple val(meta), path("*.lc_extrap.txt"), emit: lc_extrap - tuple val(meta), path("*.log") , emit: log + tuple val(meta), path("*.lc_extrap.txt"), emit: lc_extrap , topic: 'align-preseq' + tuple val(meta), path("*.log") , emit: log , topic: 'align-preseq-log' path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/qualimap/rnaseq/main.nf b/modules/nf-core/qualimap/rnaseq/main.nf index 4411d8689..9d9a9e98f 100644 --- a/modules/nf-core/qualimap/rnaseq/main.nf +++ b/modules/nf-core/qualimap/rnaseq/main.nf @@ -12,7 +12,7 @@ process QUALIMAP_RNASEQ { tuple val(meta2), path(gtf) output: - tuple val(meta), path("${prefix}"), emit: results + tuple val(meta), path("${prefix}"), emit: results, topic: 'align-qualimap' path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/sortmerna/main.nf b/modules/nf-core/sortmerna/main.nf index 2712bf589..214f00ef8 100644 --- a/modules/nf-core/sortmerna/main.nf +++ b/modules/nf-core/sortmerna/main.nf @@ -12,8 +12,8 @@ process SORTMERNA { path fastas output: - tuple val(meta), path("*non_rRNA.fastq.gz"), emit: reads - tuple val(meta), path("*.log") , emit: log + tuple val(meta), path("*non_rRNA.fastq.gz"), emit: reads , topic: 'sortmerna-intermeds' + tuple val(meta), path("*.log") , emit: log , topic: 'sortmerna' path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/stringtie/stringtie/main.nf b/modules/nf-core/stringtie/stringtie/main.nf index 6e25ba27d..946ef2e89 100644 --- a/modules/nf-core/stringtie/stringtie/main.nf +++ b/modules/nf-core/stringtie/stringtie/main.nf @@ -12,10 +12,10 @@ process STRINGTIE_STRINGTIE { path annotation_gtf output: - tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf - tuple val(meta), path("*.abundance.txt") , emit: abundance - tuple val(meta), path("*.coverage.gtf") , optional: true, emit: coverage_gtf - tuple val(meta), path("*.ballgown") , optional: true, emit: ballgown + tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf , topic: 'align-stringtie' + tuple val(meta), path("*.abundance.txt") , emit: abundance , topic: 'align-stringtie' + tuple val(meta), path("*.coverage.gtf") , optional: true, emit: coverage_gtf , topic: 'align-stringtie' + tuple val(meta), path("*.ballgown") , optional: true, emit: ballgown , topic: 'align-stringtie' path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/subread/featurecounts/main.nf b/modules/nf-core/subread/featurecounts/main.nf index 209799622..197c12cd5 100644 --- a/modules/nf-core/subread/featurecounts/main.nf +++ b/modules/nf-core/subread/featurecounts/main.nf @@ -11,8 +11,8 @@ process SUBREAD_FEATURECOUNTS { tuple val(meta), path(bams), path(annotation) output: - tuple val(meta), path("*featureCounts.txt") , emit: counts - tuple val(meta), path("*featureCounts.txt.summary"), emit: summary + tuple val(meta), path("*featureCounts.txt") , emit: counts , topic: 'align-featurecounts' + tuple val(meta), path("*featureCounts.txt.summary"), emit: summary , topic: 'align-featurecounts' path "versions.yml" , emit: versions when: diff --git a/subworkflows/local/align_star/main.nf b/subworkflows/local/align_star/main.nf index 4f516e8e0..5c10d2a92 100644 --- a/subworkflows/local/align_star/main.nf +++ b/subworkflows/local/align_star/main.nf @@ -62,6 +62,16 @@ workflow ALIGN_STAR { BAM_SORT_STATS_SAMTOOLS ( ch_orig_bam, fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) + topic: + ch_orig_bam >> 'align-star-intermeds' + ch_log_final >> 'align-star-log' + ch_log_out >> 'align-star-log' + ch_log_progress >> 'align-star-log' + ch_bam_sorted >> 'align-star-intermeds' + ch_bam_transcript >> 'align-star-intermeds' + ch_fastq >> 'align-star-unaligned' + ch_tab >> 'align-star-log' + emit: orig_bam = ch_orig_bam // channel: [ val(meta), bam ] log_final = ch_log_final // channel: [ val(meta), log_final ] diff --git a/subworkflows/local/quantify_rsem/main.nf b/subworkflows/local/quantify_rsem/main.nf index 4b7473634..9f9d2568e 100644 --- a/subworkflows/local/quantify_rsem/main.nf +++ b/subworkflows/local/quantify_rsem/main.nf @@ -37,6 +37,19 @@ workflow QUANTIFY_RSEM { ) ch_versions = ch_versions.mix(RSEM_MERGE_COUNTS.out.versions) + topic: + RSEM_CALCULATEEXPRESSION.out.counts_gene >> 'quantify-rsem' + RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'quantify-rsem' + RSEM_CALCULATEEXPRESSION.out.stat >> 'quantify-rsem' + RSEM_CALCULATEEXPRESSION.out.logs >> 'quantify-rsem-log' + RSEM_CALCULATEEXPRESSION.out.bam_star >> 'quantify-rsem-intermeds' + RSEM_CALCULATEEXPRESSION.out.bam_genome >> 'quantify-rsem-intermeds' + RSEM_CALCULATEEXPRESSION.out.bam_transcript >> 'quantify-rsem-intermeds' + RSEM_MERGE_COUNTS.out.merged_counts_gene >> 'quantify-rsem' + RSEM_MERGE_COUNTS.out.merged_tpm_gene >> 'quantify-rsem' + RSEM_MERGE_COUNTS.out.merged_counts_transcript >> 'quantify-rsem' + RSEM_MERGE_COUNTS.out.merged_tpm_transcript >> 'quantify-rsem' + emit: counts_gene = RSEM_CALCULATEEXPRESSION.out.counts_gene // channel: [ val(meta), counts ] counts_transcript = RSEM_CALCULATEEXPRESSION.out.counts_transcript // channel: [ val(meta), counts ] diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf index 332355f40..e98096328 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf @@ -43,9 +43,14 @@ workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS { ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) topic: + UMITOOLS_DEDUP.out.bam >> 'align-intermeds' UMITOOLS_DEDUP.out.tsv_edit_distance >> 'align-umitools' UMITOOLS_DEDUP.out.tsv_per_umi >> 'align-umitools' UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'align-umitools' + SAMTOOLS_INDEX.out.bai >> 'align-intermeds' + BAM_STATS_SAMTOOLS.out.stats >> 'align-samtools-stats' + BAM_STATS_SAMTOOLS.out.flagstat >> 'align-samtools-stats' + BAM_STATS_SAMTOOLS.out.idxstats >> 'align-samtools-stats' emit: bam = UMITOOLS_DEDUP.out.bam // channel: [ val(meta), path(bam) ] diff --git a/subworkflows/nf-core/bam_markduplicates_picard/main.nf b/subworkflows/nf-core/bam_markduplicates_picard/main.nf index de8130fb5..773801c15 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/main.nf +++ b/subworkflows/nf-core/bam_markduplicates_picard/main.nf @@ -34,6 +34,15 @@ workflow BAM_MARKDUPLICATES_PICARD { BAM_STATS_SAMTOOLS ( ch_bam_bai, ch_fasta ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) + topic: + PICARD_MARKDUPLICATES.out.bam >> 'align-picard' + PICARD_MARKDUPLICATES.out.metrics >> 'align-picard-metrics' + SAMTOOLS_INDEX.out.bai >> 'align-picard' + SAMTOOLS_INDEX.out.csi >> 'align-picard' + BAM_STATS_SAMTOOLS.out.stats >> 'align-picard-stats' + BAM_STATS_SAMTOOLS.out.flagstat >> 'align-picard-stats' + BAM_STATS_SAMTOOLS.out.idxstats >> 'align-picard-stats' + emit: bam = PICARD_MARKDUPLICATES.out.bam // channel: [ val(meta), path(bam) ] metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(bam) ] diff --git a/subworkflows/nf-core/bam_rseqc/main.nf b/subworkflows/nf-core/bam_rseqc/main.nf index 043321a13..ab7b6347e 100644 --- a/subworkflows/nf-core/bam_rseqc/main.nf +++ b/subworkflows/nf-core/bam_rseqc/main.nf @@ -146,6 +146,30 @@ workflow BAM_RSEQC { versions = versions.mix(RSEQC_TIN.out.versions.first()) } + topic: + bamstat_txt >> 'align-rseqc-bamstat' + inferexperiment_txt >> 'align-rseqc-inferexperiment' + junctionannotation_pdf >> 'align-rseqc-junctionannotation' + junctionannotation_events_pdf >> 'align-rseqc-junctionannotation' + junctionannotation_bed >> 'align-rseqc-junctionannotation' + junctionannotation_interact_bed >> 'align-rseqc-junctionannotation' + junctionannotation_xls >> 'align-rseqc-junctionannotation' + junctionannotation_log >> 'align-rseqc-junctionannotation' + junctionannotation_rscript >> 'align-rseqc-junctionannotation' + junctionsaturation_pdf >> 'align-rseqc-junctionsaturation' + junctionsaturation_rscript >> 'align-rseqc-junctionsaturation' + readduplication_pdf >> 'align-rseqc-readduplication' + readduplication_seq_xls >> 'align-rseqc-readduplication' + readduplication_pos_xls >> 'align-rseqc-readduplication' + readduplication_rscript >> 'align-rseqc-readduplication' + readdistribution_txt >> 'align-rseqc-readdistribution' + innerdistance_distance >> 'align-rseqc-innerdistance' + innerdistance_freq >> 'align-rseqc-innerdistance' + innerdistance_mean >> 'align-rseqc-innerdistance' + innerdistance_pdf >> 'align-rseqc-innerdistance' + innerdistance_rscript >> 'align-rseqc-innerdistance' + tin_txt >> 'align-rseqc-tin' + emit: bamstat_txt // channel: [ val(meta), txt ] diff --git a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf index 6c3b7b0cb..f24ae0f63 100644 --- a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf +++ b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf @@ -26,6 +26,9 @@ workflow BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG { UCSC_BEDGRAPHTOBIGWIG ( UCSC_BEDCLIP.out.bedgraph, sizes ) ch_versions = ch_versions.mix(UCSC_BEDGRAPHTOBIGWIG.out.versions.first()) + topic: + UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'align-bigwig' + emit: bigwig = UCSC_BEDGRAPHTOBIGWIG.out.bigwig // channel: [ val(meta), [ bigwig ] ] bedgraph = UCSC_BEDCLIP.out.bedgraph // channel: [ val(meta), [ bedgraph ] ] diff --git a/subworkflows/nf-core/fastq_align_hisat2/main.nf b/subworkflows/nf-core/fastq_align_hisat2/main.nf index a2ec1cf5e..7751c721c 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/main.nf +++ b/subworkflows/nf-core/fastq_align_hisat2/main.nf @@ -26,6 +26,10 @@ workflow FASTQ_ALIGN_HISAT2 { BAM_SORT_STATS_SAMTOOLS ( HISAT2_ALIGN.out.bam, ch_fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) + topic: + HISAT2_ALIGN.out.bam >> 'align-hisat2-intermeds' + HISAT2_ALIGN.out.summary >> 'align-hisat2-log' + HISAT2_ALIGN.out.fastq >> 'align-hisat2-unaligned' emit: orig_bam = HISAT2_ALIGN.out.bam // channel: [ val(meta), bam ] diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf index 764ce013f..127c3c90c 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf @@ -134,6 +134,19 @@ workflow FASTQ_FASTQC_UMITOOLS_FASTP { } } + topic: + // TODO: need to recover trim_reads and umi_reads + // trim_reads >> 'trim-intermeds' + // umi_reads >> 'umitools-intermeds' + umi_log >> 'umitools' + trim_json >> 'trim' + trim_html >> 'trim' + trim_log >> 'trim-log' + trim_reads_fail >> 'trim-intermeds' + trim_reads_merged >> 'trim-intermeds' + fastqc_trim_html >> 'trim-fastqc' + fastqc_trim_zip >> 'trim-fastqc' + emit: reads = trim_reads // channel: [ val(meta), [ reads ] ] diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf index db2e5b329..f0ba343db 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf @@ -105,6 +105,15 @@ workflow FASTQ_FASTQC_UMITOOLS_TRIMGALORE { .set { trim_read_count } } + topic: + // TODO: need to recover trim_reads and umi_reads + // trim_reads >> 'trim-intermeds' + // umi_reads >> 'umitools-intermeds' + umi_log >> 'umitools' + trim_html >> 'trim-fastqc' + trim_zip >> 'trim-fastqc' + trim_log >> 'trim' + emit: reads = trim_reads // channel: [ val(meta), [ reads ] ] diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index 9c6b134ab..3e1235c51 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -798,11 +798,6 @@ workflow RNASEQ { QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'align' // TODO: !params.skip_alignment && params.aligner == 'star_salmon' && params.with_umi - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bam >> 'align-intermeds' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.bai >> 'align-intermeds' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.stats >> 'align-samtools-stats' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.flagstat >> 'align-samtools-stats' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME.out.idxstats >> 'align-samtools-stats' // BAM_SORT_STATS_SAMTOOLS.out.bam >> 'align-intermeds' // BAM_SORT_STATS_SAMTOOLS.out.bai >> 'align-intermeds' // BAM_SORT_STATS_SAMTOOLS.out.stats >> 'align-intermeds-samtools-stats' @@ -812,16 +807,6 @@ workflow RNASEQ { // UMITOOLS_PREPAREFORSALMON.out.bam >> 'align-intermeds' // UMITOOLS_PREPAREFORSALMON.out.log >> 'align-intermeds-umitools-log' - // TODO: !params.skip_alignment && params.aligner in ['star_salmon', 'hisat2'] - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bam >> 'align-intermeds' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.bai >> 'align-intermeds' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.stats >> 'align-samtools-stats' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.flagstat >> 'align-samtools-stats' - // BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_GENOME.out.idxstats >> 'align-samtools-stats' - - BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig >> 'align-bigwig' - BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig >> 'align-bigwig' - // TODO: !params.skip_alignment && params.aligner == 'star_salmon' DESEQ2_QC_STAR_SALMON.out.rdata >> 'align-deseq2' DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'align-deseq2' @@ -858,115 +843,9 @@ workflow RNASEQ { DESEQ2_QC_PSEUDO.out.size_factors >> 'pseudo-align-deseq2' DESEQ2_QC_PSEUDO.out.log >> 'pseudo-align-deseq2' - DUPRADAR.out.pdf >> 'align-dupradar' - DUPRADAR.out.txt >> 'align-dupradar' - BBMAP_BBSPLIT.out.stats >> 'bbsplit' BBMAP_BBSPLIT.out.all_fastq >> 'bbsplit-intermeds' - CAT_FASTQ.out.reads >> 'merged-fastq' - - MULTIQC.out.report >> 'multiqc' - MULTIQC.out.data >> 'multiqc' - MULTIQC.out.plots >> 'multiqc' - - // TODO: !params.skip_alignment && !params.skip_qc && !params.skip_preseq - // PRESEQ_LCEXTRAP.out.lc_extrap >> 'align-preseq' - // PRESEQ_LCEXTRAP.out.log >> 'align-preseq-log' - - QUALIMAP_RNASEQ.out.results >> 'align-qualimap' - - // TODO: params.remove_ribo_rna - // SORTMERNA.out.log >> 'sortmerna' - // SORTMERNA.out.reads >> 'sortmerna-intermeds' - - STRINGTIE_STRINGTIE.out.transcript_gtf >> 'align-stringtie' - STRINGTIE_STRINGTIE.out.abundance >> 'align-stringtie' - STRINGTIE_STRINGTIE.out.coverage_gtf >> 'align-stringtie' - STRINGTIE_STRINGTIE.out.ballgown >> 'align-stringtie' - - SUBREAD_FEATURECOUNTS.out.counts >> 'align-featurecounts' - SUBREAD_FEATURECOUNTS.out.summary >> 'align-featurecounts' - MULTIQC_CUSTOM_BIOTYPE.out.tsv >> 'align-featurecounts' - - ALIGN_STAR.out.log_final >> 'align-star-log' - ALIGN_STAR.out.log_out >> 'align-star-log' - ALIGN_STAR.out.log_progress >> 'align-star-log' - ALIGN_STAR.out.tab >> 'align-star-log' - ALIGN_STAR.out.orig_bam >> 'align-star-intermeds' - ALIGN_STAR.out.bam_sorted >> 'align-star-intermeds' - ALIGN_STAR.out.bam_transcript >> 'align-star-intermeds' - ALIGN_STAR.out.fastq >> 'align-star-unaligned' - - // TODO: !params.skip_alignment && params.aligner == 'star_rsem' - // QUANTIFY_RSEM.out.counts_gene >> 'quantify-rsem' - // QUANTIFY_RSEM.out.counts_transcript >> 'quantify-rsem' - // QUANTIFY_RSEM.out.stat >> 'quantify-rsem' - // QUANTIFY_RSEM.out.logs >> 'quantify-rsem-log' - // QUANTIFY_RSEM.out.bam_star >> 'quantify-rsem-intermeds' - // QUANTIFY_RSEM.out.bam_genome >> 'quantify-rsem-intermeds' - // QUANTIFY_RSEM.out.bam_transcript >> 'quantify-rsem-intermeds' - // QUANTIFY_RSEM.out.merged_counts_gene >> 'quantify-rsem' - // QUANTIFY_RSEM.out.merged_tpm_gene >> 'quantify-rsem' - // QUANTIFY_RSEM.out.merged_counts_transcript >> 'quantify-rsem' - // QUANTIFY_RSEM.out.merged_tpm_transcript >> 'quantify-rsem' - - BAM_MARKDUPLICATES_PICARD.out.bam >> 'align-picard' - BAM_MARKDUPLICATES_PICARD.out.bai >> 'align-picard' - BAM_MARKDUPLICATES_PICARD.out.csi >> 'align-picard' - BAM_MARKDUPLICATES_PICARD.out.metrics >> 'align-picard-metrics' - BAM_MARKDUPLICATES_PICARD.out.stats >> 'align-picard-stats' - BAM_MARKDUPLICATES_PICARD.out.flagstat >> 'align-picard-stats' - BAM_MARKDUPLICATES_PICARD.out.idxstats >> 'align-picard-stats' - - BAM_RSEQC.out.bamstat_txt >> 'align-rseqc-bamstat' - BAM_RSEQC.out.inferexperiment_txt >> 'align-rseqc-inferexperiment' - BAM_RSEQC.out.junctionannotation_pdf >> 'align-rseqc-junctionannotation' - BAM_RSEQC.out.junctionannotation_events_pdf >> 'align-rseqc-junctionannotation' - BAM_RSEQC.out.junctionannotation_bed >> 'align-rseqc-junctionannotation' - BAM_RSEQC.out.junctionannotation_interact_bed >> 'align-rseqc-junctionannotation' - BAM_RSEQC.out.junctionannotation_xls >> 'align-rseqc-junctionannotation' - BAM_RSEQC.out.junctionannotation_log >> 'align-rseqc-junctionannotation' - BAM_RSEQC.out.junctionannotation_rscript >> 'align-rseqc-junctionannotation' - BAM_RSEQC.out.junctionsaturation_pdf >> 'align-rseqc-junctionsaturation' - BAM_RSEQC.out.junctionsaturation_rscript >> 'align-rseqc-junctionsaturation' - BAM_RSEQC.out.readduplication_pdf >> 'align-rseqc-readduplication' - BAM_RSEQC.out.readduplication_seq_xls >> 'align-rseqc-readduplication' - BAM_RSEQC.out.readduplication_pos_xls >> 'align-rseqc-readduplication' - BAM_RSEQC.out.readduplication_rscript >> 'align-rseqc-readduplication' - BAM_RSEQC.out.readdistribution_txt >> 'align-rseqc-readdistribution' - BAM_RSEQC.out.innerdistance_distance >> 'align-rseqc-innerdistance' - BAM_RSEQC.out.innerdistance_freq >> 'align-rseqc-innerdistance' - BAM_RSEQC.out.innerdistance_mean >> 'align-rseqc-innerdistance' - BAM_RSEQC.out.innerdistance_pdf >> 'align-rseqc-innerdistance' - BAM_RSEQC.out.innerdistance_rscript >> 'align-rseqc-innerdistance' - BAM_RSEQC.out.tin_txt >> 'align-rseqc-tin' - - // TODO: !params.skip_alignment && params.aligner == 'hisat2' - // FASTQ_ALIGN_HISAT2.out.summary >> 'align-hisat2-log' - // FASTQ_ALIGN_HISAT2.out.orig_bam >> 'align-hisat2-intermeds' - // FASTQ_ALIGN_HISAT2.out.fastq >> 'align-hisat2-unaligned' - - // TODO: params.trimmer == 'fastp' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_html >> 'trim-fastqc' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.fastqc_trim_zip >> 'trim-fastqc' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_json >> 'trim' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_html >> 'trim' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_log >> 'trim-log' - // // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads >> 'trim-intermeds' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_fail >> 'trim-intermeds' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.trim_reads_merged >> 'trim-intermeds' - // FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_log >> 'umitools' - // // FASTQ_FASTQC_UMITOOLS_FASTP.out.umi_reads >> 'umitools-intermeds' - - // TODO: params.trimmer == 'trimgalore' - FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_html >> 'trim-fastqc' - FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_zip >> 'trim-fastqc' - FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_log >> 'trim' - // FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_reads >> 'trim-intermeds' - FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_log >> 'umitools' - // FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.umi_reads >> 'umitools-intermeds' - emit: multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] From 44af165aac32e3cf0fb0772ff9fcc89b370875aa Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Wed, 10 Apr 2024 18:04:10 -0500 Subject: [PATCH 09/17] Update based on latest prototype Signed-off-by: Ben Sherman --- main.nf | 270 +++++++----------- modules/local/deseq2_qc/main.nf | 10 + modules/local/dupradar/main.nf | 8 +- modules/local/multiqc_custom_biotype/main.nf | 5 +- modules/nf-core/cat/fastq/main.nf | 5 +- modules/nf-core/multiqc/main.nf | 11 +- modules/nf-core/preseq/lcextrap/main.nf | 8 +- modules/nf-core/qualimap/rnaseq/main.nf | 5 +- modules/nf-core/sortmerna/main.nf | 8 +- modules/nf-core/stringtie/stringtie/main.nf | 14 +- modules/nf-core/subread/featurecounts/main.nf | 8 +- subworkflows/local/align_star/main.nf | 18 +- subworkflows/local/prepare_genome/main.nf | 16 +- subworkflows/local/quantify_rsem/main.nf | 24 +- .../bam_dedup_stats_samtools_umitools/main.nf | 18 +- .../nf-core/bam_markduplicates_picard/main.nf | 16 +- subworkflows/nf-core/bam_rseqc/main.nf | 46 +-- .../bedgraph_bedclip_bedgraphtobigwig/main.nf | 4 +- .../nf-core/fastq_align_hisat2/main.nf | 8 +- .../fastq_fastqc_umitools_fastp/main.nf | 22 +- .../fastq_fastqc_umitools_trimgalore/main.nf | 14 +- workflows/rnaseq/main.nf | 115 ++++---- 22 files changed, 316 insertions(+), 337 deletions(-) diff --git a/main.nf b/main.nf index c6d6ef9cf..3e6c4a3cf 100755 --- a/main.nf +++ b/main.nf @@ -166,236 +166,168 @@ workflow { } output { - directory params.outdir, mode: params.publish_dir_mode + directory params.outdir + mode params.publish_dir_mode - // - // Genome preparation - // 'genome' { - defaults enabled: params.save_reference - from 'genome' + enabled params.save_reference } 'genome/index' { - defaults enabled: params.save_reference - from 'genome-index' + enabled params.save_reference } - // - // Alignment - // - "${params.aligner}" { - from 'align' - - 'samtools_stats' { - from 'align-samtools-stats' - } - - 'umitools' { - from 'align-umitools' - } + 'star_salmon/intermeds/' { + path 'star_salmon' + enabled params.save_align_intermeds || params.save_umi_intermeds } - "${params.aligner}" { - defaults enabled: params.save_align_intermeds || params.save_umi_intermeds - from 'align-intermeds' - - 'samtools_stats' { - from 'align-intermeds-samtools-stats' - } - 'umitools/log' { - from 'align-intermeds-umitools-log' - } + 'star_salmon/samtools_stats/intermeds/' { + path 'star_salmon/samtools_stats' + enabled params.save_align_intermeds || params.save_umi_intermeds } - // - // bigWig coverage - // - "${params.aligner}/bigwig" { - from 'align-bigwig' + 'star_salmon/umitools/log/intermeds/' { + path 'star_salmon/umitools/log' + enabled params.save_align_intermeds || params.save_umi_intermeds } - // - // DESeq2 QC - // - "${params.aligner}/deseq2_qc" { - from 'align-deseq2' - } - - // - // Pseudo-alignment - // - "${params.pseudo_aligner}" { - from 'pseudo-align' - // TODO: process 'QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' - - 'deseq2_qc' { - from 'pseudo-align-deseq2' - } + 'bigwig' { + path "${params.aligner}/bigwig" } // modules/local/dupradar - "${params.aligner}/dupradar" { - 'scatter_plot' { - from 'align-dupradar', pattern: "*Dens.pdf" - } - 'box_plot' { - from 'align-dupradar', pattern: "*Boxplot.pdf" - } - 'histogram' { - from 'align-dupradar', pattern: "*Hist.pdf" - } - 'gene_data' { - from 'align-dupradar', pattern: "*Matrix.txt" - } - 'intercepts_slope' { - from 'align-dupradar', pattern: "*slope.txt" - } + 'dupradar' { + path "${params.aligner}/dupradar" } // modules/nf-core/bbmap/bbsplit - 'bbsplit' { - from 'bbsplit' - from 'bbsplit-intermeds', enabled: params.save_bbsplit_reads + 'bbsplit/intermeds/' { + path 'bbsplit' + enabled params.save_bbsplit_reads } // modules/nf-core/cat/fastq - 'fastq' { - defaults enabled: params.save_merged_fastq - from 'merged-fastq' + 'cat/fastq' { + path 'fastq' + enabled params.save_merged_fastq } // modules/nf-core/multiqc - def multiqc_path = params.skip_alignment - ? 'multiqc' - : "multiqc/${params.aligner}" - - "${multiqc_path}" { - from 'multiqc' + 'multiqc' { + path params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}" } // modules/nf-core/preseq/lcextrap - "${params.aligner}" { - 'preseq' { - from 'preseq' - } - 'preseq/log' { - from 'preseq-log' - } + 'preseq' { + path "${params.aligner}/preseq" + } + + 'preseq/log' { + path "${params.aligner}/preseq/log" } // modules/nf-core/qualimap/rnaseq - "${params.aligner}/qualimap" { - from 'qualimap' + 'qualimap' { + path "${params.aligner}/qualimap" } // modules/nf-core/sortmerna - 'sortmerna' { - from 'sortmerna' - from 'sortmerna-intermeds', enabled: params.save_non_ribo_reads + 'sortmerna/intermeds/' { + path 'sortmerna' + enabled params.save_non_ribo_reads } // modules/nf-core/stringtie/stringtie - "${params.aligner}/stringtie" { - from 'align-stringtie' + 'stringtie' { + path "${params.aligner}/stringtie" } // modules/nf-core/subread/featurecounts - "${params.aligner}/featurecounts" { - from 'align-featurecounts' + 'featurecounts' { + path "${params.aligner}/featurecounts" } // subworkflows/local/align_star - "${params.aligner}" { - 'log' { - from 'align-star-log' - } + // 'star_salmon/intermeds/' { + // path 'star_salmon' + // enabled params.save_align_intermeds + // } - from 'align-star-intermeds' - - 'unmapped' { - from 'align-star-unaligned' - } + 'star_salmon/unmapped/' { + enabled params.save_unaligned } // subworkflows/local/quantify_rsem - "${params.aligner}" { - from 'quantify-rsem' - from 'quantify-rsem-intermeds', enabled: params.save_align_intermeds - - 'log' { - from 'quantify-rsem-log' - } + 'star_rsem/intermeds/' { + path 'star_rsem' + enabled params.save_align_intermeds } // subworkflows/nf-core/bam_markduplicates_picard - "${params.aligner}" { - from 'align-picard' - 'picard_metrics' { - from 'align-picard-metrics' - } - 'samtools_stats' { - from 'align-picard-stats' - } + 'picard/' { + path params.aligner + } + + 'picard/metrics/' { + path "${params.aligner}/picard_metrics" + } + + 'picard/samtools_stats/' { + path "${params.aligner}/samtools_stats" } // subworkflows/nf-core/bam_rseqc - "${params.aligner}/rseqc" { - 'bam_stat' { - from 'align-rseqc-bamstat' - } - 'infer_experiment' { - from 'align-rseqc-inferexperiment' - } - 'junction_annotation' { - from 'align-rseqc-junctionannotation' - } - 'junction_saturation' { - from 'align-rseqc-junctionsaturation' - } - 'read_duplication' { - from 'align-rseqc-readduplication' - } - 'read_distribution' { - from 'align-rseqc-readdistribution' - } - 'inner_distance' { - from 'align-rseqc-innerdistance' - } - 'tin' { - from 'align-rseqc-tin' - } + 'rseqc/bam_stat/' { + path "${params.aligner}/rseqc/bam_stat" + } + 'rseqc/infer_experiment/' { + path "${params.aligner}/rseqc/infer_experiment" + } + 'rseqc/junction_annotation/' { + path "${params.aligner}/rseqc/junction_annotation" + } + 'rseqc/junction_saturation/' { + path "${params.aligner}/rseqc/junction_saturation" + } + 'rseqc/read_duplication/' { + path "${params.aligner}/rseqc/read_duplication" + } + 'rseqc/read_distribution/' { + path "${params.aligner}/rseqc/read_distribution" + } + 'rseqc/inner_distance/' { + path "${params.aligner}/rseqc/inner_distance" + } + 'rseqc/tin/' { + path "${params.aligner}/rseqc/tin" } // subworkflows/nf-core/fastq_align_hisat2 - "${params.aligner}" { - 'log' { - from 'align-hisat2-log' - } - - from 'align-hisat2-intermeds', enabled: params.save_align_intermeds + 'hisat2/intermeds/' { + path 'hisat2' + enabled params.save_align_intermeds + } - 'unmapped' { - from 'align-hisat2-unaligned', enabled: params.save_unaligned - } + 'hisat2/unmapped/' { + enabled params.save_unaligned } // subworkflows/nf-core/fastq_fastqc_umitools_fastp // subworkflows/nf-core/fastq_fastqc_umitools_trimgalore - "${params.trimmer}" { - 'fastqc' { - from 'trim-fastqc' - } - from 'trim' - 'log' { - from 'trim-log' - } - from 'trim-intermeds', enabled: params.save_trimmed - } - - 'umitools' { - from 'umitools' - from 'umitools-intermeds', enabled: params.save_umi_intermeds + 'fastp/intermeds/' { + path 'fastp' + enabled params.save_trimmed + } + + 'trimgalore/intermeds/' { + path 'trimgalore' + enabled params.save_trimmed + } + + 'umitools/intermeds/' { + path 'umitools' + enabled params.save_umi_intermeds } } diff --git a/modules/local/deseq2_qc/main.nf b/modules/local/deseq2_qc/main.nf index 466194934..79e5ca3a5 100644 --- a/modules/local/deseq2_qc/main.nf +++ b/modules/local/deseq2_qc/main.nf @@ -24,6 +24,16 @@ process DESEQ2_QC { path "size_factors" , optional:true, emit: size_factors path "versions.yml" , emit: versions + publish: + pdf >> 'deseq2' + rdata >> 'deseq2' + pca_txt >> 'deseq2' + pca_multiqc >> 'deseq2' + dists_txt >> 'deseq2' + dists_multiqc >> 'deseq2' + log >> 'deseq2' + size_factors >> 'deseq2' + when: task.ext.when == null || task.ext.when diff --git a/modules/local/dupradar/main.nf b/modules/local/dupradar/main.nf index d1037458b..bebb72362 100644 --- a/modules/local/dupradar/main.nf +++ b/modules/local/dupradar/main.nf @@ -12,11 +12,15 @@ process DUPRADAR { path gtf output: - tuple val(meta), path("*.pdf") , emit: pdf , topic: 'align-dupradar' - tuple val(meta), path("*.txt") , emit: txt , topic: 'align-dupradar' + tuple val(meta), path("*.pdf") , emit: pdf + tuple val(meta), path("*.txt") , emit: txt tuple val(meta), path("*_mqc.txt"), emit: multiqc path "versions.yml" , emit: versions + publish: + pdf >> 'dupradar' + txt >> 'dupradar' + when: task.ext.when == null || task.ext.when diff --git a/modules/local/multiqc_custom_biotype/main.nf b/modules/local/multiqc_custom_biotype/main.nf index 3610adb1b..4dc79d882 100644 --- a/modules/local/multiqc_custom_biotype/main.nf +++ b/modules/local/multiqc_custom_biotype/main.nf @@ -11,9 +11,12 @@ process MULTIQC_CUSTOM_BIOTYPE { path header output: - tuple val(meta), path("*.tsv"), emit: tsv , topic: 'align-featurecounts' + tuple val(meta), path("*.tsv"), emit: tsv path "versions.yml" , emit: versions + publish: + tsv >> 'featurecounts' + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/cat/fastq/main.nf b/modules/nf-core/cat/fastq/main.nf index 738986664..e4ad8100d 100644 --- a/modules/nf-core/cat/fastq/main.nf +++ b/modules/nf-core/cat/fastq/main.nf @@ -11,9 +11,12 @@ process CAT_FASTQ { tuple val(meta), path(reads, stageAs: "input*/*") output: - tuple val(meta), path("*.merged.fastq.gz"), emit: reads , topic: 'merged-fastq' + tuple val(meta), path("*.merged.fastq.gz"), emit: reads path "versions.yml" , emit: versions + publish: + reads >> 'cat/fastq' + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 13e5fc5e1..647fbd7b2 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -13,11 +13,16 @@ process MULTIQC { path(multiqc_logo) output: - path "*multiqc_report.html", emit: report , topic: 'multiqc' - path "*_data" , emit: data , topic: 'multiqc' - path "*_plots" , optional:true, emit: plots , topic: 'multiqc' + path "*multiqc_report.html", emit: report + path "*_data" , emit: data + path "*_plots" , optional:true, emit: plots path "versions.yml" , emit: versions + publish: + report >> 'multiqc' + data >> 'multiqc' + plots >> 'multiqc' + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/preseq/lcextrap/main.nf b/modules/nf-core/preseq/lcextrap/main.nf index 6324005c8..e555c4b7c 100644 --- a/modules/nf-core/preseq/lcextrap/main.nf +++ b/modules/nf-core/preseq/lcextrap/main.nf @@ -12,10 +12,14 @@ process PRESEQ_LCEXTRAP { tuple val(meta), path(bam) output: - tuple val(meta), path("*.lc_extrap.txt"), emit: lc_extrap , topic: 'align-preseq' - tuple val(meta), path("*.log") , emit: log , topic: 'align-preseq-log' + tuple val(meta), path("*.lc_extrap.txt"), emit: lc_extrap + tuple val(meta), path("*.log") , emit: log path "versions.yml" , emit: versions + publish: + lc_extrap >> 'preseq' + log >> 'preseq/log' + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/qualimap/rnaseq/main.nf b/modules/nf-core/qualimap/rnaseq/main.nf index 9d9a9e98f..d1a40b407 100644 --- a/modules/nf-core/qualimap/rnaseq/main.nf +++ b/modules/nf-core/qualimap/rnaseq/main.nf @@ -12,9 +12,12 @@ process QUALIMAP_RNASEQ { tuple val(meta2), path(gtf) output: - tuple val(meta), path("${prefix}"), emit: results, topic: 'align-qualimap' + tuple val(meta), path("${prefix}"), emit: results path "versions.yml" , emit: versions + publish: + results >> 'qualimap' + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/sortmerna/main.nf b/modules/nf-core/sortmerna/main.nf index 214f00ef8..ad7fbdadc 100644 --- a/modules/nf-core/sortmerna/main.nf +++ b/modules/nf-core/sortmerna/main.nf @@ -12,10 +12,14 @@ process SORTMERNA { path fastas output: - tuple val(meta), path("*non_rRNA.fastq.gz"), emit: reads , topic: 'sortmerna-intermeds' - tuple val(meta), path("*.log") , emit: log , topic: 'sortmerna' + tuple val(meta), path("*non_rRNA.fastq.gz"), emit: reads + tuple val(meta), path("*.log") , emit: log path "versions.yml" , emit: versions + publish: + reads >> 'sortmerna/intermeds/' + log >> 'sortmerna/' + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/stringtie/stringtie/main.nf b/modules/nf-core/stringtie/stringtie/main.nf index 946ef2e89..022880542 100644 --- a/modules/nf-core/stringtie/stringtie/main.nf +++ b/modules/nf-core/stringtie/stringtie/main.nf @@ -12,12 +12,18 @@ process STRINGTIE_STRINGTIE { path annotation_gtf output: - tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf , topic: 'align-stringtie' - tuple val(meta), path("*.abundance.txt") , emit: abundance , topic: 'align-stringtie' - tuple val(meta), path("*.coverage.gtf") , optional: true, emit: coverage_gtf , topic: 'align-stringtie' - tuple val(meta), path("*.ballgown") , optional: true, emit: ballgown , topic: 'align-stringtie' + tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf + tuple val(meta), path("*.abundance.txt") , emit: abundance + tuple val(meta), path("*.coverage.gtf") , optional: true, emit: coverage_gtf + tuple val(meta), path("*.ballgown") , optional: true, emit: ballgown path "versions.yml" , emit: versions + publish: + transcript_gtf >> 'stringtie' + abundance >> 'stringtie' + coverage_gtf >> 'stringtie' + ballgown >> 'stringtie' + when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/subread/featurecounts/main.nf b/modules/nf-core/subread/featurecounts/main.nf index 197c12cd5..500fc4a8a 100644 --- a/modules/nf-core/subread/featurecounts/main.nf +++ b/modules/nf-core/subread/featurecounts/main.nf @@ -11,10 +11,14 @@ process SUBREAD_FEATURECOUNTS { tuple val(meta), path(bams), path(annotation) output: - tuple val(meta), path("*featureCounts.txt") , emit: counts , topic: 'align-featurecounts' - tuple val(meta), path("*featureCounts.txt.summary"), emit: summary , topic: 'align-featurecounts' + tuple val(meta), path("*featureCounts.txt") , emit: counts + tuple val(meta), path("*featureCounts.txt.summary"), emit: summary path "versions.yml" , emit: versions + publish: + counts >> 'featurecounts' + summary >> 'featurecounts' + when: task.ext.when == null || task.ext.when diff --git a/subworkflows/local/align_star/main.nf b/subworkflows/local/align_star/main.nf index 5c10d2a92..6b6f5b783 100644 --- a/subworkflows/local/align_star/main.nf +++ b/subworkflows/local/align_star/main.nf @@ -62,15 +62,15 @@ workflow ALIGN_STAR { BAM_SORT_STATS_SAMTOOLS ( ch_orig_bam, fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) - topic: - ch_orig_bam >> 'align-star-intermeds' - ch_log_final >> 'align-star-log' - ch_log_out >> 'align-star-log' - ch_log_progress >> 'align-star-log' - ch_bam_sorted >> 'align-star-intermeds' - ch_bam_transcript >> 'align-star-intermeds' - ch_fastq >> 'align-star-unaligned' - ch_tab >> 'align-star-log' + publish: + ch_orig_bam >> 'star_salmon/intermeds/' + ch_log_final >> 'star_salmon/log/' + ch_log_out >> 'star_salmon/log/' + ch_log_progress >> 'star_salmon/log/' + ch_bam_sorted >> 'star_salmon/intermeds/' + ch_bam_transcript >> 'star_salmon/intermeds/' + ch_fastq >> 'star_salmon/unmapped/' + ch_tab >> 'star_salmon/log/' emit: orig_bam = ch_orig_bam // channel: [ val(meta), bam ] diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index 0caf4d4bb..e145a4dcc 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -328,7 +328,7 @@ workflow PREPARE_GENOME { } } - topic: + publish: ch_fasta >> 'genome' ch_gtf >> 'genome' ch_gff >> 'genome' @@ -337,13 +337,13 @@ workflow PREPARE_GENOME { ch_transcript_fasta >> 'genome' ch_fai >> 'genome' ch_chrom_sizes >> 'genome' - ch_splicesites >> 'genome-index' - ch_bbsplit_index >> 'genome-index' - ch_star_index >> 'genome-index' - ch_rsem_index >> 'genome-index' - ch_hisat2_index >> 'genome-index' - ch_salmon_index >> 'genome-index' - ch_kallisto_index >> 'genome-index' + ch_splicesites >> 'genome/index' + ch_bbsplit_index >> 'genome/index' + ch_star_index >> 'genome/index' + ch_rsem_index >> 'genome/index' + ch_hisat2_index >> 'genome/index' + ch_salmon_index >> 'genome/index' + ch_kallisto_index >> 'genome/index' emit: fasta = ch_fasta // channel: path(genome.fasta) diff --git a/subworkflows/local/quantify_rsem/main.nf b/subworkflows/local/quantify_rsem/main.nf index 9f9d2568e..49ede17e4 100644 --- a/subworkflows/local/quantify_rsem/main.nf +++ b/subworkflows/local/quantify_rsem/main.nf @@ -37,18 +37,18 @@ workflow QUANTIFY_RSEM { ) ch_versions = ch_versions.mix(RSEM_MERGE_COUNTS.out.versions) - topic: - RSEM_CALCULATEEXPRESSION.out.counts_gene >> 'quantify-rsem' - RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'quantify-rsem' - RSEM_CALCULATEEXPRESSION.out.stat >> 'quantify-rsem' - RSEM_CALCULATEEXPRESSION.out.logs >> 'quantify-rsem-log' - RSEM_CALCULATEEXPRESSION.out.bam_star >> 'quantify-rsem-intermeds' - RSEM_CALCULATEEXPRESSION.out.bam_genome >> 'quantify-rsem-intermeds' - RSEM_CALCULATEEXPRESSION.out.bam_transcript >> 'quantify-rsem-intermeds' - RSEM_MERGE_COUNTS.out.merged_counts_gene >> 'quantify-rsem' - RSEM_MERGE_COUNTS.out.merged_tpm_gene >> 'quantify-rsem' - RSEM_MERGE_COUNTS.out.merged_counts_transcript >> 'quantify-rsem' - RSEM_MERGE_COUNTS.out.merged_tpm_transcript >> 'quantify-rsem' + publish: + RSEM_CALCULATEEXPRESSION.out.counts_gene >> 'star_rsem/' + RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'star_rsem/' + RSEM_CALCULATEEXPRESSION.out.stat >> 'star_rsem/' + RSEM_CALCULATEEXPRESSION.out.logs >> 'star_rsem/log/' + RSEM_CALCULATEEXPRESSION.out.bam_star >> 'star_rsem/intermeds/' + RSEM_CALCULATEEXPRESSION.out.bam_genome >> 'star_rsem/intermeds/' + RSEM_CALCULATEEXPRESSION.out.bam_transcript >> 'star_rsem/intermeds/' + RSEM_MERGE_COUNTS.out.merged_counts_gene >> 'star_rsem/' + RSEM_MERGE_COUNTS.out.merged_tpm_gene >> 'star_rsem/' + RSEM_MERGE_COUNTS.out.merged_counts_transcript >> 'star_rsem/' + RSEM_MERGE_COUNTS.out.merged_tpm_transcript >> 'star_rsem/' emit: counts_gene = RSEM_CALCULATEEXPRESSION.out.counts_gene // channel: [ val(meta), counts ] diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf index e98096328..9fb5bca9b 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf @@ -42,15 +42,15 @@ workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS { BAM_STATS_SAMTOOLS ( ch_bam_bai_dedup, [ [:], [] ] ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) - topic: - UMITOOLS_DEDUP.out.bam >> 'align-intermeds' - UMITOOLS_DEDUP.out.tsv_edit_distance >> 'align-umitools' - UMITOOLS_DEDUP.out.tsv_per_umi >> 'align-umitools' - UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'align-umitools' - SAMTOOLS_INDEX.out.bai >> 'align-intermeds' - BAM_STATS_SAMTOOLS.out.stats >> 'align-samtools-stats' - BAM_STATS_SAMTOOLS.out.flagstat >> 'align-samtools-stats' - BAM_STATS_SAMTOOLS.out.idxstats >> 'align-samtools-stats' + publish: + UMITOOLS_DEDUP.out.bam >> 'star_salmon/intermeds/' + UMITOOLS_DEDUP.out.tsv_edit_distance >> 'star_salmon/umitools/' + UMITOOLS_DEDUP.out.tsv_per_umi >> 'star_salmon/umitools/' + UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'star_salmon/umitools/' + SAMTOOLS_INDEX.out.bai >> 'star_salmon/intermeds/' + BAM_STATS_SAMTOOLS.out.stats >> 'star_salmon/samtools_stats/' + BAM_STATS_SAMTOOLS.out.flagstat >> 'star_salmon/samtools_stats/' + BAM_STATS_SAMTOOLS.out.idxstats >> 'star_salmon/samtools_stats/' emit: bam = UMITOOLS_DEDUP.out.bam // channel: [ val(meta), path(bam) ] diff --git a/subworkflows/nf-core/bam_markduplicates_picard/main.nf b/subworkflows/nf-core/bam_markduplicates_picard/main.nf index 773801c15..968bb2472 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/main.nf +++ b/subworkflows/nf-core/bam_markduplicates_picard/main.nf @@ -34,14 +34,14 @@ workflow BAM_MARKDUPLICATES_PICARD { BAM_STATS_SAMTOOLS ( ch_bam_bai, ch_fasta ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) - topic: - PICARD_MARKDUPLICATES.out.bam >> 'align-picard' - PICARD_MARKDUPLICATES.out.metrics >> 'align-picard-metrics' - SAMTOOLS_INDEX.out.bai >> 'align-picard' - SAMTOOLS_INDEX.out.csi >> 'align-picard' - BAM_STATS_SAMTOOLS.out.stats >> 'align-picard-stats' - BAM_STATS_SAMTOOLS.out.flagstat >> 'align-picard-stats' - BAM_STATS_SAMTOOLS.out.idxstats >> 'align-picard-stats' + publish: + PICARD_MARKDUPLICATES.out.bam >> 'picard/' + PICARD_MARKDUPLICATES.out.metrics >> 'picard/metrics/' + SAMTOOLS_INDEX.out.bai >> 'picard/' + SAMTOOLS_INDEX.out.csi >> 'picard/' + BAM_STATS_SAMTOOLS.out.stats >> 'picard/samtools_stats/' + BAM_STATS_SAMTOOLS.out.flagstat >> 'picard/samtools_stats/' + BAM_STATS_SAMTOOLS.out.idxstats >> 'picard/samtools_stats/' emit: bam = PICARD_MARKDUPLICATES.out.bam // channel: [ val(meta), path(bam) ] diff --git a/subworkflows/nf-core/bam_rseqc/main.nf b/subworkflows/nf-core/bam_rseqc/main.nf index ab7b6347e..62ed513f0 100644 --- a/subworkflows/nf-core/bam_rseqc/main.nf +++ b/subworkflows/nf-core/bam_rseqc/main.nf @@ -146,29 +146,29 @@ workflow BAM_RSEQC { versions = versions.mix(RSEQC_TIN.out.versions.first()) } - topic: - bamstat_txt >> 'align-rseqc-bamstat' - inferexperiment_txt >> 'align-rseqc-inferexperiment' - junctionannotation_pdf >> 'align-rseqc-junctionannotation' - junctionannotation_events_pdf >> 'align-rseqc-junctionannotation' - junctionannotation_bed >> 'align-rseqc-junctionannotation' - junctionannotation_interact_bed >> 'align-rseqc-junctionannotation' - junctionannotation_xls >> 'align-rseqc-junctionannotation' - junctionannotation_log >> 'align-rseqc-junctionannotation' - junctionannotation_rscript >> 'align-rseqc-junctionannotation' - junctionsaturation_pdf >> 'align-rseqc-junctionsaturation' - junctionsaturation_rscript >> 'align-rseqc-junctionsaturation' - readduplication_pdf >> 'align-rseqc-readduplication' - readduplication_seq_xls >> 'align-rseqc-readduplication' - readduplication_pos_xls >> 'align-rseqc-readduplication' - readduplication_rscript >> 'align-rseqc-readduplication' - readdistribution_txt >> 'align-rseqc-readdistribution' - innerdistance_distance >> 'align-rseqc-innerdistance' - innerdistance_freq >> 'align-rseqc-innerdistance' - innerdistance_mean >> 'align-rseqc-innerdistance' - innerdistance_pdf >> 'align-rseqc-innerdistance' - innerdistance_rscript >> 'align-rseqc-innerdistance' - tin_txt >> 'align-rseqc-tin' + publish: + bamstat_txt >> 'rseqc/bam_stat/' + inferexperiment_txt >> 'rseqc/infer_experiment/' + junctionannotation_pdf >> 'rseqc/junction_annotation/' + junctionannotation_events_pdf >> 'rseqc/junction_annotation/' + junctionannotation_bed >> 'rseqc/junction_annotation/' + junctionannotation_interact_bed >> 'rseqc/junction_annotation/' + junctionannotation_xls >> 'rseqc/junction_annotation/' + junctionannotation_log >> 'rseqc/junction_annotation/' + junctionannotation_rscript >> 'rseqc/junction_annotation/' + junctionsaturation_pdf >> 'rseqc/junction_saturation/' + junctionsaturation_rscript >> 'rseqc/junction_saturation/' + readduplication_pdf >> 'rseqc/read_duplication/' + readduplication_seq_xls >> 'rseqc/read_duplication/' + readduplication_pos_xls >> 'rseqc/read_duplication/' + readduplication_rscript >> 'rseqc/read_duplication/' + readdistribution_txt >> 'rseqc/read_distribution/' + innerdistance_distance >> 'rseqc/inner_distance/' + innerdistance_freq >> 'rseqc/inner_distance/' + innerdistance_mean >> 'rseqc/inner_distance/' + innerdistance_pdf >> 'rseqc/inner_distance/' + innerdistance_rscript >> 'rseqc/inner_distance/' + tin_txt >> 'rseqc/tin/' emit: bamstat_txt // channel: [ val(meta), txt ] diff --git a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf index f24ae0f63..67c03cb79 100644 --- a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf +++ b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf @@ -26,8 +26,8 @@ workflow BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG { UCSC_BEDGRAPHTOBIGWIG ( UCSC_BEDCLIP.out.bedgraph, sizes ) ch_versions = ch_versions.mix(UCSC_BEDGRAPHTOBIGWIG.out.versions.first()) - topic: - UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'align-bigwig' + publish: + UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'bigwig' emit: bigwig = UCSC_BEDGRAPHTOBIGWIG.out.bigwig // channel: [ val(meta), [ bigwig ] ] diff --git a/subworkflows/nf-core/fastq_align_hisat2/main.nf b/subworkflows/nf-core/fastq_align_hisat2/main.nf index 7751c721c..e71800cb8 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/main.nf +++ b/subworkflows/nf-core/fastq_align_hisat2/main.nf @@ -26,10 +26,10 @@ workflow FASTQ_ALIGN_HISAT2 { BAM_SORT_STATS_SAMTOOLS ( HISAT2_ALIGN.out.bam, ch_fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) - topic: - HISAT2_ALIGN.out.bam >> 'align-hisat2-intermeds' - HISAT2_ALIGN.out.summary >> 'align-hisat2-log' - HISAT2_ALIGN.out.fastq >> 'align-hisat2-unaligned' + publish: + HISAT2_ALIGN.out.bam >> 'hisat2/intermeds/' + HISAT2_ALIGN.out.summary >> 'hisat2/log/' + HISAT2_ALIGN.out.fastq >> 'hisat2/unmapped/' emit: orig_bam = HISAT2_ALIGN.out.bam // channel: [ val(meta), bam ] diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf index 127c3c90c..b7400f2a5 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf @@ -134,18 +134,18 @@ workflow FASTQ_FASTQC_UMITOOLS_FASTP { } } - topic: + publish: // TODO: need to recover trim_reads and umi_reads - // trim_reads >> 'trim-intermeds' - // umi_reads >> 'umitools-intermeds' - umi_log >> 'umitools' - trim_json >> 'trim' - trim_html >> 'trim' - trim_log >> 'trim-log' - trim_reads_fail >> 'trim-intermeds' - trim_reads_merged >> 'trim-intermeds' - fastqc_trim_html >> 'trim-fastqc' - fastqc_trim_zip >> 'trim-fastqc' + // trim_reads >> 'fastp/intermeds/' + // umi_reads >> 'umitools/intermeds/' + umi_log >> 'umitools/' + trim_json >> 'fastp/' + trim_html >> 'fastp/' + trim_log >> 'fastp/log/' + trim_reads_fail >> 'fastp/intermeds/' + trim_reads_merged >> 'fastp/intermeds/' + fastqc_trim_html >> 'fastp/fastqc/' + fastqc_trim_zip >> 'fastp/fastqc/' emit: reads = trim_reads // channel: [ val(meta), [ reads ] ] diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf index f0ba343db..1f16411a7 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf @@ -105,14 +105,14 @@ workflow FASTQ_FASTQC_UMITOOLS_TRIMGALORE { .set { trim_read_count } } - topic: + publish: // TODO: need to recover trim_reads and umi_reads - // trim_reads >> 'trim-intermeds' - // umi_reads >> 'umitools-intermeds' - umi_log >> 'umitools' - trim_html >> 'trim-fastqc' - trim_zip >> 'trim-fastqc' - trim_log >> 'trim' + // trim_reads >> 'trimgalore/intermeds/' + // umi_reads >> 'umitools/intermeds/' + umi_log >> 'umitools/' + trim_html >> 'trimgalore/fastqc/' + trim_zip >> 'trimgalore/fastqc/' + trim_log >> 'trimgalore/' emit: reads = trim_reads // channel: [ val(meta), [ reads ] ] diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index 3e1235c51..ec38b90fb 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -782,69 +782,70 @@ workflow RNASEQ { ch_multiqc_report = MULTIQC.out.report } - topic: - QUANTIFY_STAR_SALMON.out.results >> 'align' - QUANTIFY_STAR_SALMON.out.tpm_gene >> 'align' - QUANTIFY_STAR_SALMON.out.counts_gene >> 'align' - QUANTIFY_STAR_SALMON.out.lengths_gene >> 'align' - QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled >> 'align' - QUANTIFY_STAR_SALMON.out.counts_gene_scaled >> 'align' - QUANTIFY_STAR_SALMON.out.tpm_transcript >> 'align' - QUANTIFY_STAR_SALMON.out.counts_transcript >> 'align' - QUANTIFY_STAR_SALMON.out.lengths_transcript >> 'align' - QUANTIFY_STAR_SALMON.out.merged_gene_rds >> 'align' - QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled >> 'align' - QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled >> 'align' - QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'align' + publish: + QUANTIFY_STAR_SALMON.out.results >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.tpm_gene >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.counts_gene >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.lengths_gene >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.counts_gene_scaled >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.tpm_transcript >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.counts_transcript >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.lengths_transcript >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.merged_gene_rds >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'star_salmon/' // TODO: !params.skip_alignment && params.aligner == 'star_salmon' && params.with_umi - // BAM_SORT_STATS_SAMTOOLS.out.bam >> 'align-intermeds' - // BAM_SORT_STATS_SAMTOOLS.out.bai >> 'align-intermeds' - // BAM_SORT_STATS_SAMTOOLS.out.stats >> 'align-intermeds-samtools-stats' - // BAM_SORT_STATS_SAMTOOLS.out.flagstat >> 'align-intermeds-samtools-stats' - // BAM_SORT_STATS_SAMTOOLS.out.idxstats >> 'align-intermeds-samtools-stats' - // SAMTOOLS_SORT.out.bam >> 'align-intermeds' - // UMITOOLS_PREPAREFORSALMON.out.bam >> 'align-intermeds' - // UMITOOLS_PREPAREFORSALMON.out.log >> 'align-intermeds-umitools-log' + // BAM_SORT_STATS_SAMTOOLS.out.bam >> 'star_salmon/intermeds/' + // BAM_SORT_STATS_SAMTOOLS.out.bai >> 'star_salmon/intermeds/' + // BAM_SORT_STATS_SAMTOOLS.out.stats >> 'star_salmon/samtools_stats/intermeds/' + // BAM_SORT_STATS_SAMTOOLS.out.flagstat >> 'star_salmon/samtools_stats/intermeds/' + // BAM_SORT_STATS_SAMTOOLS.out.idxstats >> 'star_salmon/samtools_stats/intermeds/' + // SAMTOOLS_SORT.out.bam >> 'star_salmon/intermeds/' + // UMITOOLS_PREPAREFORSALMON.out.bam >> 'star_salmon/intermeds/' + // UMITOOLS_PREPAREFORSALMON.out.log >> 'star_salmon/umitools/log/intermeds/' // TODO: !params.skip_alignment && params.aligner == 'star_salmon' - DESEQ2_QC_STAR_SALMON.out.rdata >> 'align-deseq2' - DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'align-deseq2' - DESEQ2_QC_STAR_SALMON.out.pdf >> 'align-deseq2' - DESEQ2_QC_STAR_SALMON.out.dists_txt >> 'align-deseq2' - DESEQ2_QC_STAR_SALMON.out.size_factors >> 'align-deseq2' - DESEQ2_QC_STAR_SALMON.out.log >> 'align-deseq2' + DESEQ2_QC_STAR_SALMON.out.rdata >> 'star_salmon/deseq2_qc/' + DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'star_salmon/deseq2_qc/' + DESEQ2_QC_STAR_SALMON.out.pdf >> 'star_salmon/deseq2_qc/' + DESEQ2_QC_STAR_SALMON.out.dists_txt >> 'star_salmon/deseq2_qc/' + DESEQ2_QC_STAR_SALMON.out.size_factors >> 'star_salmon/deseq2_qc/' + DESEQ2_QC_STAR_SALMON.out.log >> 'star_salmon/deseq2_qc/' // TODO: !params.skip_alignment && params.aligner == 'star_rsem' - // DESEQ2_QC_RSEM.out.rdata >> 'align-deseq2' - // DESEQ2_QC_RSEM.out.pca_txt >> 'align-deseq2' - // DESEQ2_QC_RSEM.out.pdf >> 'align-deseq2' - // DESEQ2_QC_RSEM.out.dists_txt >> 'align-deseq2' - // DESEQ2_QC_RSEM.out.size_factors >> 'align-deseq2' - // DESEQ2_QC_RSEM.out.log >> 'align-deseq2' - - QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled >> 'pseudo-align' - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds >> 'pseudo-align' - - DESEQ2_QC_PSEUDO.out.rdata >> 'pseudo-align-deseq2' - DESEQ2_QC_PSEUDO.out.pca_txt >> 'pseudo-align-deseq2' - DESEQ2_QC_PSEUDO.out.pdf >> 'pseudo-align-deseq2' - DESEQ2_QC_PSEUDO.out.dists_txt >> 'pseudo-align-deseq2' - DESEQ2_QC_PSEUDO.out.size_factors >> 'pseudo-align-deseq2' - DESEQ2_QC_PSEUDO.out.log >> 'pseudo-align-deseq2' - - BBMAP_BBSPLIT.out.stats >> 'bbsplit' - BBMAP_BBSPLIT.out.all_fastq >> 'bbsplit-intermeds' + // DESEQ2_QC_RSEM.out.rdata >> 'star_rsem/deseq2_qc/' + // DESEQ2_QC_RSEM.out.pca_txt >> 'star_rsem/deseq2_qc/' + // DESEQ2_QC_RSEM.out.pdf >> 'star_rsem/deseq2_qc/' + // DESEQ2_QC_RSEM.out.dists_txt >> 'star_rsem/deseq2_qc/' + // DESEQ2_QC_RSEM.out.size_factors >> 'star_rsem/deseq2_qc/' + // DESEQ2_QC_RSEM.out.log >> 'star_rsem/deseq2_qc/' + + QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled >> "${params.pseudo_aligner}/" + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds >> "${params.pseudo_aligner}/" + // TODO: process 'QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' + + DESEQ2_QC_PSEUDO.out.rdata >> "${params.pseudo_aligner}/deseq2_qc/" + DESEQ2_QC_PSEUDO.out.pca_txt >> "${params.pseudo_aligner}/deseq2_qc/" + DESEQ2_QC_PSEUDO.out.pdf >> "${params.pseudo_aligner}/deseq2_qc/" + DESEQ2_QC_PSEUDO.out.dists_txt >> "${params.pseudo_aligner}/deseq2_qc/" + DESEQ2_QC_PSEUDO.out.size_factors >> "${params.pseudo_aligner}/deseq2_qc/" + DESEQ2_QC_PSEUDO.out.log >> "${params.pseudo_aligner}/deseq2_qc/" + + BBMAP_BBSPLIT.out.stats >> 'bbsplit/' + BBMAP_BBSPLIT.out.all_fastq >> 'bbsplit/intermeds/' emit: multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html From 3ee575354435267d65df37143f8febdfb7dfd250 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Wed, 10 Apr 2024 18:31:30 -0500 Subject: [PATCH 10/17] Remove topic feature flag Signed-off-by: Ben Sherman --- main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/main.nf b/main.nf index 3e6c4a3cf..f13bd07b7 100755 --- a/main.nf +++ b/main.nf @@ -10,7 +10,6 @@ */ nextflow.enable.dsl = 2 -nextflow.preview.topic = true /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 6719138f1d7e130197da09387eadfc1f241dc0d5 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Wed, 24 Apr 2024 03:23:56 -0500 Subject: [PATCH 11/17] Rename output -> publish Signed-off-by: Ben Sherman --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index f13bd07b7..72ea37542 100755 --- a/main.nf +++ b/main.nf @@ -164,7 +164,7 @@ workflow { ) } -output { +publish { directory params.outdir mode params.publish_dir_mode From 434024ed0f020f727669018b95422c64e50b4adb Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Wed, 24 Apr 2024 03:24:26 -0500 Subject: [PATCH 12/17] Redirect to null to disable publishing Signed-off-by: Ben Sherman --- main.nf | 84 ------------------- subworkflows/local/align_star/main.nf | 8 +- subworkflows/local/prepare_genome/main.nf | 30 +++---- subworkflows/local/quantify_rsem/main.nf | 6 +- .../bam_dedup_stats_samtools_umitools/main.nf | 4 +- .../nf-core/fastq_align_hisat2/main.nf | 4 +- .../fastq_fastqc_umitools_fastp/main.nf | 8 +- .../fastq_fastqc_umitools_trimgalore/main.nf | 4 +- workflows/rnaseq/main.nf | 20 +++-- 9 files changed, 43 insertions(+), 125 deletions(-) diff --git a/main.nf b/main.nf index 72ea37542..2a7ee8e07 100755 --- a/main.nf +++ b/main.nf @@ -168,29 +168,6 @@ publish { directory params.outdir mode params.publish_dir_mode - 'genome' { - enabled params.save_reference - } - - 'genome/index' { - enabled params.save_reference - } - - 'star_salmon/intermeds/' { - path 'star_salmon' - enabled params.save_align_intermeds || params.save_umi_intermeds - } - - 'star_salmon/samtools_stats/intermeds/' { - path 'star_salmon/samtools_stats' - enabled params.save_align_intermeds || params.save_umi_intermeds - } - - 'star_salmon/umitools/log/intermeds/' { - path 'star_salmon/umitools/log' - enabled params.save_align_intermeds || params.save_umi_intermeds - } - 'bigwig' { path "${params.aligner}/bigwig" } @@ -200,18 +177,6 @@ publish { path "${params.aligner}/dupradar" } - // modules/nf-core/bbmap/bbsplit - 'bbsplit/intermeds/' { - path 'bbsplit' - enabled params.save_bbsplit_reads - } - - // modules/nf-core/cat/fastq - 'cat/fastq' { - path 'fastq' - enabled params.save_merged_fastq - } - // modules/nf-core/multiqc 'multiqc' { path params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}" @@ -231,12 +196,6 @@ publish { path "${params.aligner}/qualimap" } - // modules/nf-core/sortmerna - 'sortmerna/intermeds/' { - path 'sortmerna' - enabled params.save_non_ribo_reads - } - // modules/nf-core/stringtie/stringtie 'stringtie' { path "${params.aligner}/stringtie" @@ -247,22 +206,6 @@ publish { path "${params.aligner}/featurecounts" } - // subworkflows/local/align_star - // 'star_salmon/intermeds/' { - // path 'star_salmon' - // enabled params.save_align_intermeds - // } - - 'star_salmon/unmapped/' { - enabled params.save_unaligned - } - - // subworkflows/local/quantify_rsem - 'star_rsem/intermeds/' { - path 'star_rsem' - enabled params.save_align_intermeds - } - // subworkflows/nf-core/bam_markduplicates_picard 'picard/' { path params.aligner @@ -301,33 +244,6 @@ publish { 'rseqc/tin/' { path "${params.aligner}/rseqc/tin" } - - // subworkflows/nf-core/fastq_align_hisat2 - 'hisat2/intermeds/' { - path 'hisat2' - enabled params.save_align_intermeds - } - - 'hisat2/unmapped/' { - enabled params.save_unaligned - } - - // subworkflows/nf-core/fastq_fastqc_umitools_fastp - // subworkflows/nf-core/fastq_fastqc_umitools_trimgalore - 'fastp/intermeds/' { - path 'fastp' - enabled params.save_trimmed - } - - 'trimgalore/intermeds/' { - path 'trimgalore' - enabled params.save_trimmed - } - - 'umitools/intermeds/' { - path 'umitools' - enabled params.save_umi_intermeds - } } /* diff --git a/subworkflows/local/align_star/main.nf b/subworkflows/local/align_star/main.nf index 6b6f5b783..dc448370a 100644 --- a/subworkflows/local/align_star/main.nf +++ b/subworkflows/local/align_star/main.nf @@ -63,13 +63,13 @@ workflow ALIGN_STAR { ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) publish: - ch_orig_bam >> 'star_salmon/intermeds/' + ch_orig_bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) ch_log_final >> 'star_salmon/log/' ch_log_out >> 'star_salmon/log/' ch_log_progress >> 'star_salmon/log/' - ch_bam_sorted >> 'star_salmon/intermeds/' - ch_bam_transcript >> 'star_salmon/intermeds/' - ch_fastq >> 'star_salmon/unmapped/' + ch_bam_sorted >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + ch_bam_transcript >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + ch_fastq >> (params.save_unaligned ? 'star_salmon/unmapped/' : null) ch_tab >> 'star_salmon/log/' emit: diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index e145a4dcc..ee827eb4a 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -329,21 +329,21 @@ workflow PREPARE_GENOME { } publish: - ch_fasta >> 'genome' - ch_gtf >> 'genome' - ch_gff >> 'genome' - ch_add_fasta >> 'genome' - ch_gene_bed >> 'genome' - ch_transcript_fasta >> 'genome' - ch_fai >> 'genome' - ch_chrom_sizes >> 'genome' - ch_splicesites >> 'genome/index' - ch_bbsplit_index >> 'genome/index' - ch_star_index >> 'genome/index' - ch_rsem_index >> 'genome/index' - ch_hisat2_index >> 'genome/index' - ch_salmon_index >> 'genome/index' - ch_kallisto_index >> 'genome/index' + ch_fasta >> (params.save_reference ? 'genome' : null) + ch_gtf >> (params.save_reference ? 'genome' : null) + ch_gff >> (params.save_reference ? 'genome' : null) + ch_add_fasta >> (params.save_reference ? 'genome' : null) + ch_gene_bed >> (params.save_reference ? 'genome' : null) + ch_transcript_fasta >> (params.save_reference ? 'genome' : null) + ch_fai >> (params.save_reference ? 'genome' : null) + ch_chrom_sizes >> (params.save_reference ? 'genome' : null) + ch_splicesites >> (params.save_reference ? 'genome/index' : null) + ch_bbsplit_index >> (params.save_reference ? 'genome/index' : null) + ch_star_index >> (params.save_reference ? 'genome/index' : null) + ch_rsem_index >> (params.save_reference ? 'genome/index' : null) + ch_hisat2_index >> (params.save_reference ? 'genome/index' : null) + ch_salmon_index >> (params.save_reference ? 'genome/index' : null) + ch_kallisto_index >> (params.save_reference ? 'genome/index' : null) emit: fasta = ch_fasta // channel: path(genome.fasta) diff --git a/subworkflows/local/quantify_rsem/main.nf b/subworkflows/local/quantify_rsem/main.nf index 49ede17e4..9870761c9 100644 --- a/subworkflows/local/quantify_rsem/main.nf +++ b/subworkflows/local/quantify_rsem/main.nf @@ -42,9 +42,9 @@ workflow QUANTIFY_RSEM { RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'star_rsem/' RSEM_CALCULATEEXPRESSION.out.stat >> 'star_rsem/' RSEM_CALCULATEEXPRESSION.out.logs >> 'star_rsem/log/' - RSEM_CALCULATEEXPRESSION.out.bam_star >> 'star_rsem/intermeds/' - RSEM_CALCULATEEXPRESSION.out.bam_genome >> 'star_rsem/intermeds/' - RSEM_CALCULATEEXPRESSION.out.bam_transcript >> 'star_rsem/intermeds/' + RSEM_CALCULATEEXPRESSION.out.bam_star >> (params.save_align_intermeds ? 'star_rsem/' : null) + RSEM_CALCULATEEXPRESSION.out.bam_genome >> (params.save_align_intermeds ? 'star_rsem/' : null) + RSEM_CALCULATEEXPRESSION.out.bam_transcript >> (params.save_align_intermeds ? 'star_rsem/' : null) RSEM_MERGE_COUNTS.out.merged_counts_gene >> 'star_rsem/' RSEM_MERGE_COUNTS.out.merged_tpm_gene >> 'star_rsem/' RSEM_MERGE_COUNTS.out.merged_counts_transcript >> 'star_rsem/' diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf index 9fb5bca9b..8e7635e87 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf @@ -43,11 +43,11 @@ workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS { ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) publish: - UMITOOLS_DEDUP.out.bam >> 'star_salmon/intermeds/' + UMITOOLS_DEDUP.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) UMITOOLS_DEDUP.out.tsv_edit_distance >> 'star_salmon/umitools/' UMITOOLS_DEDUP.out.tsv_per_umi >> 'star_salmon/umitools/' UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'star_salmon/umitools/' - SAMTOOLS_INDEX.out.bai >> 'star_salmon/intermeds/' + SAMTOOLS_INDEX.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) BAM_STATS_SAMTOOLS.out.stats >> 'star_salmon/samtools_stats/' BAM_STATS_SAMTOOLS.out.flagstat >> 'star_salmon/samtools_stats/' BAM_STATS_SAMTOOLS.out.idxstats >> 'star_salmon/samtools_stats/' diff --git a/subworkflows/nf-core/fastq_align_hisat2/main.nf b/subworkflows/nf-core/fastq_align_hisat2/main.nf index e71800cb8..bbaa0fe1b 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/main.nf +++ b/subworkflows/nf-core/fastq_align_hisat2/main.nf @@ -27,9 +27,9 @@ workflow FASTQ_ALIGN_HISAT2 { ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) publish: - HISAT2_ALIGN.out.bam >> 'hisat2/intermeds/' + HISAT2_ALIGN.out.bam >> (params.save_align_intermeds ? 'hisat2/' : null) HISAT2_ALIGN.out.summary >> 'hisat2/log/' - HISAT2_ALIGN.out.fastq >> 'hisat2/unmapped/' + HISAT2_ALIGN.out.fastq >> (params.save_unaligned ? 'hisat2/unmapped/' : null) emit: orig_bam = HISAT2_ALIGN.out.bam // channel: [ val(meta), bam ] diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf index b7400f2a5..105e90f14 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf @@ -136,14 +136,14 @@ workflow FASTQ_FASTQC_UMITOOLS_FASTP { publish: // TODO: need to recover trim_reads and umi_reads - // trim_reads >> 'fastp/intermeds/' - // umi_reads >> 'umitools/intermeds/' + // trim_reads >> (params.save_trimmed ? 'fastp/intermeds/' : null) + // umi_reads >> (params.save_umi_intermeds ? 'umitools/' : null) umi_log >> 'umitools/' trim_json >> 'fastp/' trim_html >> 'fastp/' trim_log >> 'fastp/log/' - trim_reads_fail >> 'fastp/intermeds/' - trim_reads_merged >> 'fastp/intermeds/' + trim_reads_fail >> (params.save_trimmed ? 'fastp/intermeds/' : null) + trim_reads_merged >> (params.save_trimmed ? 'fastp/intermeds/' : null) fastqc_trim_html >> 'fastp/fastqc/' fastqc_trim_zip >> 'fastp/fastqc/' diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf index 1f16411a7..a76d70614 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf @@ -107,8 +107,8 @@ workflow FASTQ_FASTQC_UMITOOLS_TRIMGALORE { publish: // TODO: need to recover trim_reads and umi_reads - // trim_reads >> 'trimgalore/intermeds/' - // umi_reads >> 'umitools/intermeds/' + // trim_reads >> (params.save_trimmed ? 'trimgalore/' : null) + // umi_reads >> (params.save_umi_intermeds ? 'umitools/' : null) umi_log >> 'umitools/' trim_html >> 'trimgalore/fastqc/' trim_zip >> 'trimgalore/fastqc/' diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index ec38b90fb..f6e51b1b4 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -798,14 +798,14 @@ workflow RNASEQ { QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'star_salmon/' // TODO: !params.skip_alignment && params.aligner == 'star_salmon' && params.with_umi - // BAM_SORT_STATS_SAMTOOLS.out.bam >> 'star_salmon/intermeds/' - // BAM_SORT_STATS_SAMTOOLS.out.bai >> 'star_salmon/intermeds/' - // BAM_SORT_STATS_SAMTOOLS.out.stats >> 'star_salmon/samtools_stats/intermeds/' - // BAM_SORT_STATS_SAMTOOLS.out.flagstat >> 'star_salmon/samtools_stats/intermeds/' - // BAM_SORT_STATS_SAMTOOLS.out.idxstats >> 'star_salmon/samtools_stats/intermeds/' - // SAMTOOLS_SORT.out.bam >> 'star_salmon/intermeds/' - // UMITOOLS_PREPAREFORSALMON.out.bam >> 'star_salmon/intermeds/' - // UMITOOLS_PREPAREFORSALMON.out.log >> 'star_salmon/umitools/log/intermeds/' + // BAM_SORT_STATS_SAMTOOLS.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + // BAM_SORT_STATS_SAMTOOLS.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + // BAM_SORT_STATS_SAMTOOLS.out.stats >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats/' : null) + // BAM_SORT_STATS_SAMTOOLS.out.flagstat >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats/' : null) + // BAM_SORT_STATS_SAMTOOLS.out.idxstats >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats/' : null) + // SAMTOOLS_SORT.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + // UMITOOLS_PREPAREFORSALMON.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + // UMITOOLS_PREPAREFORSALMON.out.log >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/umitools/log/' : null) // TODO: !params.skip_alignment && params.aligner == 'star_salmon' DESEQ2_QC_STAR_SALMON.out.rdata >> 'star_salmon/deseq2_qc/' @@ -845,7 +845,9 @@ workflow RNASEQ { DESEQ2_QC_PSEUDO.out.log >> "${params.pseudo_aligner}/deseq2_qc/" BBMAP_BBSPLIT.out.stats >> 'bbsplit/' - BBMAP_BBSPLIT.out.all_fastq >> 'bbsplit/intermeds/' + BBMAP_BBSPLIT.out.all_fastq >> (params.save_bbsplit_reads ? 'bbsplit/' : null) + CAT_FASTQ.out.reads >> (params.save_merged_fastq ? 'fastq/' : null) + SORTMERNA.out.reads >> (params.save_non_ribo_reads ? 'sortmerna/' : null) emit: multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html From bd3d6eddb7684ce1b780d26f7ebfe919f6c59bc1 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Mon, 29 Apr 2024 17:56:50 -0500 Subject: [PATCH 13/17] Move path renames from publish block to workflow publish section Signed-off-by: Ben Sherman --- main.nf | 77 ------------------- modules/local/dupradar/main.nf | 4 +- modules/local/multiqc_custom_biotype/main.nf | 2 +- modules/nf-core/multiqc/main.nf | 6 +- modules/nf-core/preseq/lcextrap/main.nf | 4 +- modules/nf-core/qualimap/rnaseq/main.nf | 2 +- modules/nf-core/stringtie/stringtie/main.nf | 8 +- modules/nf-core/subread/featurecounts/main.nf | 4 +- .../bedgraph_bedclip_bedgraphtobigwig/main.nf | 2 +- workflows/rnaseq/main.nf | 20 +++++ 10 files changed, 36 insertions(+), 93 deletions(-) diff --git a/main.nf b/main.nf index 2a7ee8e07..7e25d02a2 100755 --- a/main.nf +++ b/main.nf @@ -167,83 +167,6 @@ workflow { publish { directory params.outdir mode params.publish_dir_mode - - 'bigwig' { - path "${params.aligner}/bigwig" - } - - // modules/local/dupradar - 'dupradar' { - path "${params.aligner}/dupradar" - } - - // modules/nf-core/multiqc - 'multiqc' { - path params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}" - } - - // modules/nf-core/preseq/lcextrap - 'preseq' { - path "${params.aligner}/preseq" - } - - 'preseq/log' { - path "${params.aligner}/preseq/log" - } - - // modules/nf-core/qualimap/rnaseq - 'qualimap' { - path "${params.aligner}/qualimap" - } - - // modules/nf-core/stringtie/stringtie - 'stringtie' { - path "${params.aligner}/stringtie" - } - - // modules/nf-core/subread/featurecounts - 'featurecounts' { - path "${params.aligner}/featurecounts" - } - - // subworkflows/nf-core/bam_markduplicates_picard - 'picard/' { - path params.aligner - } - - 'picard/metrics/' { - path "${params.aligner}/picard_metrics" - } - - 'picard/samtools_stats/' { - path "${params.aligner}/samtools_stats" - } - - // subworkflows/nf-core/bam_rseqc - 'rseqc/bam_stat/' { - path "${params.aligner}/rseqc/bam_stat" - } - 'rseqc/infer_experiment/' { - path "${params.aligner}/rseqc/infer_experiment" - } - 'rseqc/junction_annotation/' { - path "${params.aligner}/rseqc/junction_annotation" - } - 'rseqc/junction_saturation/' { - path "${params.aligner}/rseqc/junction_saturation" - } - 'rseqc/read_duplication/' { - path "${params.aligner}/rseqc/read_duplication" - } - 'rseqc/read_distribution/' { - path "${params.aligner}/rseqc/read_distribution" - } - 'rseqc/inner_distance/' { - path "${params.aligner}/rseqc/inner_distance" - } - 'rseqc/tin/' { - path "${params.aligner}/rseqc/tin" - } } /* diff --git a/modules/local/dupradar/main.nf b/modules/local/dupradar/main.nf index bebb72362..63656d9f2 100644 --- a/modules/local/dupradar/main.nf +++ b/modules/local/dupradar/main.nf @@ -18,8 +18,8 @@ process DUPRADAR { path "versions.yml" , emit: versions publish: - pdf >> 'dupradar' - txt >> 'dupradar' + pdf >> 'dupradar/' + txt >> 'dupradar/' when: task.ext.when == null || task.ext.when diff --git a/modules/local/multiqc_custom_biotype/main.nf b/modules/local/multiqc_custom_biotype/main.nf index 4dc79d882..c30dd9b79 100644 --- a/modules/local/multiqc_custom_biotype/main.nf +++ b/modules/local/multiqc_custom_biotype/main.nf @@ -15,7 +15,7 @@ process MULTIQC_CUSTOM_BIOTYPE { path "versions.yml" , emit: versions publish: - tsv >> 'featurecounts' + tsv >> 'featurecounts/' when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 647fbd7b2..aa82e3848 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -19,9 +19,9 @@ process MULTIQC { path "versions.yml" , emit: versions publish: - report >> 'multiqc' - data >> 'multiqc' - plots >> 'multiqc' + report >> 'multiqc/' + data >> 'multiqc/' + plots >> 'multiqc/' when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/preseq/lcextrap/main.nf b/modules/nf-core/preseq/lcextrap/main.nf index e555c4b7c..64a967a5d 100644 --- a/modules/nf-core/preseq/lcextrap/main.nf +++ b/modules/nf-core/preseq/lcextrap/main.nf @@ -17,8 +17,8 @@ process PRESEQ_LCEXTRAP { path "versions.yml" , emit: versions publish: - lc_extrap >> 'preseq' - log >> 'preseq/log' + lc_extrap >> 'preseq/' + log >> 'preseq/log/' when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/qualimap/rnaseq/main.nf b/modules/nf-core/qualimap/rnaseq/main.nf index d1a40b407..3f22f1f67 100644 --- a/modules/nf-core/qualimap/rnaseq/main.nf +++ b/modules/nf-core/qualimap/rnaseq/main.nf @@ -16,7 +16,7 @@ process QUALIMAP_RNASEQ { path "versions.yml" , emit: versions publish: - results >> 'qualimap' + results >> 'qualimap/' when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/stringtie/stringtie/main.nf b/modules/nf-core/stringtie/stringtie/main.nf index 022880542..6b8cec26f 100644 --- a/modules/nf-core/stringtie/stringtie/main.nf +++ b/modules/nf-core/stringtie/stringtie/main.nf @@ -19,10 +19,10 @@ process STRINGTIE_STRINGTIE { path "versions.yml" , emit: versions publish: - transcript_gtf >> 'stringtie' - abundance >> 'stringtie' - coverage_gtf >> 'stringtie' - ballgown >> 'stringtie' + transcript_gtf >> 'stringtie/' + abundance >> 'stringtie/' + coverage_gtf >> 'stringtie/' + ballgown >> 'stringtie/' when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/subread/featurecounts/main.nf b/modules/nf-core/subread/featurecounts/main.nf index 500fc4a8a..7fe8aa35c 100644 --- a/modules/nf-core/subread/featurecounts/main.nf +++ b/modules/nf-core/subread/featurecounts/main.nf @@ -16,8 +16,8 @@ process SUBREAD_FEATURECOUNTS { path "versions.yml" , emit: versions publish: - counts >> 'featurecounts' - summary >> 'featurecounts' + counts >> 'featurecounts/' + summary >> 'featurecounts/' when: task.ext.when == null || task.ext.when diff --git a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf index 67c03cb79..a55fe7e5d 100644 --- a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf +++ b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf @@ -27,7 +27,7 @@ workflow BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG { ch_versions = ch_versions.mix(UCSC_BEDGRAPHTOBIGWIG.out.versions.first()) publish: - UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'bigwig' + UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'bigwig/' emit: bigwig = UCSC_BEDGRAPHTOBIGWIG.out.bigwig // channel: [ val(meta), [ bigwig ] ] diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index f6e51b1b4..c50181dc4 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -849,6 +849,26 @@ workflow RNASEQ { CAT_FASTQ.out.reads >> (params.save_merged_fastq ? 'fastq/' : null) SORTMERNA.out.reads >> (params.save_non_ribo_reads ? 'sortmerna/' : null) + 'bigwig/' >> "${params.aligner}/bigwig/" + 'dupradar/' >> "${params.aligner}/dupradar/" + 'multiqc/' >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") + 'preseq/' >> "${params.aligner}/preseq/" + 'preseq/log/' >> "${params.aligner}/preseq/log/" + 'qualimap/' >> "${params.aligner}/qualimap/" + 'stringtie/' >> "${params.aligner}/stringtie/" + 'featurecounts/' >> "${params.aligner}/featurecounts/" + 'picard/' >> "${params.aligner}/" + 'picard/metrics/' >> "${params.aligner}/picard_metrics/" + 'picard/samtools_stats/' >> "${params.aligner}/samtools_stats/" + 'rseqc/bam_stat/' >> "${params.aligner}/rseqc/bam_stat/" + 'rseqc/infer_experiment/' >> "${params.aligner}/rseqc/infer_experiment/" + 'rseqc/junction_annotation/' >> "${params.aligner}/rseqc/junction_annotation/" + 'rseqc/junction_saturation/' >> "${params.aligner}/rseqc/junction_saturation/" + 'rseqc/read_duplication/' >> "${params.aligner}/rseqc/read_duplication/" + 'rseqc/read_distribution/' >> "${params.aligner}/rseqc/read_distribution/" + 'rseqc/inner_distance/' >> "${params.aligner}/rseqc/inner_distance/" + 'rseqc/tin/' >> "${params.aligner}/rseqc/tin/" + emit: multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] From 54b1f6fa65da67cd2ce90b4b8c3ccc3ca2770b34 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Wed, 1 May 2024 14:33:09 -0500 Subject: [PATCH 14/17] Revert target renaming, re-map channels instead Signed-off-by: Ben Sherman --- main.nf | 1 + workflows/rnaseq/main.nf | 76 +++++++++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 21 deletions(-) diff --git a/main.nf b/main.nf index 7e25d02a2..8688f447f 100755 --- a/main.nf +++ b/main.nf @@ -10,6 +10,7 @@ */ nextflow.enable.dsl = 2 +nextflow.preview.publish = true /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index c50181dc4..4a4f68eb2 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -847,27 +847,61 @@ workflow RNASEQ { BBMAP_BBSPLIT.out.stats >> 'bbsplit/' BBMAP_BBSPLIT.out.all_fastq >> (params.save_bbsplit_reads ? 'bbsplit/' : null) CAT_FASTQ.out.reads >> (params.save_merged_fastq ? 'fastq/' : null) - SORTMERNA.out.reads >> (params.save_non_ribo_reads ? 'sortmerna/' : null) - - 'bigwig/' >> "${params.aligner}/bigwig/" - 'dupradar/' >> "${params.aligner}/dupradar/" - 'multiqc/' >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") - 'preseq/' >> "${params.aligner}/preseq/" - 'preseq/log/' >> "${params.aligner}/preseq/log/" - 'qualimap/' >> "${params.aligner}/qualimap/" - 'stringtie/' >> "${params.aligner}/stringtie/" - 'featurecounts/' >> "${params.aligner}/featurecounts/" - 'picard/' >> "${params.aligner}/" - 'picard/metrics/' >> "${params.aligner}/picard_metrics/" - 'picard/samtools_stats/' >> "${params.aligner}/samtools_stats/" - 'rseqc/bam_stat/' >> "${params.aligner}/rseqc/bam_stat/" - 'rseqc/infer_experiment/' >> "${params.aligner}/rseqc/infer_experiment/" - 'rseqc/junction_annotation/' >> "${params.aligner}/rseqc/junction_annotation/" - 'rseqc/junction_saturation/' >> "${params.aligner}/rseqc/junction_saturation/" - 'rseqc/read_duplication/' >> "${params.aligner}/rseqc/read_duplication/" - 'rseqc/read_distribution/' >> "${params.aligner}/rseqc/read_distribution/" - 'rseqc/inner_distance/' >> "${params.aligner}/rseqc/inner_distance/" - 'rseqc/tin/' >> "${params.aligner}/rseqc/tin/" + + // TODO: params.remove_ribo_rna + // SORTMERNA.out.reads >> (params.save_non_ribo_reads ? 'sortmerna/' : null) + + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig >> "${params.aligner}/bigwig/" + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig >> "${params.aligner}/bigwig/" + DUPRADAR.out.pdf >> "${params.aligner}/dupradar/" + DUPRADAR.out.txt >> "${params.aligner}/dupradar/" + MULTIQC.out.report >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") + MULTIQC.out.data >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") + MULTIQC.out.plots >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") + + // TODO: !params.skip_alignment && !params.skip_qc && !params.skip_preseq + // PRESEQ_LCEXTRAP.out.lc_extrap >> "${params.aligner}/preseq/" + // PRESEQ_LCEXTRAP.out.log >> "${params.aligner}/preseq/log/" + + QUALIMAP_RNASEQ.out.results >> "${params.aligner}/qualimap/" + STRINGTIE_STRINGTIE.out.transcript_gtf >> "${params.aligner}/stringtie/" + STRINGTIE_STRINGTIE.out.abundance >> "${params.aligner}/stringtie/" + STRINGTIE_STRINGTIE.out.coverage_gtf >> "${params.aligner}/stringtie/" + STRINGTIE_STRINGTIE.out.ballgown >> "${params.aligner}/stringtie/" + MULTIQC_CUSTOM_BIOTYPE.out.tsv >> "${params.aligner}/featurecounts/" + SUBREAD_FEATURECOUNTS.out.counts >> "${params.aligner}/featurecounts/" + SUBREAD_FEATURECOUNTS.out.summary >> "${params.aligner}/featurecounts/" + + BAM_MARKDUPLICATES_PICARD.out.bam >> "${params.aligner}/" + BAM_MARKDUPLICATES_PICARD.out.bai >> "${params.aligner}/" + BAM_MARKDUPLICATES_PICARD.out.csi >> "${params.aligner}/" + BAM_MARKDUPLICATES_PICARD.out.metrics >> "${params.aligner}/picard_metrics/" + BAM_MARKDUPLICATES_PICARD.out.stats >> "${params.aligner}/samtools_stats/" + BAM_MARKDUPLICATES_PICARD.out.flagstat >> "${params.aligner}/samtools_stats/" + BAM_MARKDUPLICATES_PICARD.out.idxstats >> "${params.aligner}/samtools_stats/" + + BAM_RSEQC.out.bamstat_txt >> "${params.aligner}/rseqc/bam_stat/" + BAM_RSEQC.out.inferexperiment_txt >> "${params.aligner}/rseqc/infer_experiment/" + BAM_RSEQC.out.junctionannotation_pdf >> "${params.aligner}/rseqc/junction_annotation/" + BAM_RSEQC.out.junctionannotation_events_pdf >> "${params.aligner}/rseqc/junction_annotation/" + BAM_RSEQC.out.junctionannotation_bed >> "${params.aligner}/rseqc/junction_annotation/" + BAM_RSEQC.out.junctionannotation_interact_bed >> "${params.aligner}/rseqc/junction_annotation/" + BAM_RSEQC.out.junctionannotation_xls >> "${params.aligner}/rseqc/junction_annotation/" + BAM_RSEQC.out.junctionannotation_log >> "${params.aligner}/rseqc/junction_annotation/" + BAM_RSEQC.out.junctionannotation_rscript >> "${params.aligner}/rseqc/junction_annotation/" + BAM_RSEQC.out.junctionsaturation_pdf >> "${params.aligner}/rseqc/junction_saturation/" + BAM_RSEQC.out.junctionsaturation_rscript >> "${params.aligner}/rseqc/junction_saturation/" + BAM_RSEQC.out.readduplication_pdf >> "${params.aligner}/rseqc/read_duplication/" + BAM_RSEQC.out.readduplication_seq_xls >> "${params.aligner}/rseqc/read_duplication/" + BAM_RSEQC.out.readduplication_pos_xls >> "${params.aligner}/rseqc/read_duplication/" + BAM_RSEQC.out.readduplication_rscript >> "${params.aligner}/rseqc/read_duplication/" + BAM_RSEQC.out.readdistribution_txt >> "${params.aligner}/rseqc/read_distribution/" + BAM_RSEQC.out.innerdistance_distance >> "${params.aligner}/rseqc/inner_distance/" + BAM_RSEQC.out.innerdistance_freq >> "${params.aligner}/rseqc/inner_distance/" + BAM_RSEQC.out.innerdistance_mean >> "${params.aligner}/rseqc/inner_distance/" + BAM_RSEQC.out.innerdistance_pdf >> "${params.aligner}/rseqc/inner_distance/" + BAM_RSEQC.out.innerdistance_rscript >> "${params.aligner}/rseqc/inner_distance/" + BAM_RSEQC.out.tin_txt >> "${params.aligner}/rseqc/tin/" emit: multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html From a8248d3d1bf896072005b73a7fcc1d5a8d5af95b Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Thu, 2 May 2024 18:17:27 -0500 Subject: [PATCH 15/17] Rename publish -> output Signed-off-by: Ben Sherman --- main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.nf b/main.nf index 8688f447f..3ca777c6a 100755 --- a/main.nf +++ b/main.nf @@ -10,7 +10,7 @@ */ nextflow.enable.dsl = 2 -nextflow.preview.publish = true +nextflow.preview.output = true /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -165,7 +165,7 @@ workflow { ) } -publish { +output { directory params.outdir mode params.publish_dir_mode } From 3cd5a89ac7c98e35656c6f1b3e3d0230605ea0de Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Mon, 23 Sep 2024 00:45:29 -0500 Subject: [PATCH 16/17] Update to second preview Signed-off-by: Ben Sherman --- main.nf | 5 - modules/local/deseq2_qc/main.nf | 10 - modules/local/dupradar/main.nf | 4 - modules/local/multiqc_custom_biotype/main.nf | 3 - modules/nf-core/cat/fastq/main.nf | 3 - modules/nf-core/multiqc/main.nf | 5 - modules/nf-core/preseq/lcextrap/main.nf | 4 - modules/nf-core/qualimap/rnaseq/main.nf | 3 - modules/nf-core/sortmerna/main.nf | 4 - modules/nf-core/stringtie/stringtie/main.nf | 6 - modules/nf-core/subread/featurecounts/main.nf | 4 - nextflow.config | 3 + subworkflows/local/align_star/main.nf | 20 +- subworkflows/local/prepare_genome/main.nf | 32 +-- subworkflows/local/quantify_rsem/main.nf | 26 +-- .../bam_dedup_stats_samtools_umitools/main.nf | 20 +- .../nf-core/bam_markduplicates_picard/main.nf | 18 +- subworkflows/nf-core/bam_rseqc/main.nf | 48 ++-- .../bedgraph_bedclip_bedgraphtobigwig/main.nf | 6 +- .../nf-core/fastq_align_hisat2/main.nf | 10 +- .../fastq_fastqc_umitools_trimgalore/main.nf | 18 +- workflows/rnaseq/main.nf | 218 +++++++++--------- 22 files changed, 211 insertions(+), 259 deletions(-) diff --git a/main.nf b/main.nf index 3ca777c6a..fe86d24f6 100755 --- a/main.nf +++ b/main.nf @@ -165,11 +165,6 @@ workflow { ) } -output { - directory params.outdir - mode params.publish_dir_mode -} - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END diff --git a/modules/local/deseq2_qc/main.nf b/modules/local/deseq2_qc/main.nf index 79e5ca3a5..466194934 100644 --- a/modules/local/deseq2_qc/main.nf +++ b/modules/local/deseq2_qc/main.nf @@ -24,16 +24,6 @@ process DESEQ2_QC { path "size_factors" , optional:true, emit: size_factors path "versions.yml" , emit: versions - publish: - pdf >> 'deseq2' - rdata >> 'deseq2' - pca_txt >> 'deseq2' - pca_multiqc >> 'deseq2' - dists_txt >> 'deseq2' - dists_multiqc >> 'deseq2' - log >> 'deseq2' - size_factors >> 'deseq2' - when: task.ext.when == null || task.ext.when diff --git a/modules/local/dupradar/main.nf b/modules/local/dupradar/main.nf index 63656d9f2..9f9152d1e 100644 --- a/modules/local/dupradar/main.nf +++ b/modules/local/dupradar/main.nf @@ -17,10 +17,6 @@ process DUPRADAR { tuple val(meta), path("*_mqc.txt"), emit: multiqc path "versions.yml" , emit: versions - publish: - pdf >> 'dupradar/' - txt >> 'dupradar/' - when: task.ext.when == null || task.ext.when diff --git a/modules/local/multiqc_custom_biotype/main.nf b/modules/local/multiqc_custom_biotype/main.nf index c30dd9b79..9c0fe94eb 100644 --- a/modules/local/multiqc_custom_biotype/main.nf +++ b/modules/local/multiqc_custom_biotype/main.nf @@ -14,9 +14,6 @@ process MULTIQC_CUSTOM_BIOTYPE { tuple val(meta), path("*.tsv"), emit: tsv path "versions.yml" , emit: versions - publish: - tsv >> 'featurecounts/' - when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/cat/fastq/main.nf b/modules/nf-core/cat/fastq/main.nf index e4ad8100d..f132b2adc 100644 --- a/modules/nf-core/cat/fastq/main.nf +++ b/modules/nf-core/cat/fastq/main.nf @@ -14,9 +14,6 @@ process CAT_FASTQ { tuple val(meta), path("*.merged.fastq.gz"), emit: reads path "versions.yml" , emit: versions - publish: - reads >> 'cat/fastq' - when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index aa82e3848..354f4430f 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -18,11 +18,6 @@ process MULTIQC { path "*_plots" , optional:true, emit: plots path "versions.yml" , emit: versions - publish: - report >> 'multiqc/' - data >> 'multiqc/' - plots >> 'multiqc/' - when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/preseq/lcextrap/main.nf b/modules/nf-core/preseq/lcextrap/main.nf index 64a967a5d..ebbf215f0 100644 --- a/modules/nf-core/preseq/lcextrap/main.nf +++ b/modules/nf-core/preseq/lcextrap/main.nf @@ -16,10 +16,6 @@ process PRESEQ_LCEXTRAP { tuple val(meta), path("*.log") , emit: log path "versions.yml" , emit: versions - publish: - lc_extrap >> 'preseq/' - log >> 'preseq/log/' - when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/qualimap/rnaseq/main.nf b/modules/nf-core/qualimap/rnaseq/main.nf index 3f22f1f67..4411d8689 100644 --- a/modules/nf-core/qualimap/rnaseq/main.nf +++ b/modules/nf-core/qualimap/rnaseq/main.nf @@ -15,9 +15,6 @@ process QUALIMAP_RNASEQ { tuple val(meta), path("${prefix}"), emit: results path "versions.yml" , emit: versions - publish: - results >> 'qualimap/' - when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/sortmerna/main.nf b/modules/nf-core/sortmerna/main.nf index ad7fbdadc..2712bf589 100644 --- a/modules/nf-core/sortmerna/main.nf +++ b/modules/nf-core/sortmerna/main.nf @@ -16,10 +16,6 @@ process SORTMERNA { tuple val(meta), path("*.log") , emit: log path "versions.yml" , emit: versions - publish: - reads >> 'sortmerna/intermeds/' - log >> 'sortmerna/' - when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/stringtie/stringtie/main.nf b/modules/nf-core/stringtie/stringtie/main.nf index 6b8cec26f..6e25ba27d 100644 --- a/modules/nf-core/stringtie/stringtie/main.nf +++ b/modules/nf-core/stringtie/stringtie/main.nf @@ -18,12 +18,6 @@ process STRINGTIE_STRINGTIE { tuple val(meta), path("*.ballgown") , optional: true, emit: ballgown path "versions.yml" , emit: versions - publish: - transcript_gtf >> 'stringtie/' - abundance >> 'stringtie/' - coverage_gtf >> 'stringtie/' - ballgown >> 'stringtie/' - when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/subread/featurecounts/main.nf b/modules/nf-core/subread/featurecounts/main.nf index 7fe8aa35c..209799622 100644 --- a/modules/nf-core/subread/featurecounts/main.nf +++ b/modules/nf-core/subread/featurecounts/main.nf @@ -15,10 +15,6 @@ process SUBREAD_FEATURECOUNTS { tuple val(meta), path("*featureCounts.txt.summary"), emit: summary path "versions.yml" , emit: versions - publish: - counts >> 'featurecounts/' - summary >> 'featurecounts/' - when: task.ext.when == null || task.ext.when diff --git a/nextflow.config b/nextflow.config index 3b4823eac..9664eabdf 100644 --- a/nextflow.config +++ b/nextflow.config @@ -135,6 +135,9 @@ params { } +outputDir = params.outdir +workflow.output.mode = params.publish_dir_mode + // Load base.config by default for all pipelines includeConfig 'conf/base.config' diff --git a/subworkflows/local/align_star/main.nf b/subworkflows/local/align_star/main.nf index dc448370a..a49402760 100644 --- a/subworkflows/local/align_star/main.nf +++ b/subworkflows/local/align_star/main.nf @@ -62,16 +62,6 @@ workflow ALIGN_STAR { BAM_SORT_STATS_SAMTOOLS ( ch_orig_bam, fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) - publish: - ch_orig_bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - ch_log_final >> 'star_salmon/log/' - ch_log_out >> 'star_salmon/log/' - ch_log_progress >> 'star_salmon/log/' - ch_bam_sorted >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - ch_bam_transcript >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - ch_fastq >> (params.save_unaligned ? 'star_salmon/unmapped/' : null) - ch_tab >> 'star_salmon/log/' - emit: orig_bam = ch_orig_bam // channel: [ val(meta), bam ] log_final = ch_log_final // channel: [ val(meta), log_final ] @@ -90,4 +80,14 @@ workflow ALIGN_STAR { idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] versions = ch_versions // channel: [ versions.yml ] + + publish: + ch_orig_bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + ch_log_final >> 'star_salmon/log/' + ch_log_out >> 'star_salmon/log/' + ch_log_progress >> 'star_salmon/log/' + ch_bam_sorted >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + ch_bam_transcript >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + ch_fastq >> (params.save_unaligned ? 'star_salmon/unmapped/' : null) + ch_tab >> 'star_salmon/log/' } diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index ee827eb4a..f30bd6caf 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -328,6 +328,22 @@ workflow PREPARE_GENOME { } } + emit: + fasta = ch_fasta // channel: path(genome.fasta) + gtf = ch_gtf // channel: path(genome.gtf) + fai = ch_fai // channel: path(genome.fai) + gene_bed = ch_gene_bed // channel: path(gene.bed) + transcript_fasta = ch_transcript_fasta // channel: path(transcript.fasta) + chrom_sizes = ch_chrom_sizes // channel: path(genome.sizes) + splicesites = ch_splicesites // channel: path(genome.splicesites.txt) + bbsplit_index = ch_bbsplit_index // channel: path(bbsplit/index/) + star_index = ch_star_index // channel: path(star/index/) + rsem_index = ch_rsem_index // channel: path(rsem/index/) + hisat2_index = ch_hisat2_index // channel: path(hisat2/index/) + salmon_index = ch_salmon_index // channel: path(salmon/index/) + kallisto_index = ch_kallisto_index // channel: [ meta, path(kallisto/index/) ] + versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] + publish: ch_fasta >> (params.save_reference ? 'genome' : null) ch_gtf >> (params.save_reference ? 'genome' : null) @@ -344,20 +360,4 @@ workflow PREPARE_GENOME { ch_hisat2_index >> (params.save_reference ? 'genome/index' : null) ch_salmon_index >> (params.save_reference ? 'genome/index' : null) ch_kallisto_index >> (params.save_reference ? 'genome/index' : null) - - emit: - fasta = ch_fasta // channel: path(genome.fasta) - gtf = ch_gtf // channel: path(genome.gtf) - fai = ch_fai // channel: path(genome.fai) - gene_bed = ch_gene_bed // channel: path(gene.bed) - transcript_fasta = ch_transcript_fasta // channel: path(transcript.fasta) - chrom_sizes = ch_chrom_sizes // channel: path(genome.sizes) - splicesites = ch_splicesites // channel: path(genome.splicesites.txt) - bbsplit_index = ch_bbsplit_index // channel: path(bbsplit/index/) - star_index = ch_star_index // channel: path(star/index/) - rsem_index = ch_rsem_index // channel: path(rsem/index/) - hisat2_index = ch_hisat2_index // channel: path(hisat2/index/) - salmon_index = ch_salmon_index // channel: path(salmon/index/) - kallisto_index = ch_kallisto_index // channel: [ meta, path(kallisto/index/) ] - versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] } diff --git a/subworkflows/local/quantify_rsem/main.nf b/subworkflows/local/quantify_rsem/main.nf index 9870761c9..6701967c6 100644 --- a/subworkflows/local/quantify_rsem/main.nf +++ b/subworkflows/local/quantify_rsem/main.nf @@ -37,19 +37,6 @@ workflow QUANTIFY_RSEM { ) ch_versions = ch_versions.mix(RSEM_MERGE_COUNTS.out.versions) - publish: - RSEM_CALCULATEEXPRESSION.out.counts_gene >> 'star_rsem/' - RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'star_rsem/' - RSEM_CALCULATEEXPRESSION.out.stat >> 'star_rsem/' - RSEM_CALCULATEEXPRESSION.out.logs >> 'star_rsem/log/' - RSEM_CALCULATEEXPRESSION.out.bam_star >> (params.save_align_intermeds ? 'star_rsem/' : null) - RSEM_CALCULATEEXPRESSION.out.bam_genome >> (params.save_align_intermeds ? 'star_rsem/' : null) - RSEM_CALCULATEEXPRESSION.out.bam_transcript >> (params.save_align_intermeds ? 'star_rsem/' : null) - RSEM_MERGE_COUNTS.out.merged_counts_gene >> 'star_rsem/' - RSEM_MERGE_COUNTS.out.merged_tpm_gene >> 'star_rsem/' - RSEM_MERGE_COUNTS.out.merged_counts_transcript >> 'star_rsem/' - RSEM_MERGE_COUNTS.out.merged_tpm_transcript >> 'star_rsem/' - emit: counts_gene = RSEM_CALCULATEEXPRESSION.out.counts_gene // channel: [ val(meta), counts ] counts_transcript = RSEM_CALCULATEEXPRESSION.out.counts_transcript // channel: [ val(meta), counts ] @@ -72,4 +59,17 @@ workflow QUANTIFY_RSEM { merged_tpm_transcript = RSEM_MERGE_COUNTS.out.tpm_transcript // path: *.transcript_tpm.tsv versions = ch_versions // channel: [ versions.yml ] + + publish: + RSEM_CALCULATEEXPRESSION.out.counts_gene >> 'star_rsem/' + RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'star_rsem/' + RSEM_CALCULATEEXPRESSION.out.stat >> 'star_rsem/' + RSEM_CALCULATEEXPRESSION.out.logs >> 'star_rsem/log/' + RSEM_CALCULATEEXPRESSION.out.bam_star >> (params.save_align_intermeds ? 'star_rsem/' : null) + RSEM_CALCULATEEXPRESSION.out.bam_genome >> (params.save_align_intermeds ? 'star_rsem/' : null) + RSEM_CALCULATEEXPRESSION.out.bam_transcript >> (params.save_align_intermeds ? 'star_rsem/' : null) + RSEM_MERGE_COUNTS.out.merged_counts_gene >> 'star_rsem/' + RSEM_MERGE_COUNTS.out.merged_tpm_gene >> 'star_rsem/' + RSEM_MERGE_COUNTS.out.merged_counts_transcript >> 'star_rsem/' + RSEM_MERGE_COUNTS.out.merged_tpm_transcript >> 'star_rsem/' } diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf index 8e7635e87..42b554a11 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf @@ -42,16 +42,6 @@ workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS { BAM_STATS_SAMTOOLS ( ch_bam_bai_dedup, [ [:], [] ] ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) - publish: - UMITOOLS_DEDUP.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - UMITOOLS_DEDUP.out.tsv_edit_distance >> 'star_salmon/umitools/' - UMITOOLS_DEDUP.out.tsv_per_umi >> 'star_salmon/umitools/' - UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'star_salmon/umitools/' - SAMTOOLS_INDEX.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - BAM_STATS_SAMTOOLS.out.stats >> 'star_salmon/samtools_stats/' - BAM_STATS_SAMTOOLS.out.flagstat >> 'star_salmon/samtools_stats/' - BAM_STATS_SAMTOOLS.out.idxstats >> 'star_salmon/samtools_stats/' - emit: bam = UMITOOLS_DEDUP.out.bam // channel: [ val(meta), path(bam) ] @@ -62,4 +52,14 @@ workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS { idxstats = BAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] versions = ch_versions // channel: [ path(versions.yml) ] + + publish: + UMITOOLS_DEDUP.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + UMITOOLS_DEDUP.out.tsv_edit_distance >> 'star_salmon/umitools/' + UMITOOLS_DEDUP.out.tsv_per_umi >> 'star_salmon/umitools/' + UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'star_salmon/umitools/' + SAMTOOLS_INDEX.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) + BAM_STATS_SAMTOOLS.out.stats >> 'star_salmon/samtools_stats/' + BAM_STATS_SAMTOOLS.out.flagstat >> 'star_salmon/samtools_stats/' + BAM_STATS_SAMTOOLS.out.idxstats >> 'star_salmon/samtools_stats/' } diff --git a/subworkflows/nf-core/bam_markduplicates_picard/main.nf b/subworkflows/nf-core/bam_markduplicates_picard/main.nf index 968bb2472..271f880a1 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/main.nf +++ b/subworkflows/nf-core/bam_markduplicates_picard/main.nf @@ -34,15 +34,6 @@ workflow BAM_MARKDUPLICATES_PICARD { BAM_STATS_SAMTOOLS ( ch_bam_bai, ch_fasta ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) - publish: - PICARD_MARKDUPLICATES.out.bam >> 'picard/' - PICARD_MARKDUPLICATES.out.metrics >> 'picard/metrics/' - SAMTOOLS_INDEX.out.bai >> 'picard/' - SAMTOOLS_INDEX.out.csi >> 'picard/' - BAM_STATS_SAMTOOLS.out.stats >> 'picard/samtools_stats/' - BAM_STATS_SAMTOOLS.out.flagstat >> 'picard/samtools_stats/' - BAM_STATS_SAMTOOLS.out.idxstats >> 'picard/samtools_stats/' - emit: bam = PICARD_MARKDUPLICATES.out.bam // channel: [ val(meta), path(bam) ] metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(bam) ] @@ -54,4 +45,13 @@ workflow BAM_MARKDUPLICATES_PICARD { idxstats = BAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] versions = ch_versions // channel: [ versions.yml ] + + publish: + PICARD_MARKDUPLICATES.out.bam >> 'picard/' + PICARD_MARKDUPLICATES.out.metrics >> 'picard/metrics/' + SAMTOOLS_INDEX.out.bai >> 'picard/' + SAMTOOLS_INDEX.out.csi >> 'picard/' + BAM_STATS_SAMTOOLS.out.stats >> 'picard/samtools_stats/' + BAM_STATS_SAMTOOLS.out.flagstat >> 'picard/samtools_stats/' + BAM_STATS_SAMTOOLS.out.idxstats >> 'picard/samtools_stats/' } diff --git a/subworkflows/nf-core/bam_rseqc/main.nf b/subworkflows/nf-core/bam_rseqc/main.nf index 62ed513f0..69f553367 100644 --- a/subworkflows/nf-core/bam_rseqc/main.nf +++ b/subworkflows/nf-core/bam_rseqc/main.nf @@ -146,30 +146,6 @@ workflow BAM_RSEQC { versions = versions.mix(RSEQC_TIN.out.versions.first()) } - publish: - bamstat_txt >> 'rseqc/bam_stat/' - inferexperiment_txt >> 'rseqc/infer_experiment/' - junctionannotation_pdf >> 'rseqc/junction_annotation/' - junctionannotation_events_pdf >> 'rseqc/junction_annotation/' - junctionannotation_bed >> 'rseqc/junction_annotation/' - junctionannotation_interact_bed >> 'rseqc/junction_annotation/' - junctionannotation_xls >> 'rseqc/junction_annotation/' - junctionannotation_log >> 'rseqc/junction_annotation/' - junctionannotation_rscript >> 'rseqc/junction_annotation/' - junctionsaturation_pdf >> 'rseqc/junction_saturation/' - junctionsaturation_rscript >> 'rseqc/junction_saturation/' - readduplication_pdf >> 'rseqc/read_duplication/' - readduplication_seq_xls >> 'rseqc/read_duplication/' - readduplication_pos_xls >> 'rseqc/read_duplication/' - readduplication_rscript >> 'rseqc/read_duplication/' - readdistribution_txt >> 'rseqc/read_distribution/' - innerdistance_distance >> 'rseqc/inner_distance/' - innerdistance_freq >> 'rseqc/inner_distance/' - innerdistance_mean >> 'rseqc/inner_distance/' - innerdistance_pdf >> 'rseqc/inner_distance/' - innerdistance_rscript >> 'rseqc/inner_distance/' - tin_txt >> 'rseqc/tin/' - emit: bamstat_txt // channel: [ val(meta), txt ] @@ -206,4 +182,28 @@ workflow BAM_RSEQC { tin_txt // channel: [ val(meta), txt ] versions // channel: [ versions.yml ] + + publish: + bamstat_txt >> 'rseqc/bam_stat/' + inferexperiment_txt >> 'rseqc/infer_experiment/' + junctionannotation_pdf >> 'rseqc/junction_annotation/' + junctionannotation_events_pdf >> 'rseqc/junction_annotation/' + junctionannotation_bed >> 'rseqc/junction_annotation/' + junctionannotation_interact_bed >> 'rseqc/junction_annotation/' + junctionannotation_xls >> 'rseqc/junction_annotation/' + junctionannotation_log >> 'rseqc/junction_annotation/' + junctionannotation_rscript >> 'rseqc/junction_annotation/' + junctionsaturation_pdf >> 'rseqc/junction_saturation/' + junctionsaturation_rscript >> 'rseqc/junction_saturation/' + readduplication_pdf >> 'rseqc/read_duplication/' + readduplication_seq_xls >> 'rseqc/read_duplication/' + readduplication_pos_xls >> 'rseqc/read_duplication/' + readduplication_rscript >> 'rseqc/read_duplication/' + readdistribution_txt >> 'rseqc/read_distribution/' + innerdistance_distance >> 'rseqc/inner_distance/' + innerdistance_freq >> 'rseqc/inner_distance/' + innerdistance_mean >> 'rseqc/inner_distance/' + innerdistance_pdf >> 'rseqc/inner_distance/' + innerdistance_rscript >> 'rseqc/inner_distance/' + tin_txt >> 'rseqc/tin/' } diff --git a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf index a55fe7e5d..29e4747ac 100644 --- a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf +++ b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf @@ -26,12 +26,12 @@ workflow BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG { UCSC_BEDGRAPHTOBIGWIG ( UCSC_BEDCLIP.out.bedgraph, sizes ) ch_versions = ch_versions.mix(UCSC_BEDGRAPHTOBIGWIG.out.versions.first()) - publish: - UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'bigwig/' - emit: bigwig = UCSC_BEDGRAPHTOBIGWIG.out.bigwig // channel: [ val(meta), [ bigwig ] ] bedgraph = UCSC_BEDCLIP.out.bedgraph // channel: [ val(meta), [ bedgraph ] ] versions = ch_versions // channel: [ versions.yml ] + + publish: + UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'bigwig/' } diff --git a/subworkflows/nf-core/fastq_align_hisat2/main.nf b/subworkflows/nf-core/fastq_align_hisat2/main.nf index bbaa0fe1b..64465cdfa 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/main.nf +++ b/subworkflows/nf-core/fastq_align_hisat2/main.nf @@ -26,11 +26,6 @@ workflow FASTQ_ALIGN_HISAT2 { BAM_SORT_STATS_SAMTOOLS ( HISAT2_ALIGN.out.bam, ch_fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) - publish: - HISAT2_ALIGN.out.bam >> (params.save_align_intermeds ? 'hisat2/' : null) - HISAT2_ALIGN.out.summary >> 'hisat2/log/' - HISAT2_ALIGN.out.fastq >> (params.save_unaligned ? 'hisat2/unmapped/' : null) - emit: orig_bam = HISAT2_ALIGN.out.bam // channel: [ val(meta), bam ] summary = HISAT2_ALIGN.out.summary // channel: [ val(meta), log ] @@ -44,5 +39,10 @@ workflow FASTQ_ALIGN_HISAT2 { idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] versions = ch_versions // channel: [ versions.yml ] + + publish: + HISAT2_ALIGN.out.bam >> (params.save_align_intermeds ? 'hisat2/' : null) + HISAT2_ALIGN.out.summary >> 'hisat2/log/' + HISAT2_ALIGN.out.fastq >> (params.save_unaligned ? 'hisat2/unmapped/' : null) } diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf index a76d70614..9a3cd1a29 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf @@ -105,15 +105,6 @@ workflow FASTQ_FASTQC_UMITOOLS_TRIMGALORE { .set { trim_read_count } } - publish: - // TODO: need to recover trim_reads and umi_reads - // trim_reads >> (params.save_trimmed ? 'trimgalore/' : null) - // umi_reads >> (params.save_umi_intermeds ? 'umitools/' : null) - umi_log >> 'umitools/' - trim_html >> 'trimgalore/fastqc/' - trim_zip >> 'trimgalore/fastqc/' - trim_log >> 'trimgalore/' - emit: reads = trim_reads // channel: [ val(meta), [ reads ] ] @@ -129,4 +120,13 @@ workflow FASTQ_FASTQC_UMITOOLS_TRIMGALORE { trim_read_count // channel: [ val(meta), val(count) ] versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] + + publish: + // TODO: need to recover trim_reads and umi_reads + // trim_reads >> (params.save_trimmed ? 'trimgalore/' : null) + // umi_reads >> (params.save_umi_intermeds ? 'umitools/' : null) + umi_log >> 'umitools/' + trim_html >> 'trimgalore/fastqc/' + trim_zip >> 'trimgalore/fastqc/' + trim_log >> 'trimgalore/' } diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index 4a4f68eb2..b3b4c5d36 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -782,130 +782,130 @@ workflow RNASEQ { ch_multiqc_report = MULTIQC.out.report } + emit: + multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html + versions = ch_versions // channel: [ path(versions.yml) ] + publish: - QUANTIFY_STAR_SALMON.out.results >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.tpm_gene >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.counts_gene >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.lengths_gene >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.counts_gene_scaled >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.tpm_transcript >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.counts_transcript >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.lengths_transcript >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.merged_gene_rds >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled >> 'star_salmon/' - QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'star_salmon/' + QUANTIFY_STAR_SALMON.out.results >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.tpm_gene >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.counts_gene >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.lengths_gene >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.counts_gene_scaled >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.tpm_transcript >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.counts_transcript >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.lengths_transcript >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.merged_gene_rds >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'star_salmon' // TODO: !params.skip_alignment && params.aligner == 'star_salmon' && params.with_umi - // BAM_SORT_STATS_SAMTOOLS.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - // BAM_SORT_STATS_SAMTOOLS.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - // BAM_SORT_STATS_SAMTOOLS.out.stats >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats/' : null) - // BAM_SORT_STATS_SAMTOOLS.out.flagstat >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats/' : null) - // BAM_SORT_STATS_SAMTOOLS.out.idxstats >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats/' : null) - // SAMTOOLS_SORT.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - // UMITOOLS_PREPAREFORSALMON.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - // UMITOOLS_PREPAREFORSALMON.out.log >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/umitools/log/' : null) + // BAM_SORT_STATS_SAMTOOLS.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + // BAM_SORT_STATS_SAMTOOLS.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + // BAM_SORT_STATS_SAMTOOLS.out.stats >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats' : null) + // BAM_SORT_STATS_SAMTOOLS.out.flagstat >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats' : null) + // BAM_SORT_STATS_SAMTOOLS.out.idxstats >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/samtools_stats' : null) + // SAMTOOLS_SORT.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + // UMITOOLS_PREPAREFORSALMON.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + // UMITOOLS_PREPAREFORSALMON.out.log >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/umitools/log' : null) // TODO: !params.skip_alignment && params.aligner == 'star_salmon' - DESEQ2_QC_STAR_SALMON.out.rdata >> 'star_salmon/deseq2_qc/' - DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'star_salmon/deseq2_qc/' - DESEQ2_QC_STAR_SALMON.out.pdf >> 'star_salmon/deseq2_qc/' - DESEQ2_QC_STAR_SALMON.out.dists_txt >> 'star_salmon/deseq2_qc/' - DESEQ2_QC_STAR_SALMON.out.size_factors >> 'star_salmon/deseq2_qc/' - DESEQ2_QC_STAR_SALMON.out.log >> 'star_salmon/deseq2_qc/' + DESEQ2_QC_STAR_SALMON.out.rdata >> 'star_salmon/deseq2_qc' + DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'star_salmon/deseq2_qc' + DESEQ2_QC_STAR_SALMON.out.pdf >> 'star_salmon/deseq2_qc' + DESEQ2_QC_STAR_SALMON.out.dists_txt >> 'star_salmon/deseq2_qc' + DESEQ2_QC_STAR_SALMON.out.size_factors >> 'star_salmon/deseq2_qc' + DESEQ2_QC_STAR_SALMON.out.log >> 'star_salmon/deseq2_qc' // TODO: !params.skip_alignment && params.aligner == 'star_rsem' - // DESEQ2_QC_RSEM.out.rdata >> 'star_rsem/deseq2_qc/' - // DESEQ2_QC_RSEM.out.pca_txt >> 'star_rsem/deseq2_qc/' - // DESEQ2_QC_RSEM.out.pdf >> 'star_rsem/deseq2_qc/' - // DESEQ2_QC_RSEM.out.dists_txt >> 'star_rsem/deseq2_qc/' - // DESEQ2_QC_RSEM.out.size_factors >> 'star_rsem/deseq2_qc/' - // DESEQ2_QC_RSEM.out.log >> 'star_rsem/deseq2_qc/' - - QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled >> "${params.pseudo_aligner}/" - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds >> "${params.pseudo_aligner}/" + // DESEQ2_QC_RSEM.out.rdata >> 'star_rsem/deseq2_qc' + // DESEQ2_QC_RSEM.out.pca_txt >> 'star_rsem/deseq2_qc' + // DESEQ2_QC_RSEM.out.pdf >> 'star_rsem/deseq2_qc' + // DESEQ2_QC_RSEM.out.dists_txt >> 'star_rsem/deseq2_qc' + // DESEQ2_QC_RSEM.out.size_factors >> 'star_rsem/deseq2_qc' + // DESEQ2_QC_RSEM.out.log >> 'star_rsem/deseq2_qc' + + QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds >> params.pseudo_aligner // TODO: process 'QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' - DESEQ2_QC_PSEUDO.out.rdata >> "${params.pseudo_aligner}/deseq2_qc/" - DESEQ2_QC_PSEUDO.out.pca_txt >> "${params.pseudo_aligner}/deseq2_qc/" - DESEQ2_QC_PSEUDO.out.pdf >> "${params.pseudo_aligner}/deseq2_qc/" - DESEQ2_QC_PSEUDO.out.dists_txt >> "${params.pseudo_aligner}/deseq2_qc/" - DESEQ2_QC_PSEUDO.out.size_factors >> "${params.pseudo_aligner}/deseq2_qc/" - DESEQ2_QC_PSEUDO.out.log >> "${params.pseudo_aligner}/deseq2_qc/" + DESEQ2_QC_PSEUDO.out.rdata >> "${params.pseudo_aligner}/deseq2_qc" + DESEQ2_QC_PSEUDO.out.pca_txt >> "${params.pseudo_aligner}/deseq2_qc" + DESEQ2_QC_PSEUDO.out.pdf >> "${params.pseudo_aligner}/deseq2_qc" + DESEQ2_QC_PSEUDO.out.dists_txt >> "${params.pseudo_aligner}/deseq2_qc" + DESEQ2_QC_PSEUDO.out.size_factors >> "${params.pseudo_aligner}/deseq2_qc" + DESEQ2_QC_PSEUDO.out.log >> "${params.pseudo_aligner}/deseq2_qc" - BBMAP_BBSPLIT.out.stats >> 'bbsplit/' - BBMAP_BBSPLIT.out.all_fastq >> (params.save_bbsplit_reads ? 'bbsplit/' : null) - CAT_FASTQ.out.reads >> (params.save_merged_fastq ? 'fastq/' : null) + BBMAP_BBSPLIT.out.stats >> 'bbsplit' + BBMAP_BBSPLIT.out.all_fastq >> (params.save_bbsplit_reads ? 'bbsplit' : null) + CAT_FASTQ.out.reads >> (params.save_merged_fastq ? 'fastq' : null) // TODO: params.remove_ribo_rna - // SORTMERNA.out.reads >> (params.save_non_ribo_reads ? 'sortmerna/' : null) + // SORTMERNA.out.reads >> (params.save_non_ribo_reads ? 'sortmerna' : null) - BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig >> "${params.aligner}/bigwig/" - BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig >> "${params.aligner}/bigwig/" - DUPRADAR.out.pdf >> "${params.aligner}/dupradar/" - DUPRADAR.out.txt >> "${params.aligner}/dupradar/" - MULTIQC.out.report >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") - MULTIQC.out.data >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") - MULTIQC.out.plots >> (params.skip_alignment ? 'multiqc/' : "multiqc/${params.aligner}/") + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_FORWARD.out.bigwig >> "${params.aligner}/bigwig" + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG_REVERSE.out.bigwig >> "${params.aligner}/bigwig" + DUPRADAR.out.pdf >> "${params.aligner}/dupradar" + DUPRADAR.out.txt >> "${params.aligner}/dupradar" + MULTIQC.out.report >> (params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}") + MULTIQC.out.data >> (params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}") + MULTIQC.out.plots >> (params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}") // TODO: !params.skip_alignment && !params.skip_qc && !params.skip_preseq - // PRESEQ_LCEXTRAP.out.lc_extrap >> "${params.aligner}/preseq/" - // PRESEQ_LCEXTRAP.out.log >> "${params.aligner}/preseq/log/" - - QUALIMAP_RNASEQ.out.results >> "${params.aligner}/qualimap/" - STRINGTIE_STRINGTIE.out.transcript_gtf >> "${params.aligner}/stringtie/" - STRINGTIE_STRINGTIE.out.abundance >> "${params.aligner}/stringtie/" - STRINGTIE_STRINGTIE.out.coverage_gtf >> "${params.aligner}/stringtie/" - STRINGTIE_STRINGTIE.out.ballgown >> "${params.aligner}/stringtie/" - MULTIQC_CUSTOM_BIOTYPE.out.tsv >> "${params.aligner}/featurecounts/" - SUBREAD_FEATURECOUNTS.out.counts >> "${params.aligner}/featurecounts/" - SUBREAD_FEATURECOUNTS.out.summary >> "${params.aligner}/featurecounts/" - - BAM_MARKDUPLICATES_PICARD.out.bam >> "${params.aligner}/" - BAM_MARKDUPLICATES_PICARD.out.bai >> "${params.aligner}/" - BAM_MARKDUPLICATES_PICARD.out.csi >> "${params.aligner}/" - BAM_MARKDUPLICATES_PICARD.out.metrics >> "${params.aligner}/picard_metrics/" - BAM_MARKDUPLICATES_PICARD.out.stats >> "${params.aligner}/samtools_stats/" - BAM_MARKDUPLICATES_PICARD.out.flagstat >> "${params.aligner}/samtools_stats/" - BAM_MARKDUPLICATES_PICARD.out.idxstats >> "${params.aligner}/samtools_stats/" - - BAM_RSEQC.out.bamstat_txt >> "${params.aligner}/rseqc/bam_stat/" - BAM_RSEQC.out.inferexperiment_txt >> "${params.aligner}/rseqc/infer_experiment/" - BAM_RSEQC.out.junctionannotation_pdf >> "${params.aligner}/rseqc/junction_annotation/" - BAM_RSEQC.out.junctionannotation_events_pdf >> "${params.aligner}/rseqc/junction_annotation/" - BAM_RSEQC.out.junctionannotation_bed >> "${params.aligner}/rseqc/junction_annotation/" - BAM_RSEQC.out.junctionannotation_interact_bed >> "${params.aligner}/rseqc/junction_annotation/" - BAM_RSEQC.out.junctionannotation_xls >> "${params.aligner}/rseqc/junction_annotation/" - BAM_RSEQC.out.junctionannotation_log >> "${params.aligner}/rseqc/junction_annotation/" - BAM_RSEQC.out.junctionannotation_rscript >> "${params.aligner}/rseqc/junction_annotation/" - BAM_RSEQC.out.junctionsaturation_pdf >> "${params.aligner}/rseqc/junction_saturation/" - BAM_RSEQC.out.junctionsaturation_rscript >> "${params.aligner}/rseqc/junction_saturation/" - BAM_RSEQC.out.readduplication_pdf >> "${params.aligner}/rseqc/read_duplication/" - BAM_RSEQC.out.readduplication_seq_xls >> "${params.aligner}/rseqc/read_duplication/" - BAM_RSEQC.out.readduplication_pos_xls >> "${params.aligner}/rseqc/read_duplication/" - BAM_RSEQC.out.readduplication_rscript >> "${params.aligner}/rseqc/read_duplication/" - BAM_RSEQC.out.readdistribution_txt >> "${params.aligner}/rseqc/read_distribution/" - BAM_RSEQC.out.innerdistance_distance >> "${params.aligner}/rseqc/inner_distance/" - BAM_RSEQC.out.innerdistance_freq >> "${params.aligner}/rseqc/inner_distance/" - BAM_RSEQC.out.innerdistance_mean >> "${params.aligner}/rseqc/inner_distance/" - BAM_RSEQC.out.innerdistance_pdf >> "${params.aligner}/rseqc/inner_distance/" - BAM_RSEQC.out.innerdistance_rscript >> "${params.aligner}/rseqc/inner_distance/" - BAM_RSEQC.out.tin_txt >> "${params.aligner}/rseqc/tin/" - - emit: - multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html - versions = ch_versions // channel: [ path(versions.yml) ] + // PRESEQ_LCEXTRAP.out.lc_extrap >> "${params.aligner}/preseq" + // PRESEQ_LCEXTRAP.out.log >> "${params.aligner}/preseq/log" + + QUALIMAP_RNASEQ.out.results >> "${params.aligner}/qualimap" + STRINGTIE_STRINGTIE.out.transcript_gtf >> "${params.aligner}/stringtie" + STRINGTIE_STRINGTIE.out.abundance >> "${params.aligner}/stringtie" + STRINGTIE_STRINGTIE.out.coverage_gtf >> "${params.aligner}/stringtie" + STRINGTIE_STRINGTIE.out.ballgown >> "${params.aligner}/stringtie" + MULTIQC_CUSTOM_BIOTYPE.out.tsv >> "${params.aligner}/featurecounts" + SUBREAD_FEATURECOUNTS.out.counts >> "${params.aligner}/featurecounts" + SUBREAD_FEATURECOUNTS.out.summary >> "${params.aligner}/featurecounts" + + BAM_MARKDUPLICATES_PICARD.out.bam >> "${params.aligner}" + BAM_MARKDUPLICATES_PICARD.out.bai >> "${params.aligner}" + BAM_MARKDUPLICATES_PICARD.out.csi >> "${params.aligner}" + BAM_MARKDUPLICATES_PICARD.out.metrics >> "${params.aligner}/picard_metrics" + BAM_MARKDUPLICATES_PICARD.out.stats >> "${params.aligner}/samtools_stats" + BAM_MARKDUPLICATES_PICARD.out.flagstat >> "${params.aligner}/samtools_stats" + BAM_MARKDUPLICATES_PICARD.out.idxstats >> "${params.aligner}/samtools_stats" + + BAM_RSEQC.out.bamstat_txt >> "${params.aligner}/rseqc/bam_stat" + BAM_RSEQC.out.inferexperiment_txt >> "${params.aligner}/rseqc/infer_experiment" + BAM_RSEQC.out.junctionannotation_pdf >> "${params.aligner}/rseqc/junction_annotation" + BAM_RSEQC.out.junctionannotation_events_pdf >> "${params.aligner}/rseqc/junction_annotation" + BAM_RSEQC.out.junctionannotation_bed >> "${params.aligner}/rseqc/junction_annotation" + BAM_RSEQC.out.junctionannotation_interact_bed >> "${params.aligner}/rseqc/junction_annotation" + BAM_RSEQC.out.junctionannotation_xls >> "${params.aligner}/rseqc/junction_annotation" + BAM_RSEQC.out.junctionannotation_log >> "${params.aligner}/rseqc/junction_annotation" + BAM_RSEQC.out.junctionannotation_rscript >> "${params.aligner}/rseqc/junction_annotation" + BAM_RSEQC.out.junctionsaturation_pdf >> "${params.aligner}/rseqc/junction_saturation" + BAM_RSEQC.out.junctionsaturation_rscript >> "${params.aligner}/rseqc/junction_saturation" + BAM_RSEQC.out.readduplication_pdf >> "${params.aligner}/rseqc/read_duplication" + BAM_RSEQC.out.readduplication_seq_xls >> "${params.aligner}/rseqc/read_duplication" + BAM_RSEQC.out.readduplication_pos_xls >> "${params.aligner}/rseqc/read_duplication" + BAM_RSEQC.out.readduplication_rscript >> "${params.aligner}/rseqc/read_duplication" + BAM_RSEQC.out.readdistribution_txt >> "${params.aligner}/rseqc/read_distribution" + BAM_RSEQC.out.innerdistance_distance >> "${params.aligner}/rseqc/inner_distance" + BAM_RSEQC.out.innerdistance_freq >> "${params.aligner}/rseqc/inner_distance" + BAM_RSEQC.out.innerdistance_mean >> "${params.aligner}/rseqc/inner_distance" + BAM_RSEQC.out.innerdistance_pdf >> "${params.aligner}/rseqc/inner_distance" + BAM_RSEQC.out.innerdistance_rscript >> "${params.aligner}/rseqc/inner_distance" + BAM_RSEQC.out.tin_txt >> "${params.aligner}/rseqc/tin" } /* From c67cdf8a00d47ebe8a9f6884d98e624fb7154a2b Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Mon, 23 Sep 2024 01:35:44 -0500 Subject: [PATCH 17/17] Simplify workflow publishers Signed-off-by: Ben Sherman --- subworkflows/local/align_star/main.nf | 16 ++-- subworkflows/local/prepare_genome/main.nf | 43 ++++++---- subworkflows/local/quantify_rsem/main.nf | 20 +++-- .../bam_dedup_stats_samtools_umitools/main.nf | 15 ++-- .../nf-core/bam_markduplicates_picard/main.nf | 23 ++++-- subworkflows/nf-core/bam_rseqc/main.nf | 52 +++++++----- .../bedgraph_bedclip_bedgraphtobigwig/main.nf | 9 ++- .../nf-core/fastq_align_hisat2/main.nf | 7 +- .../fastq_fastqc_umitools_fastp/main.nf | 26 +++--- .../fastq_fastqc_umitools_trimgalore/main.nf | 12 +-- workflows/rnaseq/main.nf | 80 +++++++------------ 11 files changed, 157 insertions(+), 146 deletions(-) diff --git a/subworkflows/local/align_star/main.nf b/subworkflows/local/align_star/main.nf index a49402760..a3c6c52db 100644 --- a/subworkflows/local/align_star/main.nf +++ b/subworkflows/local/align_star/main.nf @@ -82,12 +82,12 @@ workflow ALIGN_STAR { versions = ch_versions // channel: [ versions.yml ] publish: - ch_orig_bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - ch_log_final >> 'star_salmon/log/' - ch_log_out >> 'star_salmon/log/' - ch_log_progress >> 'star_salmon/log/' - ch_bam_sorted >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - ch_bam_transcript >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - ch_fastq >> (params.save_unaligned ? 'star_salmon/unmapped/' : null) - ch_tab >> 'star_salmon/log/' + ch_orig_bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + ch_log_final >> 'star_salmon/log' + ch_log_out >> 'star_salmon/log' + ch_log_progress >> 'star_salmon/log' + ch_bam_sorted >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + ch_bam_transcript >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + ch_fastq >> (params.save_unaligned ? 'star_salmon/unmapped' : null) + ch_tab >> 'star_salmon/log' } diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index f30bd6caf..701630d9d 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -76,13 +76,13 @@ workflow PREPARE_GENOME { // if (gtf || gff) { if (gtf) { + ch_gff = Channel.empty() if (gtf.endsWith('.gz')) { ch_gtf = GUNZIP_GTF ( [ [:], gtf ] ).gunzip.map { it[1] } ch_versions = ch_versions.mix(GUNZIP_GTF.out.versions) } else { ch_gtf = Channel.value(file(gtf)) } - ch_gff = Channel.empty() } else if (gff) { if (gff.endsWith('.gz')) { ch_gff = GUNZIP_GFF ( [ [:], gff ] ).gunzip.map { it[1] } @@ -328,6 +328,30 @@ workflow PREPARE_GENOME { } } + // + // Collect channels for publishing + // + ch_genome = Channel.empty().mix( + ch_fasta, + ch_gtf, + ch_gff, + ch_add_fasta, + ch_gene_bed, + ch_transcript_fasta, + ch_fai, + ch_chrom_sizes, + ) + + ch_genome_index = Channel.empty().mix( + ch_splicesites, + ch_bbsplit_index, + ch_star_index, + ch_rsem_index, + ch_hisat2_index, + ch_salmon_index, + ch_kallisto_index, + ) + emit: fasta = ch_fasta // channel: path(genome.fasta) gtf = ch_gtf // channel: path(genome.gtf) @@ -345,19 +369,6 @@ workflow PREPARE_GENOME { versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] publish: - ch_fasta >> (params.save_reference ? 'genome' : null) - ch_gtf >> (params.save_reference ? 'genome' : null) - ch_gff >> (params.save_reference ? 'genome' : null) - ch_add_fasta >> (params.save_reference ? 'genome' : null) - ch_gene_bed >> (params.save_reference ? 'genome' : null) - ch_transcript_fasta >> (params.save_reference ? 'genome' : null) - ch_fai >> (params.save_reference ? 'genome' : null) - ch_chrom_sizes >> (params.save_reference ? 'genome' : null) - ch_splicesites >> (params.save_reference ? 'genome/index' : null) - ch_bbsplit_index >> (params.save_reference ? 'genome/index' : null) - ch_star_index >> (params.save_reference ? 'genome/index' : null) - ch_rsem_index >> (params.save_reference ? 'genome/index' : null) - ch_hisat2_index >> (params.save_reference ? 'genome/index' : null) - ch_salmon_index >> (params.save_reference ? 'genome/index' : null) - ch_kallisto_index >> (params.save_reference ? 'genome/index' : null) + ch_genome >> (params.save_reference ? 'genome' : null) + ch_genome_index >> (params.save_reference ? 'genome/index' : null) } diff --git a/subworkflows/local/quantify_rsem/main.nf b/subworkflows/local/quantify_rsem/main.nf index 6701967c6..577b76589 100644 --- a/subworkflows/local/quantify_rsem/main.nf +++ b/subworkflows/local/quantify_rsem/main.nf @@ -61,15 +61,13 @@ workflow QUANTIFY_RSEM { versions = ch_versions // channel: [ versions.yml ] publish: - RSEM_CALCULATEEXPRESSION.out.counts_gene >> 'star_rsem/' - RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'star_rsem/' - RSEM_CALCULATEEXPRESSION.out.stat >> 'star_rsem/' - RSEM_CALCULATEEXPRESSION.out.logs >> 'star_rsem/log/' - RSEM_CALCULATEEXPRESSION.out.bam_star >> (params.save_align_intermeds ? 'star_rsem/' : null) - RSEM_CALCULATEEXPRESSION.out.bam_genome >> (params.save_align_intermeds ? 'star_rsem/' : null) - RSEM_CALCULATEEXPRESSION.out.bam_transcript >> (params.save_align_intermeds ? 'star_rsem/' : null) - RSEM_MERGE_COUNTS.out.merged_counts_gene >> 'star_rsem/' - RSEM_MERGE_COUNTS.out.merged_tpm_gene >> 'star_rsem/' - RSEM_MERGE_COUNTS.out.merged_counts_transcript >> 'star_rsem/' - RSEM_MERGE_COUNTS.out.merged_tpm_transcript >> 'star_rsem/' + RSEM_CALCULATEEXPRESSION.out.counts_gene >> 'star_rsem' + RSEM_CALCULATEEXPRESSION.out.counts_transcript >> 'star_rsem' + RSEM_CALCULATEEXPRESSION.out.stat >> 'star_rsem' + RSEM_CALCULATEEXPRESSION.out.logs >> 'star_rsem/log' + RSEM_CALCULATEEXPRESSION.out.bam_star >> (params.save_align_intermeds ? 'star_rsem' : null) + RSEM_CALCULATEEXPRESSION.out.bam_genome >> (params.save_align_intermeds ? 'star_rsem' : null) + RSEM_CALCULATEEXPRESSION.out.bam_transcript >> (params.save_align_intermeds ? 'star_rsem' : null) + RSEM_MERGE_COUNTS.out >> 'star_rsem' + RSEM_MERGE_COUNTS.out.versions >> null } diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf index 42b554a11..783332f2f 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/main.nf @@ -54,12 +54,11 @@ workflow BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS { versions = ch_versions // channel: [ path(versions.yml) ] publish: - UMITOOLS_DEDUP.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - UMITOOLS_DEDUP.out.tsv_edit_distance >> 'star_salmon/umitools/' - UMITOOLS_DEDUP.out.tsv_per_umi >> 'star_salmon/umitools/' - UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'star_salmon/umitools/' - SAMTOOLS_INDEX.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/' : null) - BAM_STATS_SAMTOOLS.out.stats >> 'star_salmon/samtools_stats/' - BAM_STATS_SAMTOOLS.out.flagstat >> 'star_salmon/samtools_stats/' - BAM_STATS_SAMTOOLS.out.idxstats >> 'star_salmon/samtools_stats/' + UMITOOLS_DEDUP.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + UMITOOLS_DEDUP.out.tsv_edit_distance >> 'star_salmon/umitools' + UMITOOLS_DEDUP.out.tsv_per_umi >> 'star_salmon/umitools' + UMITOOLS_DEDUP.out.tsv_umi_per_position >> 'star_salmon/umitools' + SAMTOOLS_INDEX.out.bai >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) + BAM_STATS_SAMTOOLS.out >> 'star_salmon/samtools_stats' + BAM_STATS_SAMTOOLS.out.versions >> null } diff --git a/subworkflows/nf-core/bam_markduplicates_picard/main.nf b/subworkflows/nf-core/bam_markduplicates_picard/main.nf index 271f880a1..ca7bbe674 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/main.nf +++ b/subworkflows/nf-core/bam_markduplicates_picard/main.nf @@ -45,13 +45,22 @@ workflow BAM_MARKDUPLICATES_PICARD { idxstats = BAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] versions = ch_versions // channel: [ versions.yml ] +} + +workflow { + main: + def ch_bam = Channel.empty() + def ch_fasta = Channel.empty() + def ch_fai = Channel.empty() + + BAM_MARKDUPLICATES_PICARD( ch_bam, ch_fasta, ch_fai ) publish: - PICARD_MARKDUPLICATES.out.bam >> 'picard/' - PICARD_MARKDUPLICATES.out.metrics >> 'picard/metrics/' - SAMTOOLS_INDEX.out.bai >> 'picard/' - SAMTOOLS_INDEX.out.csi >> 'picard/' - BAM_STATS_SAMTOOLS.out.stats >> 'picard/samtools_stats/' - BAM_STATS_SAMTOOLS.out.flagstat >> 'picard/samtools_stats/' - BAM_STATS_SAMTOOLS.out.idxstats >> 'picard/samtools_stats/' + BAM_MARKDUPLICATES_PICARD.out.bam >> 'picard' + BAM_MARKDUPLICATES_PICARD.out.metrics >> 'picard/metrics' + BAM_MARKDUPLICATES_PICARD.out.bai >> 'picard' + BAM_MARKDUPLICATES_PICARD.out.csi >> 'picard' + BAM_MARKDUPLICATES_PICARD.out.stats >> 'picard/samtools_stats' + BAM_MARKDUPLICATES_PICARD.out.flagstat >> 'picard/samtools_stats' + BAM_MARKDUPLICATES_PICARD.out.idxstats >> 'picard/samtools_stats' } diff --git a/subworkflows/nf-core/bam_rseqc/main.nf b/subworkflows/nf-core/bam_rseqc/main.nf index 69f553367..de674f2a9 100644 --- a/subworkflows/nf-core/bam_rseqc/main.nf +++ b/subworkflows/nf-core/bam_rseqc/main.nf @@ -182,28 +182,36 @@ workflow BAM_RSEQC { tin_txt // channel: [ val(meta), txt ] versions // channel: [ versions.yml ] +} + +workflow { + main: + def bam_bai = Channel.empty() + def bed = Channel.empty() + def rseqc_modules = Channel.empty() + BAM_RSEQC(bam_bai, bed, rseqc_modules) publish: - bamstat_txt >> 'rseqc/bam_stat/' - inferexperiment_txt >> 'rseqc/infer_experiment/' - junctionannotation_pdf >> 'rseqc/junction_annotation/' - junctionannotation_events_pdf >> 'rseqc/junction_annotation/' - junctionannotation_bed >> 'rseqc/junction_annotation/' - junctionannotation_interact_bed >> 'rseqc/junction_annotation/' - junctionannotation_xls >> 'rseqc/junction_annotation/' - junctionannotation_log >> 'rseqc/junction_annotation/' - junctionannotation_rscript >> 'rseqc/junction_annotation/' - junctionsaturation_pdf >> 'rseqc/junction_saturation/' - junctionsaturation_rscript >> 'rseqc/junction_saturation/' - readduplication_pdf >> 'rseqc/read_duplication/' - readduplication_seq_xls >> 'rseqc/read_duplication/' - readduplication_pos_xls >> 'rseqc/read_duplication/' - readduplication_rscript >> 'rseqc/read_duplication/' - readdistribution_txt >> 'rseqc/read_distribution/' - innerdistance_distance >> 'rseqc/inner_distance/' - innerdistance_freq >> 'rseqc/inner_distance/' - innerdistance_mean >> 'rseqc/inner_distance/' - innerdistance_pdf >> 'rseqc/inner_distance/' - innerdistance_rscript >> 'rseqc/inner_distance/' - tin_txt >> 'rseqc/tin/' + BAM_RSEQC.out.bamstat_txt >> 'rseqc/bam_stat' + BAM_RSEQC.out.inferexperiment_txt >> 'rseqc/infer_experiment' + BAM_RSEQC.out.junctionannotation_pdf >> 'rseqc/junction_annotation' + BAM_RSEQC.out.junctionannotation_events_pdf >> 'rseqc/junction_annotation' + BAM_RSEQC.out.junctionannotation_bed >> 'rseqc/junction_annotation' + BAM_RSEQC.out.junctionannotation_interact_bed >> 'rseqc/junction_annotation' + BAM_RSEQC.out.junctionannotation_xls >> 'rseqc/junction_annotation' + BAM_RSEQC.out.junctionannotation_log >> 'rseqc/junction_annotation' + BAM_RSEQC.out.junctionannotation_rscript >> 'rseqc/junction_annotation' + BAM_RSEQC.out.junctionsaturation_pdf >> 'rseqc/junction_saturation' + BAM_RSEQC.out.junctionsaturation_rscript >> 'rseqc/junction_saturation' + BAM_RSEQC.out.readduplication_pdf >> 'rseqc/read_duplication' + BAM_RSEQC.out.readduplication_seq_xls >> 'rseqc/read_duplication' + BAM_RSEQC.out.readduplication_pos_xls >> 'rseqc/read_duplication' + BAM_RSEQC.out.readduplication_rscript >> 'rseqc/read_duplication' + BAM_RSEQC.out.readdistribution_txt >> 'rseqc/read_distribution' + BAM_RSEQC.out.innerdistance_distance >> 'rseqc/inner_distance' + BAM_RSEQC.out.innerdistance_freq >> 'rseqc/inner_distance' + BAM_RSEQC.out.innerdistance_mean >> 'rseqc/inner_distance' + BAM_RSEQC.out.innerdistance_pdf >> 'rseqc/inner_distance' + BAM_RSEQC.out.innerdistance_rscript >> 'rseqc/inner_distance' + BAM_RSEQC.out.tin_txt >> 'rseqc/tin' } diff --git a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf index 29e4747ac..688db1f6b 100644 --- a/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf +++ b/subworkflows/nf-core/bedgraph_bedclip_bedgraphtobigwig/main.nf @@ -31,7 +31,14 @@ workflow BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG { bedgraph = UCSC_BEDCLIP.out.bedgraph // channel: [ val(meta), [ bedgraph ] ] versions = ch_versions // channel: [ versions.yml ] +} + +workflow { + main: + def bedgraph = Channel.empty() + def sizes = Channel.empty() + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG(bedgraph, sizes) publish: - UCSC_BEDGRAPHTOBIGWIG.out.bigwig >> 'bigwig/' + BEDGRAPH_BEDCLIP_BEDGRAPHTOBIGWIG.out.bigwig >> 'bigwig' } diff --git a/subworkflows/nf-core/fastq_align_hisat2/main.nf b/subworkflows/nf-core/fastq_align_hisat2/main.nf index 64465cdfa..554be9432 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/main.nf +++ b/subworkflows/nf-core/fastq_align_hisat2/main.nf @@ -26,6 +26,7 @@ workflow FASTQ_ALIGN_HISAT2 { BAM_SORT_STATS_SAMTOOLS ( HISAT2_ALIGN.out.bam, ch_fasta ) ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) + emit: orig_bam = HISAT2_ALIGN.out.bam // channel: [ val(meta), bam ] summary = HISAT2_ALIGN.out.summary // channel: [ val(meta), log ] @@ -41,8 +42,8 @@ workflow FASTQ_ALIGN_HISAT2 { versions = ch_versions // channel: [ versions.yml ] publish: - HISAT2_ALIGN.out.bam >> (params.save_align_intermeds ? 'hisat2/' : null) - HISAT2_ALIGN.out.summary >> 'hisat2/log/' - HISAT2_ALIGN.out.fastq >> (params.save_unaligned ? 'hisat2/unmapped/' : null) + HISAT2_ALIGN.out.bam >> (params.save_align_intermeds ? 'hisat2' : null) + HISAT2_ALIGN.out.summary >> 'hisat2/log' + HISAT2_ALIGN.out.fastq >> (params.save_unaligned ? 'hisat2/unmapped' : null) } diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf index 105e90f14..966bdaa6a 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf @@ -134,19 +134,6 @@ workflow FASTQ_FASTQC_UMITOOLS_FASTP { } } - publish: - // TODO: need to recover trim_reads and umi_reads - // trim_reads >> (params.save_trimmed ? 'fastp/intermeds/' : null) - // umi_reads >> (params.save_umi_intermeds ? 'umitools/' : null) - umi_log >> 'umitools/' - trim_json >> 'fastp/' - trim_html >> 'fastp/' - trim_log >> 'fastp/log/' - trim_reads_fail >> (params.save_trimmed ? 'fastp/intermeds/' : null) - trim_reads_merged >> (params.save_trimmed ? 'fastp/intermeds/' : null) - fastqc_trim_html >> 'fastp/fastqc/' - fastqc_trim_zip >> 'fastp/fastqc/' - emit: reads = trim_reads // channel: [ val(meta), [ reads ] ] @@ -167,4 +154,17 @@ workflow FASTQ_FASTQC_UMITOOLS_FASTP { fastqc_trim_zip // channel: [ val(meta), [ zip ] ] versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ] + + publish: + // TODO: need to recover trim_reads and umi_reads + // trim_reads >> (params.save_trimmed ? 'fastp/intermeds' : null) + // umi_reads >> (params.save_umi_intermeds ? 'umitools' : null) + umi_log >> 'umitools' + trim_json >> 'fastp' + trim_html >> 'fastp' + trim_log >> 'fastp/log' + trim_reads_fail >> (params.save_trimmed ? 'fastp/intermeds' : null) + trim_reads_merged >> (params.save_trimmed ? 'fastp/intermeds' : null) + fastqc_trim_html >> 'fastp/fastqc' + fastqc_trim_zip >> 'fastp/fastqc' } diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf index 9a3cd1a29..fc257f969 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_trimgalore/main.nf @@ -123,10 +123,10 @@ workflow FASTQ_FASTQC_UMITOOLS_TRIMGALORE { publish: // TODO: need to recover trim_reads and umi_reads - // trim_reads >> (params.save_trimmed ? 'trimgalore/' : null) - // umi_reads >> (params.save_umi_intermeds ? 'umitools/' : null) - umi_log >> 'umitools/' - trim_html >> 'trimgalore/fastqc/' - trim_zip >> 'trimgalore/fastqc/' - trim_log >> 'trimgalore/' + // trim_reads >> (params.save_trimmed ? 'trimgalore' : null) + // umi_reads >> (params.save_umi_intermeds ? 'umitools' : null) + umi_log >> 'umitools' + trim_html >> 'trimgalore/fastqc' + trim_zip >> 'trimgalore/fastqc' + trim_log >> 'trimgalore' } diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index b3b4c5d36..6a80cc6d0 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -787,19 +787,11 @@ workflow RNASEQ { versions = ch_versions // channel: [ path(versions.yml) ] publish: - QUANTIFY_STAR_SALMON.out.results >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.tpm_gene >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.counts_gene >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.lengths_gene >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.counts_gene_length_scaled >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.counts_gene_scaled >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.tpm_transcript >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.counts_transcript >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.lengths_transcript >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.merged_gene_rds >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.merged_gene_rds_length_scaled >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.merged_gene_rds_scaled >> 'star_salmon' - QUANTIFY_STAR_SALMON.out.merged_transcript_rds >> 'star_salmon' + QUANTIFY_STAR_SALMON.out >> 'star_salmon' + QUANTIFY_STAR_SALMON.out.multiqc >> null + QUANTIFY_STAR_SALMON.out.merged_counts_transcript >> null + QUANTIFY_STAR_SALMON.out.merged_tpm_transcript >> null + QUANTIFY_STAR_SALMON.out.versions >> null // TODO: !params.skip_alignment && params.aligner == 'star_salmon' && params.with_umi // BAM_SORT_STATS_SAMTOOLS.out.bam >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon' : null) @@ -812,41 +804,29 @@ workflow RNASEQ { // UMITOOLS_PREPAREFORSALMON.out.log >> (params.save_align_intermeds || params.save_umi_intermeds ? 'star_salmon/umitools/log' : null) // TODO: !params.skip_alignment && params.aligner == 'star_salmon' - DESEQ2_QC_STAR_SALMON.out.rdata >> 'star_salmon/deseq2_qc' - DESEQ2_QC_STAR_SALMON.out.pca_txt >> 'star_salmon/deseq2_qc' - DESEQ2_QC_STAR_SALMON.out.pdf >> 'star_salmon/deseq2_qc' - DESEQ2_QC_STAR_SALMON.out.dists_txt >> 'star_salmon/deseq2_qc' - DESEQ2_QC_STAR_SALMON.out.size_factors >> 'star_salmon/deseq2_qc' - DESEQ2_QC_STAR_SALMON.out.log >> 'star_salmon/deseq2_qc' + DESEQ2_QC_STAR_SALMON.out >> 'star_salmon/deseq2_qc' + DESEQ2_QC_STAR_SALMON.out.pca_multiqc >> null + DESEQ2_QC_STAR_SALMON.out.dists_multiqc >> null + DESEQ2_QC_STAR_SALMON.out.versions >> null // TODO: !params.skip_alignment && params.aligner == 'star_rsem' - // DESEQ2_QC_RSEM.out.rdata >> 'star_rsem/deseq2_qc' - // DESEQ2_QC_RSEM.out.pca_txt >> 'star_rsem/deseq2_qc' - // DESEQ2_QC_RSEM.out.pdf >> 'star_rsem/deseq2_qc' - // DESEQ2_QC_RSEM.out.dists_txt >> 'star_rsem/deseq2_qc' - // DESEQ2_QC_RSEM.out.size_factors >> 'star_rsem/deseq2_qc' - // DESEQ2_QC_RSEM.out.log >> 'star_rsem/deseq2_qc' - - QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_gene >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_gene >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_length_scaled >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_gene_scaled >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.tpm_transcript >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.counts_transcript >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.lengths_transcript >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_length_scaled >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_gene_rds_scaled >> params.pseudo_aligner - QUANTIFY_PSEUDO_ALIGNMENT.out.merged_transcript_rds >> params.pseudo_aligner + // DESEQ2_QC_RSEM.out >> 'star_rsem/deseq2_qc' + // DESEQ2_QC_RSEM.out.pca_multiqc >> null + // DESEQ2_QC_RSEM.out.dists_multiqc >> null + // DESEQ2_QC_RSEM.out.versions >> null + + QUANTIFY_PSEUDO_ALIGNMENT.out >> params.pseudo_aligner + QUANTIFY_PSEUDO_ALIGNMENT.out.results >> null + QUANTIFY_PSEUDO_ALIGNMENT.out.multiqc >> null + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_counts_transcript >> null + QUANTIFY_PSEUDO_ALIGNMENT.out.merged_tpm_transcript >> null + QUANTIFY_PSEUDO_ALIGNMENT.out.versions >> null // TODO: process 'QUANTIFY_PSEUDO_ALIGNMENT:CUSTOM_TX2GENE' - DESEQ2_QC_PSEUDO.out.rdata >> "${params.pseudo_aligner}/deseq2_qc" - DESEQ2_QC_PSEUDO.out.pca_txt >> "${params.pseudo_aligner}/deseq2_qc" - DESEQ2_QC_PSEUDO.out.pdf >> "${params.pseudo_aligner}/deseq2_qc" - DESEQ2_QC_PSEUDO.out.dists_txt >> "${params.pseudo_aligner}/deseq2_qc" - DESEQ2_QC_PSEUDO.out.size_factors >> "${params.pseudo_aligner}/deseq2_qc" - DESEQ2_QC_PSEUDO.out.log >> "${params.pseudo_aligner}/deseq2_qc" + DESEQ2_QC_PSEUDO.out >> "${params.pseudo_aligner}/deseq2_qc" + DESEQ2_QC_PSEUDO.out.pca_multiqc >> null + DESEQ2_QC_PSEUDO.out.dists_multiqc >> null + DESEQ2_QC_PSEUDO.out.versions >> null BBMAP_BBSPLIT.out.stats >> 'bbsplit' BBMAP_BBSPLIT.out.all_fastq >> (params.save_bbsplit_reads ? 'bbsplit' : null) @@ -867,14 +847,12 @@ workflow RNASEQ { // PRESEQ_LCEXTRAP.out.lc_extrap >> "${params.aligner}/preseq" // PRESEQ_LCEXTRAP.out.log >> "${params.aligner}/preseq/log" - QUALIMAP_RNASEQ.out.results >> "${params.aligner}/qualimap" - STRINGTIE_STRINGTIE.out.transcript_gtf >> "${params.aligner}/stringtie" - STRINGTIE_STRINGTIE.out.abundance >> "${params.aligner}/stringtie" - STRINGTIE_STRINGTIE.out.coverage_gtf >> "${params.aligner}/stringtie" - STRINGTIE_STRINGTIE.out.ballgown >> "${params.aligner}/stringtie" + QUALIMAP_RNASEQ.out.results >> "${params.aligner}/qualimap" + STRINGTIE_STRINGTIE.out >> "${params.aligner}/stringtie" + STRINGTIE_STRINGTIE.out.versions >> null MULTIQC_CUSTOM_BIOTYPE.out.tsv >> "${params.aligner}/featurecounts" - SUBREAD_FEATURECOUNTS.out.counts >> "${params.aligner}/featurecounts" - SUBREAD_FEATURECOUNTS.out.summary >> "${params.aligner}/featurecounts" + SUBREAD_FEATURECOUNTS.out >> "${params.aligner}/featurecounts" + SUBREAD_FEATURECOUNTS.out.versions >> null BAM_MARKDUPLICATES_PICARD.out.bam >> "${params.aligner}" BAM_MARKDUPLICATES_PICARD.out.bai >> "${params.aligner}"