-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.nf
60 lines (48 loc) · 2.02 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
#!/usr/bin/env nextflow
include { ISMB_BOSC_2024 } from './workflows/ismb_bosc_2024'
include { BIOTECHX_2024 } from './workflows/biotechx_basel_2024'
include { PUBLISH_REPORT } from './modules/local/publish_report'
workflow {
main:
ascii = Channel.fromPath("${projectDir}/assets/ismb_bosc2024/ismb_bosc_ascii_art.txt")
congrats = Channel.fromPath("${projectDir}/assets/congratulations.txt")
html_report = Channel.fromPath("${projectDir}/assets/ticket_template.html")
// Input validation
if (!params.event) {
error "Please specify an event using --event parameter"
}
// Event selection
switch(params.event) {
case "ismb_bosc2024":
if (!params.name || !params.email || !params.institute) {
error "Please provide --name, --email, and --institute parameters for ISMB/BOSC 2024"
}
ISMB_BOSC_2024(ascii, congrats)
event = "ISMB\\/BOSC 2024"
ticket_number = params.ticket_number_emit_session_id ? ISMB_BOSC_2024.out.session_id : ISMB_BOSC_2024.out.run_name
break
case "biotechx_basel_2024":
if (!params.email) {
error "Please provide --email parameter to enter the raffle at BiotechX Basel 2024."
}
BIOTECHX_2024()
event = "BiotechX BASEL 2024"
ticket_number = params.ticket_number_emit_session_id ? BIOTECHX_2024.out.session_id : BIOTECHX_2024.out.run_name
break
default:
error "Unknown event: ${params.event}. Supported events are 'ismb_bosc2024' and 'biotechx_basel_2024'"
}
PUBLISH_REPORT(html_report, event, ticket_number)
// Display help message
if (params.help) {
log.info """
Usage:
nextflow run seqeralabs/nf-raffle --event [event_name]
Supported event names:
- ismb_bosc2024
- biotechx_basel_2024
For more information for an event, use the --help flag for that event.
"""
System.exit(0)
}
}