-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
64 lines (49 loc) · 1.75 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
#!/usr/bin/env nextflow
// **** Included workflows and processes from modules ****
include { example } from './modules/example'
include { simulate_sce } from './modules/simulate-sce'
include { merge_sce } from './modules/merge-sce'
include { detect_doublets } from './modules/doublet-detection'
include { seurat_conversion } from './modules/seurat-conversion'
include { cell_type_consensus } from './modules/cell-type-consensus'
// **** Parameter checks ****
param_error = false
// Set data release path
if (!params.release_bucket) {
log.error("Release bucket not specified")
param_error = true
}
def release_dir = Utils.getReleasePath(params.release_bucket, params.release_prefix)
if (!release_dir.exists()) {
log.error "Release directory does not exist: ${release_dir}"
param_error = true
}
if (param_error) {
System.exit(1)
}
workflow test {
example()
}
workflow simulate {
project_ids = params.project?.tokenize(';, ') ?: []
run_all = project_ids.isEmpty() || project_ids[0].toLowerCase() == 'all'
project_ch = Channel.fromList(Utils.getProjectTuples(release_dir))
.filter{ run_all || it[0] in project_ids }
simulate_sce(project_ch)
}
// **** Default workflow ****
workflow {
project_ids = params.project?.tokenize(';, ') ?: []
run_all = project_ids.isEmpty() || project_ids[0].toLowerCase() == 'all'
// sample channel of [sample_id, project_id, sample_path]
sample_ch = Channel.fromList(Utils.getSampleTuples(release_dir))
.filter{ run_all || it[1] in project_ids }
// Run the merge workflow
merge_sce(sample_ch)
// Run the doublet detection workflow
detect_doublets(sample_ch)
// Run the seurat conversion workflow
seurat_conversion(sample_ch)
// Run the consensus cell type workflow
cell_type_consensus(sample_ch)
}