-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtiff-to-n5.nf
executable file
·72 lines (53 loc) · 1.7 KB
/
tiff-to-n5.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
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
// path to the TIFF series
params.inputPath = ""
// path to the output n5
params.outputPath = ""
// path to the output dataset
params.outputDataset = "/s0"
// chunk size for n5
params.blockSize = "512,512,512"
// config for running single process
params.mem_gb = 32
params.cpus = 10
// config for running on cluster
params.numWorkers = 0
include { getOptions } from '../utils'
process tif_to_n5 {
container "janeliascicomp/n5-tools-py:1.0.1"
containerOptions { getOptions([inputPath, outputPath]) }
memory { "${params.mem_gb} GB" }
cpus { params.cpus }
input:
tuple val(inputPath), val(outputPath), val(outputDataset), val(blockSize)
output:
tuple val(outputPath), val(outputDataset)
script:
"""
/entrypoint.sh tif_to_n5 -i $inputPath -o $outputPath -d $outputDataset -c $blockSize
"""
}
process tif_to_n5_cluster {
container "janeliascicomp/n5-tools-py:1.0.0"
containerOptions { getOptions([inputPath, outputPath]) }
memory { "${params.mem_gb} GB" }
cpus { params.cpus }
input:
tuple val(inputPath), val(outputPath), val(outputDataset), val(blockSize), val(numWorkers)
output:
tuple val(outputPath), val(outputDataset)
script:
"""
/entrypoint.sh tif_to_n5 -i $inputPath -o $outputPath -d $outputDataset -c $blockSize \
--distributed --workers $numWorkers --dashboard
"""
}
workflow {
if (params.numWorkers>0) {
tif_to_n5_cluster([params.inputPath, params.outputPath, params.outputDataset, params.blockSize, params.numWorkers])
}
else {
tif_to_n5([params.inputPath, params.outputPath, params.outputDataset, params.blockSize])
}
}