forked from nf-core/genomeqc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genome_and_annotation.nf
97 lines (71 loc) · 2.57 KB
/
genome_and_annotation.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
include { AGAT_CONVERTSPGXF2GXF } from '../../modules/nf-core/agat/convertspgxf2gxf'
include { LONGEST } from '../../modules/local/longest'
include { BUSCO_BUSCO } from '../../modules/nf-core/busco/busco/main'
include { QUAST } from '../../modules/nf-core/quast/main'
include { AGAT_SPSTATISTICS } from '../../modules/nf-core/agat/spstatistics/main'
include { GFFREAD } from '../../modules/local/gffread'
include { ORTHOFINDER } from '../../modules/nf-core/orthofinder/main'
workflow GENOME_AND_ANNOTATION {
take:
ch_fasta // channel: [ val(meta), [ fasta ] ]
ch_gff // channel: [ val(meta), [ gff ] ]
main:
ch_versions = Channel.empty()
// For tree plot
ch_tree_data = Channel.empty()
// TODO nf-core: substitute modules here for the modules of your subworkflow
// Check GFF integrity
ch_agat_gff = AGAT_CONVERTSPGXF2GXF(ch_gff).output_gff
//
// Run Quast
//
QUAST (
ch_fasta,
[[],[]],
ch_agat_gff
)
ch_versions = ch_versions.mix(QUAST.out.versions.first())
// For tree
ch_tree_data = ch_tree_data.mix(QUAST.out.tsv.map { tuple -> tuple[1] })
//
// Run GFFREAD
//
GFFREAD (
ch_fasta,
ch_gff
)
ch_versions = ch_versions.mix(GFFREAD.out.versions.first())
//
// MODULE: Run Orthofinder
//
ortho_ch = GFFREAD.out.longest.collect().map { it -> [[id:"orthofinder"], it] }
ORTHOFINDER (
ortho_ch,
[[],[]]
)
ch_versions = ch_versions.mix(ORTHOFINDER.out.versions)
//
// MODULE: Run BUSCO
//
BUSCO_BUSCO (
GFFREAD.out.proteins_busco,
"proteins", // Hard coded, it's the only possible option
params.busco_lineage,
params.busco_lineages_path ?: [],
params.busco_config ?: []
)
ch_versions = ch_versions.mix(BUSCO_BUSCO.out.versions.first())
ch_tree_data = ch_tree_data.mix(BUSCO_BUSCO.out.batch_summary.collect { meta, file -> file })
//
// Run AGAT Spstatistics
//
AGAT_SPSTATISTICS (
ch_gff
)
ch_versions = ch_versions.mix(AGAT_SPSTATISTICS.out.versions.first())
emit:
orthofinder = ORTHOFINDER.out.orthofinder // channel: [ val(meta), [folder] ]
//busco = BUSCO_BUSCO.out.batch_summary.collect { meta, file -> file }
tree_data = ch_tree_data.flatten().collect()
versions = ch_versions // channel: [ versions.yml ]
}