-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
58 lines (48 loc) · 2.48 KB
/
main.nf
File metadata and controls
58 lines (48 loc) · 2.48 KB
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
#!/usr/bin/env nextflow
/*
* BioXend Pipeline — MIX-MB ChEMBL Submission Generator
*
* Usage:
* nextflow run main.nf -profile docker \
* --input Standards/Templates/Template_open.ods \
* --outdir results/ \
* --prefix HMDM
* --xenobiotic_class drug
*/
include { BIOXEND } from './workflows/bioxend'
// ─────────────────────────────────────────────────────────────────────────────
// Parameter validation
// ─────────────────────────────────────────────────────────────────────────────
if (!params.input) {
log.error "ERROR: --input is required. Provide the path to Template_open.ods."
exit 1
}
if (!params.prefix) {
log.error "ERROR: --prefix is required. Provide a prefix for the output files."
exit 1
}
if (!params.xenobiotic_class) {
log.error "ERROR: --xenobiotic_class is required. Provide the xenobiotic class."
exit 1
}
// ─────────────────────────────────────────────────────────────────────────────
// Entry point
// ─────────────────────────────────────────────────────────────────────────────
workflow {
BIOXEND()
}
// ─────────────────────────────────────────────────────────────────────────────
// Completion hooks
// ─────────────────────────────────────────────────────────────────────────────
workflow.onComplete {
def status = workflow.success ? "SUCCESS" : "FAILED"
log.info """
Pipeline ${status}
Duration : ${workflow.duration}
Output dir : ${params.outdir}
Exit status: ${workflow.exitStatus}
""".stripIndent()
}
workflow.onError {
log.error "Pipeline failed: ${workflow.errorMessage}"
}