-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.nf
71 lines (58 loc) · 1.99 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
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
include { prokka } from './modules/prokka'
include { eggnog_db_download; eggnog_mapper } from './modules/eggnog_mapper'
include { kofamscan } from './modules/kofamscan'
include { kofamscan_db_download; merge_anvio; merge_eggnog_mapper; merge_kofamscan } from './modules/utils'
include { anvio_kofam_db_download; anvio_kofam} from './modules/anvio'
workflow {
Channel
.fromPath( params.genomes )
.map { file -> tuple(file.baseName, file) }
.set { genomes_ch }
// Prokka
if ( !params.skip_prokka ) {
prokka(genomes_ch)
}
// eggNOG
if ( params.run_eggnog ) {
if (params.eggnog_db == 'none') {
eggnog_db_download()
eggnog_db = eggnog_db_download.out.eggnog_db
}
else {
eggnog_db = file(params.eggnog_db, type: 'dir',
checkIfExists: true)
}
eggnog_mapper(prokka.out.faa, eggnog_db)
merge_eggnog_mapper(eggnog_mapper.out.annotations.collect())
}
// KofamScan
if ( params.run_kofamscan ) {
if (params.kofamscan_db == 'none') {
kofamscan_db_download()
kofamscan_db = kofamscan_db_download.out.kofamscan_db
}
else {
kofamscan_db = file(params.kofamscan_db, type: 'dir',
checkIfExists: true)
}
kofamscan(prokka.out.faa, kofamscan_db)
merge_kofamscan(kofamscan.out.hits.collect())
}
// Anvi'o kofam
if ( params.run_anvio_kofam ) {
if (params.anvio_kofam_db == 'none') {
anvio_kofam_db_download()
anvio_kofam_db = anvio_kofam_db_download.out.anvio_kofam_db
}
else {
anvio_kofam_db = file(params.anvio_kofam_db, type: 'dir',
checkIfExists: true)
}
anvio_kofam(genomes_ch, anvio_kofam_db)
merge_anvio(
anvio_kofam.out.hits.collect(),
anvio_kofam.out.modules.collect())
}
}