-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
97 lines (78 loc) · 2.94 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
#!/usr/bin/env nextflow
def logo() {
// Log colors ANSI codes
c_reset = "\033[0m";
c_dim = "\033[2m";
c_black = "\033[0;30m";
c_green = "\033[0;32m";
c_yellow = "\033[0;33m";
c_blue = "\033[0;34m";
c_purple = "\033[0;35m";
c_cyan = "\033[0;36m";
c_white = "\033[0;37m";
return """ ${c_dim}------------------------------------------------------------------------------${c_reset}${c_green}
____ __ ______ ____ ____ _ __ __
/ __ \\/ |/ / | / __ )_________ _ __________ _____ / __ )__ __(_) /___/ /
/ / / / /|_/ / /| | / __ / ___/ __ \\ | /| / / ___/ _ \\/ ___/ / __ / / / / / / __ /
/ /_/ / / / / ___ | / /_/ / / / /_/ / |/ |/ (__ ) __/ / / /_/ / /_/ / / / /_/ /
\\____/_/ /_/_/ |_| /_____/_/ \\____/|__/|__/____/\\___/_/ /_____/\\__,_/_/_/\\__,_/
${c_reset}${c_dim}------------------------------------------------------------------------------${c_reset}""".stripIndent()
}
// Print the logo
log.info logo()
// Load Plugins
include { validateParameters; paramsHelp; paramsSummaryLog } from 'plugin/nf-schema'
// Print help message if needed
if (params.help){
log.info paramsHelp("nextflow run main.nf required [optional]")
exit 0
}
// Validate input parameters
validateParameters()
// Subworkflows
// include {parse_inputs} from "./subworkflows/local/parse_inputs"
include {OMA_BROWSER_BUILD} from "./workflows/oma_browser_build"
nextflow.preview.output = true
workflow OMA_browser_build {
main:
// Print summary of supplied parameters
log.info paramsSummaryLog(workflow)
// Run the pipeline
// parse_inputs()
def genomes_dir = file(params.genomes_dir)
def matrix_file = file(params.matrix_file)
def hog_orthoxml = file(params.hog_orthoxml)
def vps_base = params.pairwise_orthologs_folder
OMA_BROWSER_BUILD(genomes_dir, matrix_file, hog_orthoxml, vps_base)
emit:
db = OMA_BROWSER_BUILD.out.db
seqidx = OMA_BROWSER_BUILD.out.seqidx_h5
downloads = OMA_BROWSER_BUILD.out.downloads
}
workflow {
main:
OMA_browser_build()
publish:
OMA_browser_build.out.db >> 'main_db'
OMA_browser_build.out.seqidx >> 'data'
OMA_browser_build.out.downloads >> 'downloads'
}
workflow.onComplete {
println "Pipeline completed at: ${workflow.complete}"
println "Time to complete workflow execution: ${workflow.duration}"
println "Execution status: ${workflow.success ? 'Successful' : 'Failed'}"
println "Reports stored in ${workflow.outputDir}/reports/nextflow"
}
workflow.onError {
println "Error... Pipeline execution stopped with the following message: $workflow.errorMessage"
}
output {
main_db {
path { db ->
{ file -> "data/OmaServer.h5" }
}
mode 'copy'
}
data { mode 'copy' }
downloads { mode 'copy' }
}