From eda870358696cf14175ebb898db584f14329e3aa Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Mon, 23 Oct 2023 14:07:51 -0400 Subject: [PATCH] feat: keep unpaired fastq; write stub --- modules/CCBR/picard/samtofastq/main.nf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/CCBR/picard/samtofastq/main.nf b/modules/CCBR/picard/samtofastq/main.nf index 63c7db7..7d538dc 100644 --- a/modules/CCBR/picard/samtofastq/main.nf +++ b/modules/CCBR/picard/samtofastq/main.nf @@ -8,7 +8,7 @@ process PICARD_SAMTOFASTQ { tuple val(meta), path(bam) output: - tuple val(meta), path("*.fastq"), emit: reads + tuple val(meta), path("*.fastq.gz"), emit: reads path "versions.yml" , emit: versions when: @@ -17,7 +17,7 @@ process PICARD_SAMTOFASTQ { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def output = meta.single_end ? "--FASTQ ${prefix}.fastq.gz" : "--FASTQ ${prefix}_1.fastq.gz --SECOND_END_FASTQ ${prefix}_2.fastq.gz" + def output = meta.single_end ? "--FASTQ ${prefix}.fastq" : "--FASTQ ${prefix}_1.fastq --SECOND_END_FASTQ ${prefix}_2.fastq --UNPAIRED_FASTQ ${prefix}.unpaired.fastq" if (!task.memory) { log.warn '[Picard SamToFastq] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -32,9 +32,17 @@ process PICARD_SAMTOFASTQ { --INPUT ${bam} \\ ${output} + pigz -p ${task.cpus} *.fastq + cat <<-END_VERSIONS > versions.yml "${task.process}": picard: \$(picard SamToFastq --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.fastq.gz + """ }