-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.nf
170 lines (147 loc) · 5.14 KB
/
main.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/usr/bin/env nextflow
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nf-core/riboseq
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Github : https://github.com/nf-core/riboseq
Website: https://nf-co.re/riboseq
Slack : https://nfcore.slack.com/channels/riboseq
----------------------------------------------------------------------------------------
*/
nextflow.enable.dsl = 2
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
include { RIBOSEQ } from './workflows/riboseq'
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_riboseq_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_riboseq_pipeline'
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_riboseq_pipeline'
include { checkMaxContigSize } from './subworkflows/local/utils_nfcore_riboseq_pipeline'
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
params.fasta = getGenomeAttribute('fasta')
params.transcript_fasta = getGenomeAttribute('transcript_fasta')
params.additional_fasta = getGenomeAttribute('additional_fasta')
params.gtf = getGenomeAttribute('gtf')
params.gff = getGenomeAttribute('gff')
params.bbsplit_index = getGenomeAttribute('bbsplit')
params.star_index = getGenomeAttribute('star')
params.salmon_index = getGenomeAttribute('salmon')
params.sortmerna_index = getGenomeAttribute('sortmerna')
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NAMED WORKFLOWS FOR PIPELINE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
//
// WORKFLOW: Run main analysis pipeline depending on type of input
//
workflow NFCORE_RIBOSEQ {
main:
ch_versions = Channel.empty()
//
// SUBWORKFLOW: Prepare reference genome files
//
PREPARE_GENOME (
params.fasta,
params.gtf,
params.gff,
params.additional_fasta,
params.transcript_fasta,
params.bbsplit_fasta_list,
params.ribo_database_manifest,
params.star_index,
params.salmon_index,
params.bbsplit_index,
params.sortmerna_index,
params.gencode,
params.aligner,
params.pseudo_aligner,
params.skip_gtf_filter,
params.skip_bbsplit,
! params.remove_ribo_rna,
params.skip_alignment
)
ch_versions = ch_versions.mix(PREPARE_GENOME.out.versions)
// Check if contigs in genome fasta file > 512 Mbp
if (!params.skip_alignment && !params.bam_csi_index) {
PREPARE_GENOME
.out
.fai
.map { checkMaxContigSize(it) }
}
//
// WORKFLOW: Run nf-core/riboseq workflow
//
ch_samplesheet = Channel.value(file(params.input, checkIfExists: true))
if (params.contrasts){
ch_contrasts_file = Channel.value(file(params.contrasts))
} else {
ch_contrasts_file = []
}
RIBOSEQ (
ch_samplesheet,
ch_contrasts_file,
ch_versions,
PREPARE_GENOME.out.fasta,
PREPARE_GENOME.out.gtf,
PREPARE_GENOME.out.fai,
PREPARE_GENOME.out.chrom_sizes,
PREPARE_GENOME.out.transcript_fasta,
PREPARE_GENOME.out.star_index,
PREPARE_GENOME.out.salmon_index,
PREPARE_GENOME.out.bbsplit_index,
PREPARE_GENOME.out.sortmerna_index,
)
ch_versions = ch_versions.mix(RIBOSEQ.out.versions)
emit:
multiqc_report = RIBOSEQ.out.multiqc_report // channel: /path/to/multiqc_report.html
versions = ch_versions // channel: [version1, version2, ...]
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN MAIN WORKFLOW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
workflow {
main:
//
// SUBWORKFLOW: Run initialisation tasks
//
PIPELINE_INITIALISATION (
params.version,
params.help,
params.validate_params,
params.monochrome_logs,
args,
params.outdir,
params.input
)
//
// WORKFLOW: Run main workflow
//
NFCORE_RIBOSEQ ()
//
// SUBWORKFLOW: Run completion tasks
//
PIPELINE_COMPLETION (
params.email,
params.email_on_fail,
params.plaintext_email,
params.outdir,
params.monochrome_logs,
params.hook_url,
NFCORE_RIBOSEQ.out.multiqc_report
)
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/