Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/nf-core/gawk/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ process GAWK {
def args = task.ext.args ?: '' // args is used for the main arguments of the tool
def args2 = task.ext.args2 ?: '' // args2 is used to specify a program when no program file has been given
prefix = task.ext.prefix ?: "${meta.id}"
suffix = task.ext.suffix ?: "${input.collect{ it.getExtension()}.get(0)}" // use the first extension of the input files
suffix = task.ext.suffix ?: "${input.collect{ file -> file.getExtension()}.get(0)}" // use the first extension of the input files

program = program_file ? "-f ${program_file}" : "${args2}"
lst_gz = input.findResults{ it.getExtension().endsWith("gz") ? it.toString() : null }
lst_gz = input.findResults{ file -> file.getExtension().endsWith("gz") ? file.toString() : null }
unzip = lst_gz ? "gunzip -q -f ${lst_gz.join(" ")}" : ""
input_cmd = input.collect { it.toString() - ~/\.gz$/ }.join(" ")
input_cmd = input.collect { file -> file.toString() - ~/\.gz$/ }.join(" ")
output_cmd = suffix.endsWith("gz") ? "| gzip > ${prefix}.${suffix}" : "> ${prefix}.${suffix}"
output = disable_redirect_output ? "" : output_cmd
cleanup = lst_gz ? "rm ${lst_gz.collect{ it - ~/\.gz$/ }.join(" ")}" : ""
cleanup = lst_gz ? "rm ${lst_gz.collect{ file -> file - ~/\.gz$/ }.join(" ")}" : ""

input.collect{
assert it.name != "${prefix}.${suffix}" : "Input and output names are the same, set prefix in module configuration to disambiguate!"
Expand Down
Loading