Skip to content

Commit

Permalink
fixed the output files when steps are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Riesgo Ferreiro committed Feb 4, 2020
1 parent 29c08ea commit 786b16f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
32 changes: 23 additions & 9 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,29 @@ 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) {
process baseQualityScoreRecalibration {
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:
Expand Down Expand Up @@ -266,21 +280,21 @@ else {
process createOutput {
cpus 1
memory '1g'
publishDir "${publish_dir}", mode: "move"
publishDir "${publish_dir}", mode: "copy"
tag "${name}"

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

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
"""
}
}

Expand Down

0 comments on commit 786b16f

Please sign in to comment.