Skip to content

Commit 20c3cc3

Browse files
committed
Workflow outputs [wip]
1 parent 407a3df commit 20c3cc3

File tree

8 files changed

+129
-347
lines changed

8 files changed

+129
-347
lines changed

main.nf

Lines changed: 92 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
----------------------------------------------------------------------------------------
1010
*/
1111

12-
/*
13-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14-
GENOME PARAMETER VALUES
15-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16-
*/
12+
nextflow.preview.output = true
1713

1814
params.fasta = getGenomeAttribute('fasta')
1915
params.additional_fasta = getGenomeAttribute('additional_fasta')
@@ -29,30 +25,25 @@ params.hisat2_index = getGenomeAttribute('hisat2')
2925
params.salmon_index = getGenomeAttribute('salmon')
3026
params.kallisto_index = getGenomeAttribute('kallisto')
3127

32-
/*
33-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34-
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
35-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36-
*/
37-
3828
include { RNASEQ } from './workflows/rnaseq'
3929
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
4030
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
4131
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
4232
include { checkMaxContigSize } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
4333

44-
/*
45-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46-
NAMED WORKFLOWS FOR PIPELINE
47-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48-
*/
49-
50-
//
51-
// WORKFLOW: Run main analysis pipeline
52-
//
53-
workflow NFCORE_RNASEQ {
34+
workflow {
5435

5536
main:
37+
//
38+
// SUBWORKFLOW: Run initialisation tasks
39+
//
40+
PIPELINE_INITIALISATION (
41+
params.version,
42+
params.validate_params,
43+
params.monochrome_logs,
44+
args,
45+
params.outdir
46+
)
5647

5748
//
5849
// SUBWORKFLOW: Prepare reference genome files
@@ -93,6 +84,27 @@ workflow NFCORE_RNASEQ {
9384
.map { checkMaxContigSize(it) }
9485
}
9586

87+
ch_genome = Channel.empty().mix(
88+
PREPARE_GENOME.out.fasta,
89+
PREPARE_GENOME.out.gtf,
90+
PREPARE_GENOME.out.gff,
91+
PREPARE_GENOME.out.add_fasta,
92+
PREPARE_GENOME.out.gene_bed,
93+
PREPARE_GENOME.out.transcript_fasta,
94+
PREPARE_GENOME.out.fai,
95+
PREPARE_GENOME.out.chrom_sizes,
96+
)
97+
98+
ch_genome_index = Channel.empty().mix(
99+
PREPARE_GENOME.out.splicesites,
100+
PREPARE_GENOME.out.bbsplit_index,
101+
PREPARE_GENOME.out.star_index,
102+
PREPARE_GENOME.out.rsem_index,
103+
PREPARE_GENOME.out.hisat2_index,
104+
PREPARE_GENOME.out.salmon_index,
105+
PREPARE_GENOME.out.kallisto_index,
106+
)
107+
96108
//
97109
// WORKFLOW: Run nf-core/rnaseq workflow
98110
//
@@ -116,38 +128,6 @@ workflow NFCORE_RNASEQ {
116128
PREPARE_GENOME.out.splicesites
117129
)
118130

119-
emit:
120-
trim_status = RNASEQ.out.trim_status // channel: [id, boolean]
121-
map_status = RNASEQ.out.map_status // channel: [id, boolean]
122-
strand_status = RNASEQ.out.strand_status // channel: [id, boolean]
123-
multiqc_report = RNASEQ.out.multiqc_report // channel: /path/to/multiqc_report.html
124-
}
125-
126-
/*
127-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128-
RUN MAIN WORKFLOW
129-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130-
*/
131-
132-
workflow {
133-
134-
main:
135-
//
136-
// SUBWORKFLOW: Run initialisation tasks
137-
//
138-
PIPELINE_INITIALISATION (
139-
params.version,
140-
params.validate_params,
141-
params.monochrome_logs,
142-
args,
143-
params.outdir
144-
)
145-
146-
//
147-
// WORKFLOW: Run main workflow
148-
//
149-
NFCORE_RNASEQ ()
150-
151131
//
152132
// SUBWORKFLOW: Run completion tasks
153133
//
@@ -158,18 +138,68 @@ workflow {
158138
params.outdir,
159139
params.monochrome_logs,
160140
params.hook_url,
161-
NFCORE_RNASEQ.out.multiqc_report,
162-
NFCORE_RNASEQ.out.trim_status,
163-
NFCORE_RNASEQ.out.map_status,
164-
NFCORE_RNASEQ.out.strand_status
141+
RNASEQ.out.multiqc_report,
142+
RNASEQ.out.trim_status,
143+
RNASEQ.out.map_status,
144+
RNASEQ.out.strand_status
165145
)
146+
147+
publish:
148+
genome = ch_genome
149+
genome_index = ch_genome_index
150+
star_salmon = RNASEQ.out.star_salmon
151+
star_salmon_deseq_qc = RNASEQ.out.star_salmon_deseq_qc
152+
star_rsem = RNASEQ.out.star_rsem
153+
star_rsem_deseq_qc = RNASEQ.out.star_rsem_deseq_qc
154+
hisat2 = RNASEQ.out.hisat2
155+
multiqc_report = RNASEQ.out.multiqc_report
156+
multiqc_data = RNASEQ.out.multiqc_data
157+
multiqc_plots = RNASEQ.out.multiqc_plots
166158
}
167159

168-
/*
169-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170-
FUNCTIONS
171-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172-
*/
160+
output {
161+
genome {
162+
enabled params.save_reference
163+
path 'genome'
164+
}
165+
166+
genome_index {
167+
enabled params.save_reference
168+
path 'genome/index'
169+
}
170+
171+
star_salmon {
172+
path 'star_salmon'
173+
}
174+
175+
star_salmon_deseq_qc {
176+
path 'star_salmon/deseq2_qc'
177+
}
178+
179+
star_rsem {
180+
path 'star_rsem'
181+
}
182+
183+
star_rsem_deseq_qc {
184+
path 'star_rsem/deseq2_qc'
185+
}
186+
187+
hisat2 {
188+
path 'hisat2'
189+
}
190+
191+
multiqc_report {
192+
path params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}"
193+
}
194+
195+
multiqc_data {
196+
path params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}"
197+
}
198+
199+
multiqc_plots {
200+
path params.skip_alignment ? 'multiqc' : "multiqc/${params.aligner}"
201+
}
202+
}
173203

174204
//
175205
// Get attribute from genome config file e.g. fasta
@@ -183,9 +213,3 @@ def getGenomeAttribute(attribute) {
183213
}
184214
return null
185215
}
186-
187-
/*
188-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189-
THE END
190-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191-
*/

modules/nf-core/multiqc/nextflow.config

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nextflow.config

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,8 @@ params {
142142
}
143143

144144
// Default publishing logic for pipeline
145-
process {
146-
publishDir = [
147-
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
148-
mode: params.publish_dir_mode,
149-
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
150-
]
151-
}
145+
outputDir = params.outdir
146+
workflow.output.mode = params.publish_dir_mode
152147

153148
// Load base.config by default for all pipelines
154149
includeConfig 'conf/base.config'

subworkflows/local/prepare_genome/main.nf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ workflow PREPARE_GENOME {
7777
ch_gtf = Channel.value(file(gtf, checkIfExists: true))
7878
}
7979
} else if (gff) {
80-
def ch_gff
8180
if (gff.endsWith('.gz')) {
8281
ch_gff = GUNZIP_GFF ([ [:], file(gff, checkIfExists: true) ]).gunzip
8382
} else {
@@ -375,6 +374,8 @@ workflow PREPARE_GENOME {
375374
emit:
376375
fasta = ch_fasta // channel: path(genome.fasta)
377376
gtf = ch_gtf // channel: path(genome.gtf)
377+
gff = ch_gff
378+
add_fasta = ch_add_fasta
378379
fai = ch_fai // channel: path(genome.fai)
379380
gene_bed = ch_gene_bed // channel: path(gene.bed)
380381
transcript_fasta = ch_transcript_fasta // channel: path(transcript.fasta)
Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,37 @@
11
process {
2-
withName: 'GUNZIP_.*|MAKE_TRANSCRIPTS_FASTA' {
3-
publishDir = [
4-
path: { params.save_reference ? "${params.outdir}/genome" : params.outdir },
5-
mode: params.publish_dir_mode,
6-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
7-
]
8-
}
9-
102
withName: 'UNTAR_.*' {
113
ext.args2 = '--no-same-owner'
124
}
135

14-
withName: 'UNTAR_.*|STAR_GENOMEGENERATE|STAR_GENOMEGENERATE_IGENOMES|HISAT2_BUILD' {
15-
publishDir = [
16-
path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir },
17-
mode: params.publish_dir_mode,
18-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
19-
]
20-
}
21-
226
withName: 'GFFREAD' {
237
ext.args = '--keep-exon-attrs -F -T'
248
ext.prefix = { gff.simpleName }
25-
publishDir = [
26-
path: { params.save_reference ? "${params.outdir}/genome" : params.outdir },
27-
mode: params.publish_dir_mode,
28-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
29-
]
30-
}
31-
32-
withName: 'HISAT2_EXTRACTSPLICESITES' {
33-
publishDir = [
34-
path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir },
35-
mode: params.publish_dir_mode,
36-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
37-
]
389
}
3910

4011
withName: 'SALMON_INDEX' {
4112
ext.args = { [
4213
params.gencode ? '--gencode' : '',
4314
params.pseudo_aligner_kmer_size ? "-k ${params.pseudo_aligner_kmer_size}": ''
4415
].join(' ').trim() }
45-
publishDir = [
46-
path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir },
47-
mode: params.publish_dir_mode,
48-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
49-
]
5016
}
5117

5218
withName: 'KALLISTO_INDEX' {
5319
ext.args = params.pseudo_aligner_kmer_size ? "-k ${params.pseudo_aligner_kmer_size}" : ''
54-
publishDir = [
55-
path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir },
56-
mode: params.publish_dir_mode,
57-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
58-
]
5920
}
6021

6122
withName: 'RSEM_PREPAREREFERENCE_GENOME' {
6223
ext.args = '--star'
63-
publishDir = [
64-
path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir },
65-
mode: params.publish_dir_mode,
66-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
67-
]
68-
}
69-
70-
withName: 'GTF2BED' {
71-
publishDir = [
72-
path: { params.save_reference ? "${params.outdir}/genome" : params.outdir },
73-
mode: params.publish_dir_mode,
74-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
75-
]
76-
}
77-
78-
withName: 'CAT_ADDITIONAL_FASTA|PREPROCESS_TRANSCRIPTS_FASTA_GENCODE' {
79-
publishDir = [
80-
path: { params.save_reference ? "${params.outdir}/genome" : params.outdir },
81-
mode: params.publish_dir_mode,
82-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
83-
]
8424
}
8525

8626
withName: 'GTF_FILTER' {
8727
ext.args = { params.skip_gtf_transcript_filter ?: '--skip_transcript_id_check' }
88-
publishDir = [
89-
path: { params.save_reference ? "${params.outdir}/genome" : params.outdir },
90-
mode: params.publish_dir_mode,
91-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
92-
]
9328
}
9429

95-
withName: 'CUSTOM_GETCHROMSIZES' {
96-
publishDir = [
97-
path: { params.save_reference ? "${params.outdir}/genome" : params.outdir },
98-
mode: params.publish_dir_mode,
99-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
100-
]
30+
withName: '.*:PREPARE_GENOME:BBMAP_BBSPLIT' {
31+
ext.args = 'build=1'
10132
}
102-
}
103-
104-
if (!params.skip_bbsplit && params.bbsplit_fasta_list) {
105-
process {
106-
withName: '.*:PREPARE_GENOME:BBMAP_BBSPLIT' {
107-
ext.args = 'build=1'
108-
publishDir = [
109-
path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir },
110-
mode: params.publish_dir_mode,
111-
saveAs: { filename -> (filename != 'versions.yml' && params.save_reference) ? filename : null }
112-
]
113-
}
114-
}
115-
}
11633

117-
if (params.remove_ribo_rna && params.ribo_database_manifest) {
118-
process {
119-
withName: 'SORTMERNA_INDEX' {
120-
ext.args = '--index 1'
121-
publishDir = [
122-
path: { params.save_reference ? "${params.outdir}/genome/sortmerna" : params.outdir },
123-
mode: params.publish_dir_mode,
124-
saveAs: { filename -> filename.equals('versions.yml') ? null : params.save_reference ? filename : null }
125-
]
126-
}
34+
withName: 'SORTMERNA_INDEX' {
35+
ext.args = '--index 1'
12736
}
12837
}

0 commit comments

Comments
 (0)