-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.nf
More file actions
86 lines (67 loc) · 2.28 KB
/
main.nf
File metadata and controls
86 lines (67 loc) · 2.28 KB
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
#!/usr/bin/env nextflow
//
// MODULE IMPORT BLOCK
//
include { FIND_TELOMERE_REGIONS } from '../../../modules/local/find/telomere_regions/main'
include { GAWK_SPLIT_DIRECTIONS } from '../../../modules/local/gawk_split_directions/main'
include { TELO_EXTRACTION } from '../../../subworkflows/local/telo_extraction/main'
workflow TELO_FINDER {
take:
reference_tuple // Channel [ val(meta), path(fasta) ]
teloseq
main:
ch_versions = channel.empty()
//
// MODULE: FINDS THE TELOMERIC SEQEUNCE IN REFERENCE
//
FIND_TELOMERE_REGIONS (
reference_tuple,
teloseq
)
ch_versions = ch_versions.mix( FIND_TELOMERE_REGIONS.out.versions )
//
// MODULE: SPLIT THE TELOMERE FILE INTO 5' and 3' FILES
// THIS IS RUNNING ON A LOCAL VERSION OF THE GAWK MODULE
//
if (params.split_telomere) {
GAWK_SPLIT_DIRECTIONS (
FIND_TELOMERE_REGIONS.out.telomere,
file("${projectDir}/bin/gawk_split_directions.awk")
)
ch_versions = ch_versions.mix( GAWK_SPLIT_DIRECTIONS.out.versions )
GAWK_SPLIT_DIRECTIONS.out.prime5
.map { meta, file ->
tuple( [id: meta.id + "_5P"], file)
}
.set { prime5_telo }
GAWK_SPLIT_DIRECTIONS.out.prime3
.map { meta, file ->
tuple( [id: meta.id + "_3P"], file)
}
.set { prime3_telo }
prime5_telo
.mix(prime3_telo)
.mix(FIND_TELOMERE_REGIONS.out.telomere)
.set { telo_for_extraction }
} else {
telo_for_extraction = FIND_TELOMERE_REGIONS.out.telomere
}
//
// SUBWORKFLOW: TELO_EXTRACTION
// - The prime5.mix(prime3) creates a queue channel to execute
// TELO_EXTRACTION per item in channel
//
TELO_EXTRACTION (
telo_for_extraction
)
ch_versions = ch_versions.mix( TELO_EXTRACTION.out.versions )
TELO_EXTRACTION.out.bedgraph_file
.map{ _meta, bedgraph ->
bedgraph
}
.collect()
.set { telo_bedgraphs }
emit:
bedgraph_file = telo_bedgraphs // Used in pretext_graph
versions = ch_versions
}