Skip to content

Commit

Permalink
feat: keep unpaired fastq; write stub
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Oct 23, 2023
1 parent d8d5c6f commit eda8703
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/CCBR/picard/samtofastq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.'
Expand All @@ -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
"""
}

0 comments on commit eda8703

Please sign in to comment.