1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-14 17:33:09 +00:00
taxprofiler/modules/nf-core/taxpasta/merge/main.nf
2023-03-13 08:58:59 +01:00

47 lines
1.6 KiB
Text
Generated

process TAXPASTA_MERGE {
tag "$meta.id"
label 'process_single'
conda "bioconda::taxpasta=0.2.3"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/taxpasta:0.2.3--pyhdfd78af_0':
'quay.io/biocontainers/taxpasta:0.2.3--pyhdfd78af_0' }"
input:
tuple val(meta), path(profiles)
path taxonomy
path samplesheet
output:
tuple val(meta), path("*.{tsv,csv,arrow,parquet,biom}"), emit: merged_profiles
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
// N.B.: Taxpasta requires a --profiler option and will fail without it.
// This must be specified via a `nextflow.config` or `modules.config`, for
// example, as "--profiler kraken2". Additionally, it requires a --output
// option with the output file name. The desired format will be parsed from
// the name and should correspond to the output pattern specified above,
// e.g., "--output ${task.ext.prefix}.tsv".
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def taxonomy_option = taxonomy ? "--taxonomy ${taxonomy}" : ''
def samplesheet_input = samplesheet ? "-s ${samplesheet}" : ''
"""
taxpasta merge \\
$args \\
$taxonomy_option \\
$samplesheet_input \\
$profiles
cat <<-END_VERSIONS > versions.yml
"${task.process}":
taxpasta: \$(taxpasta --version)
END_VERSIONS
"""
}