-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.nf
98 lines (78 loc) · 4.45 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
#!/usr/bin/env nextflow
//enable domain-specific-language 2
nextflow.enable.dsl=2
/**
---------------------------------------------------------------------------------
function definition
---------------------------------------------------------------------------------
*/
def helpMe() {
log.info """
Overview:
Nextflow pipeline for estimation of evolutionary rate using Bayesian statistics.
Usage:
nextflow run main.nf [OPTIONS]
Mandatory arguments:
--multi_fa Multi-fasta file containing consensus seqs of interest
--prefix Prefix used for result files - avoids overwriting
Optional arguments:
--out_dir Output directory to place final BEAST-FLOW results [./output]
--conda_cache File system path where Conda env is to be stored [BEAST-FLOW/work/]
--evo_model Evolutionary model used to generate phylogenetic tree [GTR+G]
--run_part2 Continue with subsequent analysis after manual check of temporal signal [false]
--run_part3 Continue with subsequent analysis after manual check for MCMC convergence & mixing [false]
--xml_args Input parameters for generating xml for BEAST. Use <beast2-xml.py --help>
for full list of options [--chainLength 1000000 --sequenceIdAgeRegex...]
--xml_temp Template used to generate xml, differs depending on clock used [strict.xml]
--beast_args Parameters for BEAST run. Use <beast -help> for all options [-overwrite]
--treeann_args TreeAnnotator arguments. Use <treeannotator -help> for options [-burnin 10]
--iqtree_args IQ-TREE arguments. Use <iqtree --help> for more options [-T 4 -B 1000]
--version Current BEAST-FLOW version number
--help This usage statement
"""
}
def version() {
log.info """
BEAST-FLOW version: ${workflow.manifest.version}
"""
}
//displays help upon request
if (params.help) {
helpMe()
exit 0 //stop running
}
//version upon request
if (params.version) {
version()
exit 0
}
/**
---------------------------------------------------------------------------------
program introduction
---------------------------------------------------------------------------------
*/
// this prints program header with mandatory input
log.info """
██████╗░███████╗░█████╗░░██████╗████████╗░░░░░░███████╗██╗░░░░░░█████╗░░██╗░░░░░░░██╗
██╔══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝░░░░░░██╔════╝██║░░░░░██╔══██╗░██║░░██╗░░██║
██████╦╝█████╗░░███████║╚█████╗░░░░██║░░░█████╗█████╗░░██║░░░░░██║░░██║░╚██╗████╗██╔╝
██╔══██╗██╔══╝░░██╔══██║░╚═══██╗░░░██║░░░╚════╝██╔══╝░░██║░░░░░██║░░██║░░████╔═████║░
██████╦╝███████╗██║░░██║██████╔╝░░░██║░░░░░░░░░██║░░░░░███████╗╚█████╔╝░░╚██╔╝░╚██╔╝░
╚═════╝░╚══════╝╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░░░░░░░╚═╝░░░░░╚══════╝░╚════╝░░░░╚═╝░░░╚═╝░░
\n=====================================================================================
multi-fasta: ${params.multi_fa}
prefix: ${params.prefix}
results folder: ${params.out_dir}
"""
/**
---------------------------------------------------------------------------------
import processes from modules
---------------------------------------------------------------------------------
*/
include { MSA } from "${projectDir}/modules/msa.nf"
include { TREE } from "${projectDir}/modules/tree.nf"
include { BEAST } from "${projectDir}/modules/beast.nf"
workflow {
MSA | TREE
BEAST(MSA.out)
}