-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnextflow.config
160 lines (144 loc) · 4.62 KB
/
nextflow.config
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// Check for container availability Docker or Singularity
// Try to check if Docker is available and working
def dockerAvailable = false
try {
def dockerStatus = ["docker", "info"].execute().text
dockerAvailable = dockerStatus.contains("Server Version") // Check if Docker daemon is available
} catch (Exception e) {
// Docker is available but not running correctly
println "Docker is found but cannot connect to the Docker daemon. Skipping Docker."
}
// If Docker is not available or working, check for Singularity
if (dockerAvailable) {
docker.enabled = true
docker.runOptions = '-u $(id -u):$(id -g)' // Run container with user permissions
} else if (["/bin/bash", "-c", "which singularity"].execute().text) {
singularity.enabled = true
singularity.cacheDir = "${baseDir}/cluster" // Define Singularity cache directory for cluster environment
singularity.runOptions = '--nv' // Enable NVIDIA GPU support
} else {
println "Neither Docker nor Singularity is available. Please make sure either Docker or Singularity is installed and accessible."
System.exit(1) // Exit if neither Docker nor Singularity is available
}
// Configurable variables
params.name = "False"
params.project = "False"
params.email = "False"
params.plaintext_email = "False"
params.in_fastq = ""
params.outfile = "outfile"
params.ref_genome = ""
params.barcods = "EXP-NBD114 EXP-NBD104"
params.cpu = "7"
params.memory = "30 GB"
params.genomesize = "4800"
params.lowerlength = "1000"
params.upperlength = "20000"
params.sample_id = ""
params.raw_file = ""
params.pipeline = "assembly"
params.basecalling = "OFF"
params.basecallers = "basecaller"
params.model = "sup"
params.phred = "6"
params.min_score_rear_barcode = "75"
params.min_score_front_barcode = "75"
params.repr_percentile = "0.3"
params.score_threshold = "0.2"
params.kmer_size = "12"
params.maxLD_floats = "0.05"
params.maxGD_floats = "0.05"
params.rmMisassembly_bool = "True"
params.correctErr_bool = "True"
params.minAbun_floats = "0.2"
params.min_mq = "30"
params.topks = "100"
params.minovlplens = "1000"
params.minseedlens = "2000"
params.maxohs = "20"
params.split_size = "10000"
params.demultiplexing = "ON"
params.gpu = "0"
params.error_correction_tool = "vechat"
params.params.repr_percentile = "0.3"
params.params.score_threshold = "0.2"
params.params.kmer_size = "12"
// save process config files
process.shell = ['/bin/bash', '-euo', 'pipefail']
// computing requirements for each process
process {
withLabel: small_mem {
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
}
withLabel: bonobo_img {
container = 'nchis09/bonobo_image:latest'
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
}
withName: runDorado {
container = 'nanoporetech/dorado:latest'
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
containerOptions = { params.gpu == '1' ? (workflow.containerEngine == 'docker' ? '--gpus all' : '--nv') : '' }
}
withName: runBarcoding {
container = 'nanozoo/guppy_cpu:5.0.7-1--47b84be'
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
}
withName: runPolish_medaka {
container = 'nanozoo/medaka'
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
}
withName: runPolish_pilon {
container = 'nanozoo/pilon'
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
}
withName: runErrcorrectRattle {
container = 'xiang2019/rattle:latest'
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
}
withName: runErrcorrectVechat {
container = 'nchis09/vechat'
maxForks = "${params.cpu}"
cpus = "${params.cpu}"
memory = "${params.memory}"
containerOptions = { params.gpu == '1' ? (workflow.containerEngine == 'docker' ? '--gpus all' : '--nv') : '' }
}
}
executor {
queueSize = "${params.cpu}"
queue = 'long'
}
// reports
timeline {
enabled = true
overwrite = true
file = "${params.outfile}/final_reports/BonoboFlow_timeline.html"
}
report {
enabled = true
overwrite = true
file = "${params.outfile}/final_reports/BonoboFlow_report.html"
}
dag {
enabled = true
overwrite = true
file = "${params.outfile}/final_reports/BonoboFlow_DAG.html"
}
manifest {
homePage = 'https://github.com/nchis09/BonoboFlow'
description = 'Nextflow pipeline for viral reads error correction and assembly'
mainScript = 'BonoboFlow.nf'
}