-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.nf
118 lines (90 loc) · 3.68 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
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { NANOPORE } from "./workflows/nanopore"
include { ILLUMINA } from "./workflows/illumina"
// the sequencing platform used
params.platform = params.illumina_fastq_dir == "" ? "ont" : "illumina"
workflow {
frontMatter = """
.8888b
88 "
.d8888b. 88d888b. .d8888b. 88d888b. .d8888b. .d8888b. 88aaa
88' `88 88' `88 88ooood8 88' `88 88' `88 88' `88 88
88. .88 88 88 88. ... 88 88. .88 88. .88 88
`88888P' dP dP `88888P' dP `88888P' `88888P' dP
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oneroof: Base-, Variant-, and Consensus-calling under One Proverbial Roof
=========================================================================
`oneroof` is a bespoke bioinformatic pipeline that can handle Oxford
Nanopore POD5 basecalling, Illumina paired-end read-merging, read
alignment and variant-calling, variant-effect annotation, consensus
sequence calling, quality reporting, and phylogenetic tree-building, all
under "one roof."
(version 0.1.0)
=========================================================================
"""
.stripIndent()
if (params.help) {
Utils.helpMessage(workflow, log, frontMatter)
exit 0
}
log.info frontMatter
Utils.workflowDisplay(params, workflow, log, nextflow)
// Checking for required files
// ---------------------------------------------------------------------- //
// make sure a reference sequence FASTA, the minimum pipeline dependency, is
// provided and exists
assert params.refseq :
"Please provide a reference FASTA file with the parameter `refseq`."
assert file(params.refseq).isFile() :
"Please double check that the reference FASTA file provided with the parameter `refseq` exists."
// ---------------------------------------------------------------------- //
// initialize input channels
ch_primer_bed = params.primer_bed ?
Channel.fromPath( params.primer_bed ) :
Channel.empty()
ch_refseq = Channel
.fromPath( params.refseq )
ch_ref_gbk = params.ref_gbk ?
Channel.fromPath( params.ref_gbk ) :
Channel.empty()
ch_snpeff_config = params.snpEff_config ?
Channel.fromPath( params.snpEff_config ) :
Channel.empty()
ch_sample_lookup = params.sample_lookup ?
Channel.fromPath( params.sample_lookup ) :
Channel.empty()
// decide whether to run the ont or the illumina workflow
if ( params.platform == "ont" ) {
NANOPORE (
ch_primer_bed,
ch_refseq,
ch_ref_gbk,
ch_snpeff_config,
ch_sample_lookup
)
} else if ( params.platform == "illumina" ) {
ILLUMINA (
ch_primer_bed,
ch_refseq,
ch_ref_gbk,
ch_snpeff_config,
ch_sample_lookup
)
} else {
error """
Unrecognized platform provided with ${params.platform}. This pipeline only supports
Nanopore data with the keyword 'ont' and Illumina data with the keyword 'illumina'.
"""
}
if ( params.email ) {
workflow.onComplete {
def msg = """\
Oneroof has finished running with the following settings:
${Utils.workflowDisplay(params, workflow, log, nextflow)}
"""
.stripIndent()
sendMail(to: params.email, subject: 'Oneroof Execution Report', body: msg)
}
}
}