@@ -65,8 +65,6 @@ workflow PREPARE_GENOME {
65
65
skip_pseudo_alignment // boolean: Skip all of the pseudoalignment-based processes within the pipeline
66
66
67
67
main :
68
- // Versions collector
69
- ch_versions = Channel . empty()
70
68
71
69
// ---------------------------
72
70
// 1) Uncompress GTF or GFF -> GTF
@@ -75,20 +73,17 @@ workflow PREPARE_GENOME {
75
73
if (gtf) {
76
74
if (gtf. endsWith(' .gz' )) {
77
75
ch_gtf = GUNZIP_GTF ([ [:], file(gtf, checkIfExists : true ) ]). gunzip. map { it[1 ] }
78
- ch_versions = ch_versions. mix(GUNZIP_GTF . out. versions)
79
76
} else {
80
77
ch_gtf = Channel . value(file(gtf, checkIfExists : true ))
81
78
}
82
79
} else if (gff) {
83
80
def ch_gff
84
81
if (gff. endsWith(' .gz' )) {
85
82
ch_gff = GUNZIP_GFF ([ [:], file(gff, checkIfExists : true ) ]). gunzip
86
- ch_versions = ch_versions. mix(GUNZIP_GFF . out. versions)
87
83
} else {
88
84
ch_gff = Channel . value(file(gff, checkIfExists : true )). map { [ [:], it ] }
89
85
}
90
86
ch_gtf = GFFREAD (ch_gff, []). gtf. map { it[1 ] }
91
- ch_versions = ch_versions. mix(GFFREAD . out. versions)
92
87
}
93
88
94
89
// -------------------------------------
@@ -101,7 +96,6 @@ workflow PREPARE_GENOME {
101
96
// Uncompress FASTA if needed
102
97
if (fasta. endsWith(' .gz' )) {
103
98
ch_fasta = GUNZIP_FASTA ([ [:], file(fasta, checkIfExists : true ) ]). gunzip. map { it[1 ] }
104
- ch_versions = ch_versions. mix(GUNZIP_FASTA . out. versions)
105
99
} else {
106
100
ch_fasta = Channel . value(file(fasta, checkIfExists : true ))
107
101
}
@@ -119,7 +113,6 @@ workflow PREPARE_GENOME {
119
113
if (filter_gtf_needed) {
120
114
GTF_FILTER (ch_fasta, ch_gtf)
121
115
ch_gtf = GTF_FILTER . out. genome_gtf. first()
122
- ch_versions = ch_versions. mix(GTF_FILTER . out. versions)
123
116
}
124
117
125
118
// ---------------------------------------------------
@@ -129,7 +122,6 @@ workflow PREPARE_GENOME {
129
122
if (fasta_provided && additional_fasta) {
130
123
if (additional_fasta. endsWith(' .gz' )) {
131
124
ch_add_fasta = GUNZIP_ADDITIONAL_FASTA ([ [:], file(additional_fasta, checkIfExists : true ) ]). gunzip. map { it[1 ] }
132
- ch_versions = ch_versions. mix(GUNZIP_ADDITIONAL_FASTA . out. versions)
133
125
} else {
134
126
ch_add_fasta = Channel . value(file(additional_fasta, checkIfExists : true ))
135
127
}
@@ -141,7 +133,6 @@ workflow PREPARE_GENOME {
141
133
)
142
134
ch_fasta = CUSTOM_CATADDITIONALFASTA . out. fasta. map { it[1 ] }. first()
143
135
ch_gtf = CUSTOM_CATADDITIONALFASTA . out. gtf. map { it[1 ] }. first()
144
- ch_versions = ch_versions. mix(CUSTOM_CATADDITIONALFASTA . out. versions)
145
136
}
146
137
147
138
// ------------------------------------------------------
@@ -151,13 +142,11 @@ workflow PREPARE_GENOME {
151
142
if (gene_bed) {
152
143
if (gene_bed. endsWith(' .gz' )) {
153
144
ch_gene_bed = GUNZIP_GENE_BED ([ [:], file(gene_bed, checkIfExists : true ) ]). gunzip. map { it[1 ] }
154
- ch_versions = ch_versions. mix(GUNZIP_GENE_BED . out. versions)
155
145
} else {
156
146
ch_gene_bed = Channel . value(file(gene_bed, checkIfExists : true ))
157
147
}
158
148
} else {
159
149
ch_gene_bed = GTF2BED (ch_gtf). bed
160
- ch_versions = ch_versions. mix(GTF2BED . out. versions)
161
150
}
162
151
163
152
// ----------------------------------------------------------------------
@@ -170,19 +159,16 @@ workflow PREPARE_GENOME {
170
159
// Use user-provided transcript FASTA
171
160
if (transcript_fasta. endsWith(' .gz' )) {
172
161
ch_transcript_fasta = GUNZIP_TRANSCRIPT_FASTA ([ [:], file(transcript_fasta, checkIfExists : true ) ]). gunzip. map { it[1 ] }
173
- ch_versions = ch_versions. mix(GUNZIP_TRANSCRIPT_FASTA . out. versions)
174
162
} else {
175
163
ch_transcript_fasta = Channel . value(file(transcript_fasta, checkIfExists : true ))
176
164
}
177
165
if (gencode) {
178
166
PREPROCESS_TRANSCRIPTS_FASTA_GENCODE (ch_transcript_fasta)
179
167
ch_transcript_fasta = PREPROCESS_TRANSCRIPTS_FASTA_GENCODE . out. fasta
180
- ch_versions = ch_versions. mix(PREPROCESS_TRANSCRIPTS_FASTA_GENCODE . out. versions)
181
168
}
182
169
} else if (fasta_provided) {
183
170
// Build transcripts from genome if we have it
184
171
ch_transcript_fasta = MAKE_TRANSCRIPTS_FASTA (ch_fasta, ch_gtf). transcript_fasta
185
- ch_versions = ch_versions. mix(MAKE_TRANSCRIPTS_FASTA . out. versions)
186
172
}
187
173
188
174
// -------------------------------------------------------
@@ -194,7 +180,6 @@ workflow PREPARE_GENOME {
194
180
CUSTOM_GETCHROMSIZES (ch_fasta. map { [ [:], it ] })
195
181
ch_fai = CUSTOM_GETCHROMSIZES . out. fai. map { it[1 ] }
196
182
ch_chrom_sizes = CUSTOM_GETCHROMSIZES . out. sizes. map { it[1 ] }
197
- ch_versions = ch_versions. mix(CUSTOM_GETCHROMSIZES . out. versions)
198
183
}
199
184
200
185
// ------------------------------------------------
@@ -215,7 +200,6 @@ workflow PREPARE_GENOME {
215
200
// Use user-provided bbsplit index
216
201
if (bbsplit_index. endsWith(' .tar.gz' )) {
217
202
ch_bbsplit_index = UNTAR_BBSPLIT_INDEX ([ [:], file(bbsplit_index, checkIfExists : true ) ]). untar. map { it[1 ] }
218
- ch_versions = ch_versions. mix(UNTAR_BBSPLIT_INDEX . out. versions)
219
203
} else {
220
204
ch_bbsplit_index = Channel . value(file(bbsplit_index, checkIfExists : true ))
221
205
}
@@ -238,7 +222,6 @@ workflow PREPARE_GENOME {
238
222
ch_bbsplit_fasta_list,
239
223
true
240
224
). index
241
- ch_versions = ch_versions. mix(BBMAP_BBSPLIT . out. versions)
242
225
}
243
226
// else: no FASTA and no user-provided index -> remains empty
244
227
}
@@ -257,7 +240,6 @@ workflow PREPARE_GENOME {
257
240
if (sortmerna_index) {
258
241
if (sortmerna_index. endsWith(' .tar.gz' )) {
259
242
ch_sortmerna_index = UNTAR_SORTMERNA_INDEX ([ [:], file(sortmerna_index, checkIfExists : true ) ]). untar. map { it[1 ] }
260
- ch_versions = ch_versions. mix(UNTAR_SORTMERNA_INDEX . out. versions)
261
243
} else {
262
244
ch_sortmerna_index = Channel . value([ [:], file(sortmerna_index, checkIfExists : true ) ])
263
245
}
@@ -269,7 +251,6 @@ workflow PREPARE_GENOME {
269
251
Channel . of([ [], [] ])
270
252
)
271
253
ch_sortmerna_index = SORTMERNA_INDEX . out. index. first()
272
- ch_versions = ch_versions. mix(SORTMERNA_INDEX . out. versions)
273
254
}
274
255
}
275
256
@@ -281,7 +262,6 @@ workflow PREPARE_GENOME {
281
262
if (star_index) {
282
263
if (star_index. endsWith(' .tar.gz' )) {
283
264
ch_star_index = UNTAR_STAR_INDEX ([ [:], file(star_index, checkIfExists : true ) ]). untar. map { it[1 ] }
284
- ch_versions = ch_versions. mix(UNTAR_STAR_INDEX . out. versions)
285
265
} else {
286
266
ch_star_index = Channel . value(file(star_index, checkIfExists : true ))
287
267
}
@@ -295,13 +275,11 @@ workflow PREPARE_GENOME {
295
275
}
296
276
if (is_aws_igenome) {
297
277
ch_star_index = STAR_GENOMEGENERATE_IGENOMES (ch_fasta, ch_gtf). index
298
- ch_versions = ch_versions. mix(STAR_GENOMEGENERATE_IGENOMES . out. versions)
299
278
} else {
300
279
ch_star_index = STAR_GENOMEGENERATE (
301
280
ch_fasta. map { [ [:], it ] },
302
281
ch_gtf. map { [ [:], it ] }
303
282
). index. map { it[1 ] }
304
- ch_versions = ch_versions. mix(STAR_GENOMEGENERATE . out. versions)
305
283
}
306
284
}
307
285
}
@@ -314,14 +292,12 @@ workflow PREPARE_GENOME {
314
292
if (rsem_index) {
315
293
if (rsem_index. endsWith(' .tar.gz' )) {
316
294
ch_rsem_index = UNTAR_RSEM_INDEX ([ [:], file(rsem_index, checkIfExists : true ) ]). untar. map { it[1 ] }
317
- ch_versions = ch_versions. mix(UNTAR_RSEM_INDEX . out. versions)
318
295
} else {
319
296
ch_rsem_index = Channel . value(file(rsem_index, checkIfExists : true ))
320
297
}
321
298
}
322
299
else if (fasta_provided) {
323
300
ch_rsem_index = RSEM_PREPAREREFERENCE_GENOME (ch_fasta, ch_gtf). index
324
- ch_versions = ch_versions. mix(RSEM_PREPAREREFERENCE_GENOME . out. versions)
325
301
}
326
302
}
327
303
@@ -337,13 +313,11 @@ workflow PREPARE_GENOME {
337
313
}
338
314
else if (fasta_provided) {
339
315
ch_splicesites = HISAT2_EXTRACTSPLICESITES (ch_gtf. map { [ [:], it ] }). txt. map { it[1 ] }
340
- ch_versions = ch_versions. mix(HISAT2_EXTRACTSPLICESITES . out. versions)
341
316
}
342
317
// the index
343
318
if (hisat2_index) {
344
319
if (hisat2_index. endsWith(' .tar.gz' )) {
345
320
ch_hisat2_index = UNTAR_HISAT2_INDEX ([ [:], file(hisat2_index, checkIfExists : true ) ]). untar. map { it[1 ] }
346
- ch_versions = ch_versions. mix(UNTAR_HISAT2_INDEX . out. versions)
347
321
} else {
348
322
ch_hisat2_index = Channel . value(file(hisat2_index, checkIfExists : true ))
349
323
}
@@ -354,7 +328,6 @@ workflow PREPARE_GENOME {
354
328
ch_gtf. map { [ [:], it ] },
355
329
ch_splicesites. map { [ [:], it ] }
356
330
). index. map { it[1 ] }
357
- ch_versions = ch_versions. mix(HISAT2_BUILD . out. versions)
358
331
}
359
332
}
360
333
@@ -366,20 +339,17 @@ workflow PREPARE_GENOME {
366
339
if (salmon_index) {
367
340
if (salmon_index. endsWith(' .tar.gz' )) {
368
341
ch_salmon_index = UNTAR_SALMON_INDEX ( [ [:], salmon_index ] ). untar. map { it[1 ] }
369
- ch_versions = ch_versions. mix(UNTAR_SALMON_INDEX . out. versions)
370
342
} else {
371
343
ch_salmon_index = Channel . value(file(salmon_index))
372
344
}
373
345
} else if (' salmon' in prepare_tool_indices) {
374
346
if (ch_transcript_fasta && fasta_provided) {
375
347
// build from transcript FASTA + genome FASTA
376
348
ch_salmon_index = SALMON_INDEX (ch_fasta, ch_transcript_fasta). index
377
- ch_versions = ch_versions. mix(SALMON_INDEX . out. versions)
378
349
}
379
350
else if (ch_transcript_fasta) {
380
351
// some Salmon module can run with just a transcript FASTA
381
352
ch_salmon_index = SALMON_INDEX ([], ch_transcript_fasta). index
382
- ch_versions = ch_versions. mix(SALMON_INDEX . out. versions)
383
353
}
384
354
}
385
355
@@ -390,14 +360,12 @@ workflow PREPARE_GENOME {
390
360
if (kallisto_index) {
391
361
if (kallisto_index. endsWith(' .tar.gz' )) {
392
362
ch_kallisto_index = UNTAR_KALLISTO_INDEX ( [ [:], kallisto_index ] ). untar
393
- ch_versions = ch_versions. mix(UNTAR_KALLISTO_INDEX . out. versions)
394
363
} else {
395
364
ch_kallisto_index = Channel . value([[:], file(kallisto_index)])
396
365
}
397
366
} else {
398
367
if (' kallisto' in prepare_tool_indices) {
399
368
ch_kallisto_index = KALLISTO_INDEX ( ch_transcript_fasta. map { [ [:], it] } ). index
400
- ch_versions = ch_versions. mix(KALLISTO_INDEX . out. versions)
401
369
}
402
370
}
403
371
@@ -420,5 +388,4 @@ workflow PREPARE_GENOME {
420
388
hisat2_index = ch_hisat2_index // channel: path(hisat2/index/)
421
389
salmon_index = ch_salmon_index // channel: path(salmon/index/)
422
390
kallisto_index = ch_kallisto_index // channel: [ meta, path(kallisto/index/) ]
423
- versions = ch_versions. ifEmpty(null ) // channel: [ versions.yml ]
424
391
}
0 commit comments