Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions modules/nf-core/csvtk/concat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ process CSVTK_CONCAT {
val out_format

output:
tuple val(meta), path("${prefix}.${out_extension}"), emit: csv
path "versions.yml" , emit: versions
tuple val(meta), path("${prefix}.${suffix}"), emit: csv
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
suffix = task.ext.suffix ?: (out_format == 'tsv' ? 'tsv' : 'csv')
def delimiter = in_format == "tsv" ? "\t" : (in_format == "csv" ? "," : in_format)
def out_delimiter = out_format == "tsv" ? "\t" : (out_format == "csv" ? "," : out_format)
out_extension = out_format == "tsv" ? 'tsv' : 'csv'
"""
csvtk \\
concat \\
$args \\
--num-cpus $task.cpus \\
--delimiter "${delimiter}" \\
--out-delimiter "${out_delimiter}" \\
--out-file ${prefix}.${out_extension} \\
--out-file ${prefix}.${suffix} \\
$csv

cat <<-END_VERSIONS > versions.yml
Expand All @@ -43,9 +43,9 @@ process CSVTK_CONCAT {

stub:
prefix = task.ext.prefix ?: "${meta.id}"
out_extension = out_format == "tsv" ? 'tsv' : 'csv'
suffix = task.ext.suffix ?: (out_format == 'tsv' ? 'tsv' : 'csv')
"""
touch ${prefix}.${out_extension}
touch ${prefix}.${suffix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/csvtk/concat/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ output:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- ${prefix}.${out_extension}:
- ${prefix}.${suffix}:
type: file
description: Concatenated CSV/TSV file
pattern: "*.{csv,tsv}"
Expand Down
Loading