Bulk update modules to use versions.yml (#739)

* New functions.nf

* Convert code to create versions.yml

* Update meta.yml

* update output channel

* Fix more meta.yml

* Manually update remaining modules

* remove superflous echo

* Fix misformatted meta.yml files

* Fix yaml, was list instead of dict

* fix version for bcftools

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
Gregor Sturm 2021-09-27 10:41:24 +02:00 committed by GitHub
parent d73a988ff7
commit 906577873b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
744 changed files with 10399 additions and 7063 deletions

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process ABACAS {
output: output:
tuple val(meta), path('*.abacas*'), emit: results tuple val(meta), path('*.abacas*'), emit: results
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -40,6 +40,9 @@ process ABACAS {
mv nucmer.filtered.delta ${prefix}.abacas.nucmer.filtered.delta mv nucmer.filtered.delta ${prefix}.abacas.nucmer.filtered.delta
mv nucmer.tiling ${prefix}.abacas.nucmer.tiling mv nucmer.tiling ${prefix}.abacas.nucmer.tiling
mv unused_contigs.out ${prefix}.abacas.unused.contigs.out mv unused_contigs.out ${prefix}.abacas.unused.contigs.out
echo \$(abacas.pl -v 2>&1) | sed 's/^.*ABACAS.//; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(abacas.pl -v 2>&1 | sed 's/^.*ABACAS.//; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -51,7 +51,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,4 +1,4 @@
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process ADAPTERREMOVAL {
output: output:
tuple val(meta), path('*.fastq.gz'), emit: reads tuple val(meta), path('*.fastq.gz'), emit: reads
tuple val(meta), path('*.log') , emit: log tuple val(meta), path('*.log') , emit: log
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -41,7 +41,10 @@ process ADAPTERREMOVAL {
--seed 42 \\ --seed 42 \\
--gzip \\ --gzip \\
AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g")
END_VERSIONS
""" """
} else if (!meta.single_end && !meta.collapse) { } else if (!meta.single_end && !meta.collapse) {
""" """
@ -57,7 +60,10 @@ process ADAPTERREMOVAL {
--seed 42 \\ --seed 42 \\
--gzip \\ --gzip \\
AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g")
END_VERSIONS
""" """
} else { } else {
""" """
@ -73,7 +79,10 @@ process ADAPTERREMOVAL {
--gzip \\ --gzip \\
cat *.collapsed.gz *.collapsed.truncated.gz > ${prefix}.merged.fastq.gz cat *.collapsed.gz *.collapsed.truncated.gz > ${prefix}.merged.fastq.gz
AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g")
END_VERSIONS
""" """
} }

View file

@ -44,7 +44,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@maxibor" - "@maxibor"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process AGRVATE {
output: output:
tuple val(meta), path("${fasta.baseName}-results/${fasta.baseName}-summary.tab"), emit: summary tuple val(meta), path("${fasta.baseName}-results/${fasta.baseName}-summary.tab"), emit: summary
path "${fasta.baseName}-results" , emit: results_dir path "${fasta.baseName}-results" , emit: results_dir
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -34,6 +34,9 @@ process AGRVATE {
$options.args \\ $options.args \\
-i $fasta -i $fasta
echo \$(agrvate -v 2>&1) | sed 's/agrvate //;' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(agrvate -v 2>&1 | sed 's/agrvate //;')
END_VERSIONS
""" """
} }

View file

@ -41,6 +41,6 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@abhi18av" - "@abhi18av"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process ALLELECOUNTER {
output: output:
tuple val(meta), path("*.alleleCount"), emit: allelecount tuple val(meta), path("*.alleleCount"), emit: allelecount
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -36,6 +36,9 @@ process ALLELECOUNTER {
-b $bam \\ -b $bam \\
-o ${prefix}.alleleCount -o ${prefix}.alleleCount
alleleCounter --version > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(alleleCounter --version)
END_VERSIONS
""" """
} }

View file

@ -42,7 +42,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- alleleCount: - alleleCount:
type: file type: file
description: Allele count file description: Allele count file

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -26,7 +26,7 @@ process ARRIBA {
output: output:
tuple val(meta), path("*.fusions.tsv") , emit: fusions tuple val(meta), path("*.fusions.tsv") , emit: fusions
tuple val(meta), path("*.fusions.discarded.tsv"), emit: fusions_fail tuple val(meta), path("*.fusions.discarded.tsv"), emit: fusions_fail
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -42,6 +42,9 @@ process ARRIBA {
$blacklist \\ $blacklist \\
$options.args $options.args
echo \$(arriba -h | grep 'Version:' 2>&1) | sed 's/Version:\s//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(arriba -h | grep 'Version:' 2>&1 | sed 's/Version:\s//')
END_VERSIONS
""" """
} }

View file

@ -40,7 +40,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- fusions: - fusions:
type: file type: file
description: File contains fusions which pass all of Arriba's filters. description: File contains fusions which pass all of Arriba's filters.

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process ARTIC_GUPPYPLEX {
output: output:
tuple val(meta), path("*.fastq.gz"), emit: fastq tuple val(meta), path("*.fastq.gz"), emit: fastq
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -36,6 +36,9 @@ process ARTIC_GUPPYPLEX {
--output ${prefix}.fastq --output ${prefix}.fastq
pigz -p $task.cpus *.fastq pigz -p $task.cpus *.fastq
echo \$(artic --version 2>&1) | sed 's/^.*artic //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(artic --version 2>&1 | sed 's/^.*artic //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -37,7 +37,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -40,7 +40,7 @@ process ARTIC_MINION {
tuple val(meta), path("${prefix}.pass.vcf.gz") , emit: vcf tuple val(meta), path("${prefix}.pass.vcf.gz") , emit: vcf
tuple val(meta), path("${prefix}.pass.vcf.gz.tbi") , emit: tbi tuple val(meta), path("${prefix}.pass.vcf.gz.tbi") , emit: tbi
tuple val(meta), path("*.json"), optional:true , emit: json tuple val(meta), path("*.json"), optional:true , emit: json
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -68,6 +68,9 @@ process ARTIC_MINION {
$scheme \\ $scheme \\
$prefix $prefix
echo \$(artic --version 2>&1) | sed 's/^.*artic //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(artic --version 2>&1 | sed 's/^.*artic //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -106,7 +106,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BAMALIGNCLEANER {
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -35,6 +35,9 @@ process BAMALIGNCLEANER {
-o ${prefix}.bam \\ -o ${prefix}.bam \\
${bam} ${bam}
echo \$(bamAlignCleaner --version) | sed 's/.*version //' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bamAlignCleaner --version | sed 's/.*version //')
END_VERSIONS
""" """
} }

View file

@ -30,7 +30,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- bam: - bam:
type: file type: file
description: Sorted BAM/CRAM file description: Sorted BAM/CRAM file

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BANDAGE_IMAGE {
output: output:
tuple val(meta), path('*.png'), emit: png tuple val(meta), path('*.png'), emit: png
tuple val(meta), path('*.svg'), emit: svg tuple val(meta), path('*.svg'), emit: svg
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -33,6 +33,9 @@ process BANDAGE_IMAGE {
Bandage image $gfa ${prefix}.png $options.args Bandage image $gfa ${prefix}.png $options.args
Bandage image $gfa ${prefix}.svg $options.args Bandage image $gfa ${prefix}.svg $options.args
echo \$(Bandage --version 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(Bandage --version 2>&1 | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -38,6 +38,6 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@heuermh" - "@heuermh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BBMAP_ALIGN {
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -54,6 +54,9 @@ process BBMAP_ALIGN {
threads=$task.cpus \\ threads=$task.cpus \\
-Xmx${task.memory.toGiga()}g -Xmx${task.memory.toGiga()}g
echo \$(bbversion.sh) > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bbversion.sh)
END_VERSIONS
""" """
} }

View file

@ -42,7 +42,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- bam: - bam:
type: file type: file
description: BAM file description: BAM file

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,4 +1,4 @@
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BBMAP_BBDUK {
output: output:
tuple val(meta), path('*.fastq.gz'), emit: reads tuple val(meta), path('*.fastq.gz'), emit: reads
tuple val(meta), path('*.log') , emit: log tuple val(meta), path('*.log') , emit: log
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -42,6 +42,9 @@ process BBMAP_BBDUK {
$options.args \\ $options.args \\
$contaminants_fa \\ $contaminants_fa \\
&> ${prefix}.bbduk.log &> ${prefix}.bbduk.log
echo \$(bbversion.sh) > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bbversion.sh)
END_VERSIONS
""" """
} }

View file

@ -42,7 +42,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- log: - log:
type: file type: file
description: Bbduk log file description: Bbduk log file

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BBMAP_INDEX {
output: output:
path 'ref' , emit: index path 'ref' , emit: index
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -34,6 +34,9 @@ process BBMAP_INDEX {
threads=$task.cpus \\ threads=$task.cpus \\
-Xmx${task.memory.toGiga()}g -Xmx${task.memory.toGiga()}g
echo \$(bbversion.sh) > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bbversion.sh)
END_VERSIONS
""" """
} }

View file

@ -23,7 +23,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- db: - db:
type: directory type: directory
description: Directory with index files description: Directory with index files

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BCFTOOLS_CONCAT {
output: output:
tuple val(meta), path("*.gz"), emit: vcf tuple val(meta), path("*.gz"), emit: vcf
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -35,6 +35,9 @@ process BCFTOOLS_CONCAT {
--threads $task.cpus \\ --threads $task.cpus \\
${vcfs} ${vcfs}
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -37,6 +37,6 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@abhi18av" - "@abhi18av"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BCFTOOLS_CONSENSUS {
output: output:
tuple val(meta), path('*.fa'), emit: fasta tuple val(meta), path('*.fa'), emit: fasta
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -33,6 +33,9 @@ process BCFTOOLS_CONSENSUS {
header=\$(head -n 1 ${prefix}.fa | sed 's/>//g') header=\$(head -n 1 ${prefix}.fa | sed 's/>//g')
sed -i 's/\${header}/${meta.id}/g' ${prefix}.fa sed -i 's/\${header}/${meta.id}/g' ${prefix}.fa
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -42,7 +42,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BCFTOOLS_FILTER {
output: output:
tuple val(meta), path("*.gz"), emit: vcf tuple val(meta), path("*.gz"), emit: vcf
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -34,6 +34,9 @@ process BCFTOOLS_FILTER {
$options.args \\ $options.args \\
$vcf $vcf
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -34,7 +34,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BCFTOOLS_ISEC {
output: output:
tuple val(meta), path("${prefix}"), emit: results tuple val(meta), path("${prefix}"), emit: results
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -33,6 +33,9 @@ process BCFTOOLS_ISEC {
$options.args \\ $options.args \\
-p $prefix \\ -p $prefix \\
*.vcf.gz *.vcf.gz
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -42,7 +42,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BCFTOOLS_MERGE {
output: output:
tuple val(meta), path("*.gz"), emit: vcf tuple val(meta), path("*.gz"), emit: vcf
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -33,6 +33,9 @@ process BCFTOOLS_MERGE {
--output ${prefix}.vcf.gz \\ --output ${prefix}.vcf.gz \\
$options.args \\ $options.args \\
*.vcf.gz *.vcf.gz
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -40,7 +40,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -26,7 +26,7 @@ process BCFTOOLS_MPILEUP {
tuple val(meta), path("*.gz") , emit: vcf tuple val(meta), path("*.gz") , emit: vcf
tuple val(meta), path("*.tbi") , emit: tbi tuple val(meta), path("*.tbi") , emit: tbi
tuple val(meta), path("*stats.txt"), emit: stats tuple val(meta), path("*stats.txt"), emit: stats
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -42,6 +42,9 @@ process BCFTOOLS_MPILEUP {
| bcftools view --output-file ${prefix}.vcf.gz --output-type z $options.args3 | bcftools view --output-file ${prefix}.vcf.gz --output-type z $options.args3
tabix -p vcf -f ${prefix}.vcf.gz tabix -p vcf -f ${prefix}.vcf.gz
bcftools stats ${prefix}.vcf.gz > ${prefix}.bcftools_stats.txt bcftools stats ${prefix}.vcf.gz > ${prefix}.bcftools_stats.txt
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -46,7 +46,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BCFTOOLS_NORM {
output: output:
tuple val(meta), path("*.gz") , emit: vcf tuple val(meta), path("*.gz") , emit: vcf
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -37,6 +37,9 @@ process BCFTOOLS_NORM {
--threads $task.cpus \\ --threads $task.cpus \\
${vcf} ${vcf}
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -40,6 +40,6 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@abhi18av" - "@abhi18av"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -26,7 +26,7 @@ process BCFTOOLS_QUERY {
output: output:
tuple val(meta), path("*.gz") , emit: vcf tuple val(meta), path("*.gz") , emit: vcf
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -44,6 +44,9 @@ process BCFTOOLS_QUERY {
$options.args \\ $options.args \\
${vcf} ${vcf}
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -56,6 +56,6 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@abhi18av" - "@abhi18av"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -25,7 +25,7 @@ process BCFTOOLS_REHEADER {
output: output:
tuple val(meta), path("*.vcf.gz"), emit: vcf tuple val(meta), path("*.vcf.gz"), emit: vcf
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -42,6 +42,9 @@ process BCFTOOLS_REHEADER {
-o ${prefix}.vcf.gz \\ -o ${prefix}.vcf.gz \\
$vcf $vcf
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -41,7 +41,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- vcf: - vcf:
type: file type: file
description: VCF with updated header description: VCF with updated header

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,13 +23,16 @@ process BCFTOOLS_STATS {
output: output:
tuple val(meta), path("*stats.txt"), emit: stats tuple val(meta), path("*stats.txt"), emit: stats
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
""" """
bcftools stats $options.args $vcf > ${prefix}.bcftools_stats.txt bcftools stats $options.args $vcf > ${prefix}.bcftools_stats.txt
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -35,7 +35,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -26,7 +26,7 @@ process BCFTOOLS_VIEW {
output: output:
tuple val(meta), path("*.gz") , emit: vcf tuple val(meta), path("*.gz") , emit: vcf
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -46,6 +46,9 @@ process BCFTOOLS_VIEW {
--threads $task.cpus \\ --threads $task.cpus \\
${vcf} ${vcf}
echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
""" """
} }

View file

@ -57,6 +57,6 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@abhi18av" - "@abhi18av"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BEDTOOLS_BAMTOBED {
output: output:
tuple val(meta), path("*.bed"), emit: bed tuple val(meta), path("*.bed"), emit: bed
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -35,6 +35,9 @@ process BEDTOOLS_BAMTOBED {
-i $bam \\ -i $bam \\
| bedtools sort > ${prefix}.bed | bedtools sort > ${prefix}.bed
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -31,7 +31,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@yuukiiwa" - "@yuukiiwa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BEDTOOLS_COMPLEMENT {
output: output:
tuple val(meta), path('*.bed'), emit: bed tuple val(meta), path('*.bed'), emit: bed
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -37,6 +37,9 @@ process BEDTOOLS_COMPLEMENT {
$options.args \\ $options.args \\
> ${prefix}.bed > ${prefix}.bed
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -35,7 +35,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@Emiller88" - "@Emiller88"
- "@sruthipsuresh" - "@sruthipsuresh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -25,7 +25,7 @@ process BEDTOOLS_GENOMECOV {
output: output:
tuple val(meta), path("*.${extension}"), emit: genomecov tuple val(meta), path("*.${extension}"), emit: genomecov
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -38,7 +38,10 @@ process BEDTOOLS_GENOMECOV {
$options.args \\ $options.args \\
> ${prefix}.${extension} > ${prefix}.${extension}
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} else { } else {
""" """
@ -49,7 +52,10 @@ process BEDTOOLS_GENOMECOV {
$options.args \\ $options.args \\
> ${prefix}.${extension} > ${prefix}.${extension}
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }
} }

View file

@ -38,7 +38,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@Emiller88" - "@Emiller88"
- "@sruthipsuresh" - "@sruthipsuresh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BEDTOOLS_GETFASTA {
output: output:
path "*.fa" , emit: fasta path "*.fa" , emit: fasta
path "*.version.txt", emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -37,6 +37,9 @@ process BEDTOOLS_GETFASTA {
-bed $bed \\ -bed $bed \\
-fo ${prefix}.fa -fo ${prefix}.fa
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -27,7 +27,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BEDTOOLS_INTERSECT {
output: output:
tuple val(meta), path("*.${extension}"), emit: intersect tuple val(meta), path("*.${extension}"), emit: intersect
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -37,6 +37,9 @@ process BEDTOOLS_INTERSECT {
$options.args \\ $options.args \\
> ${prefix}.${extension} > ${prefix}.${extension}
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -38,7 +38,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@Emiller88" - "@Emiller88"
- "@sruthipsuresh" - "@sruthipsuresh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BEDTOOLS_MAKEWINDOWS {
output: output:
tuple val(meta), path("*.tab"), emit: tab tuple val(meta), path("*.tab"), emit: tab
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -37,6 +37,9 @@ process BEDTOOLS_MAKEWINDOWS {
$options.args \\ $options.args \\
> ${prefix}.tab > ${prefix}.tab
echo \$(bedtools --version) | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -34,7 +34,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
- tab: - tab:
type: file type: file
description: Windows TAB file (BED or BED-like format) description: Windows TAB file (BED or BED-like format)

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BEDTOOLS_MASKFASTA {
output: output:
tuple val(meta), path("*.fa"), emit: fasta tuple val(meta), path("*.fa"), emit: fasta
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -36,6 +36,9 @@ process BEDTOOLS_MASKFASTA {
-fi $fasta \\ -fi $fasta \\
-bed $bed \\ -bed $bed \\
-fo ${prefix}.fa -fo ${prefix}.fa
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -37,7 +37,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@joseespinosa" - "@joseespinosa"
- "@drpatelh" - "@drpatelh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BEDTOOLS_MERGE {
output: output:
tuple val(meta), path('*.bed'), emit: bed tuple val(meta), path('*.bed'), emit: bed
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -35,6 +35,9 @@ process BEDTOOLS_MERGE {
$options.args \\ $options.args \\
> ${prefix}.bed > ${prefix}.bed
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -31,7 +31,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@Emiller88" - "@Emiller88"
- "@sruthipsuresh" - "@sruthipsuresh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -24,7 +24,7 @@ process BEDTOOLS_SLOP {
output: output:
tuple val(meta), path("*.bed"), emit: bed tuple val(meta), path("*.bed"), emit: bed
path "*.version.txt" , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -37,7 +37,10 @@ process BEDTOOLS_SLOP {
$options.args \\ $options.args \\
> ${prefix}.bed > ${prefix}.bed
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -31,7 +31,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@Emiller88" - "@Emiller88"
- "@sruthipsuresh" - "@sruthipsuresh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,7 +23,7 @@ process BEDTOOLS_SORT {
output: output:
tuple val(meta), path('*.bed'), emit: bed tuple val(meta), path('*.bed'), emit: bed
path '*.version.txt' , emit: version path "versions.yml" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -35,6 +35,9 @@ process BEDTOOLS_SORT {
$options.args \\ $options.args \\
> ${prefix}.bed > ${prefix}.bed
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
""" """
} }

View file

@ -31,7 +31,7 @@ output:
- version: - version:
type: file type: file
description: File containing software version description: File containing software version
pattern: "*.{version.txt}" pattern: "versions.yml"
authors: authors:
- "@Emiller88" - "@Emiller88"
- "@sruthipsuresh" - "@sruthipsuresh"

View file

@ -9,6 +9,13 @@ def getSoftwareName(task_process) {
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
} }
//
// Extract name of module from process name using $task.process
//
def getProcessName(task_process) {
return task_process.tokenize(':')[-1]
}
// //
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
// //
@ -37,9 +44,13 @@ def getPathFromList(path_list) {
// Function to save/publish module results // Function to save/publish module results
// //
def saveFiles(Map args) { def saveFiles(Map args) {
if (!args.filename.endsWith('.version.txt')) {
def ioptions = initOptions(args.options) def ioptions = initOptions(args.options)
def path_list = [ ioptions.publish_dir ?: args.publish_dir ] def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
// Do not publish versions.yml unless running from pytest workflow
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
return null
}
if (ioptions.publish_by_meta) { if (ioptions.publish_by_meta) {
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
for (key in key_list) { for (key in key_list) {
@ -64,5 +75,4 @@ def saveFiles(Map args) {
} else if (ioptions.publish_files == null) { } else if (ioptions.publish_files == null) {
return "${getPathFromList(path_list)}/$args.filename" return "${getPathFromList(path_list)}/$args.filename"
} }
}
} }

Some files were not shown because too many files have changed in this diff Show more