-
Notifications
You must be signed in to change notification settings - Fork 1
/
empirical.nf
174 lines (127 loc) · 2.87 KB
/
empirical.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/local/bin nextflow
Channel
.fromPath("/shared/homes/13444841/rec-bench/data/*.fasta")
.into { phi_fa; tseq_fa; gc_fa; uc_fa; gmos_fa }
params.out = "/shared/homes/13444841/2105_empirical"
log.info """
===== DIRECTORIES AND PATHS =====
base = ${baseDir}
bin = ${params.bin}
out = ${params.out}
"""
process E1_phi_profile {
label "empirical"
tag "$seq"
publishDir "${params.out}", mode: 'move', saveAs: { filename -> "${seq}_$filename" }
conda 'bioconda::phipack=1.1'
input:
path seq from phi_fa
output:
path 'Profile.csv'
path 'Profile.log'
script:
"""
Profile -f ${seq}
"""
}
process E2_3seq {
label "empirical"
tag "$seq"
publishDir "${params.out}", mode: 'move'
input:
path seq from tseq_fa
output:
file '*3s.log'
file '*3s.pvalHist'
file '*s.rec'
file '*3s.longRec' optional true
script:
"""
echo "Y" |
3seq_elf -f ${seq} -d -id ${seq}
"""
}
process E3_geneconv {
label "empirical"
tag "$seq"
publishDir "${params.out}", mode: 'move'
input:
path seq from gc_fa
output:
file '*.tab'
script:
"""
geneconv $seq -nolog -Dumptab -Fancy
"""
}
process E4_filter_fasta {
label "empirical"
publishDir "${params.out}/E0_filter_fasta"
conda 'python=3.7.3 matplotlib=3.1.0'
input:
path seq from uc_fa
output:
path 'seqLength*.png' optional true
path '*_m'
path '*_n'
path '*_n_filtered' into E4_input_uchime_derep
path '*_removed'
path '*_log.txt'
script:
"""
python3 ${params.bin}/S1_filter_fasta.py $seq
"""
}
process E4_uchime_derep {
label "empirical"
tag "$seq"
publishDir "${params.out}/E4_uchime_derep"
conda 'bioconda::vsearch=2.14'
input:
path seq from E4_input_uchime_derep
output:
path 'derep_*' into E4_input_uchime
script:
"""
vsearch --derep_fulllength ${seq} \
--output derep_${seq} \
--sizeout
"""
}
process E4_uchime {
label "empirical"
tag "$seq"
publishDir "${params.out}", mode: 'move'
conda "bioconda::vsearch=2.14"
input:
path seq from E4_input_uchime
output:
path '*.rc'
path '*.nonrc'
path '*.log'
script:
"""
vsearch --uchime_denovo ${seq} \
--chimeras ${seq}.rc \
--nonchimeras ${seq}.nonrc \
--log ${seq}.log
"""
}
process E5_gmos {
label "empirical"
tag "$seq"
publishDir "${params.out}", mode: 'move'
input:
path seq from gmos_fa
output:
path '*.fasta'
path '*.len'
path '*.txt'
script:
"""
${params.bin}/gmos -i ${seq} \
-j ${seq} \
-o gmos_${seq} \
-t
"""
}