Skip to content

Commit 080c45a

Browse files
committed
Workflow outputs [wip]
1 parent 031966d commit 080c45a

File tree

8 files changed

+136
-354
lines changed

8 files changed

+136
-354
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
//
@@ -117,38 +129,6 @@ workflow NFCORE_RNASEQ {
117129
!params.remove_ribo_rna && params.remove_ribo_rna
118130
)
119131

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

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

175205
//
176206
// Get attribute from genome config file e.g. fasta
@@ -184,9 +214,3 @@ def getGenomeAttribute(attribute) {
184214
}
185215
return null
186216
}
187-
188-
/*
189-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
190-
THE END
191-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192-
*/

modules/nf-core/multiqc/nextflow.config

Lines changed: 7 additions & 17 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)

0 commit comments

Comments
 (0)