From 786b16fef60b7bcf9365b5872d6395a646d43306 Mon Sep 17 00:00:00 2001 From: Pablo Riesgo Ferreiro Date: Tue, 4 Feb 2020 16:44:58 +0100 Subject: [PATCH] fixed the output files when steps are skipped --- .gitignore | 1 + main.nf | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/main.nf b/main.nf index 5b79ac8..a136436 100755 --- a/main.nf +++ b/main.nf @@ -224,7 +224,21 @@ if (!params.skip_realignment) { } } else { - realigned_bams = deduplicated_bams + process skipRealignmentAroundindels { + cpus 1 + memory '16m' + tag "${name}" + + input: + set name, bam_name, type, file(bam), file(bai) from deduplicated_bams + + output: + set val(name), val(bam_name), val(type), file("${bam}"), file("${bai}") into realigned_bams + + """ + echo "ZZZZZ..." + """ + } } if (!params.skip_bqsr) { @@ -232,7 +246,7 @@ if (!params.skip_bqsr) { cpus 3 memory '4g' module 'java/1.8.0' // GATK requires Java 8 - publishDir "${publish_dir}", mode: "move" + publishDir "${publish_dir}", mode: "copy" tag "${name}" input: @@ -266,7 +280,7 @@ else { process createOutput { cpus 1 memory '1g' - publishDir "${publish_dir}", mode: "move" + publishDir "${publish_dir}", mode: "copy" tag "${name}" input: @@ -274,13 +288,13 @@ else { output: set val("${name}"), val("${type}"), val("${publish_dir}/${bam_name}.preprocessed.bam") into recalibrated_bams - file "${bam_name}.preprocessed.bam" into recalibrated_bam - file "${bam_name}.preprocessed.bai" into recalibrated_bai + file "${bam_name}.preprocessed.bam" into recalibrated_bam + file "${bam_name}.preprocessed.bai" into recalibrated_bai - """ - mv ${bam} ${bam_name}.preprocessed.bam - mv ${bai} ${bam_name}.preprocessed.bai - """ + """ + cp ${bam} ${bam_name}.preprocessed.bam + cp ${bai} ${bam_name}.preprocessed.bai + """ } }