Skip to content

Commit 786b16f

Browse files
author
Pablo Riesgo Ferreiro
committed
fixed the output files when steps are skipped
1 parent 29c08ea commit 786b16f

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

main.nf

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,29 @@ if (!params.skip_realignment) {
224224
}
225225
}
226226
else {
227-
realigned_bams = deduplicated_bams
227+
process skipRealignmentAroundindels {
228+
cpus 1
229+
memory '16m'
230+
tag "${name}"
231+
232+
input:
233+
set name, bam_name, type, file(bam), file(bai) from deduplicated_bams
234+
235+
output:
236+
set val(name), val(bam_name), val(type), file("${bam}"), file("${bai}") into realigned_bams
237+
238+
"""
239+
echo "ZZZZZ..."
240+
"""
241+
}
228242
}
229243

230244
if (!params.skip_bqsr) {
231245
process baseQualityScoreRecalibration {
232246
cpus 3
233247
memory '4g'
234248
module 'java/1.8.0' // GATK requires Java 8
235-
publishDir "${publish_dir}", mode: "move"
249+
publishDir "${publish_dir}", mode: "copy"
236250
tag "${name}"
237251

238252
input:
@@ -266,21 +280,21 @@ else {
266280
process createOutput {
267281
cpus 1
268282
memory '1g'
269-
publishDir "${publish_dir}", mode: "move"
283+
publishDir "${publish_dir}", mode: "copy"
270284
tag "${name}"
271285

272286
input:
273287
set name, bam_name, type, file(bam), file(bai) from realigned_bams
274288

275289
output:
276290
set val("${name}"), val("${type}"), val("${publish_dir}/${bam_name}.preprocessed.bam") into recalibrated_bams
277-
file "${bam_name}.preprocessed.bam" into recalibrated_bam
278-
file "${bam_name}.preprocessed.bai" into recalibrated_bai
291+
file "${bam_name}.preprocessed.bam" into recalibrated_bam
292+
file "${bam_name}.preprocessed.bai" into recalibrated_bai
279293

280-
"""
281-
mv ${bam} ${bam_name}.preprocessed.bam
282-
mv ${bai} ${bam_name}.preprocessed.bai
283-
"""
294+
"""
295+
cp ${bam} ${bam_name}.preprocessed.bam
296+
cp ${bai} ${bam_name}.preprocessed.bai
297+
"""
284298
}
285299
}
286300

0 commit comments

Comments
 (0)