1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-25 04:29:54 +00:00
taxprofiler/modules/nf-core/taxpasta/merge/main.nf

48 lines
1.6 KiB
Text
Raw Normal View History

2023-02-16 13:29:52 +00:00
process TAXPASTA_MERGE {
tag "$meta.id"
label 'process_single'
2023-03-01 21:12:09 +00:00
conda "bioconda::taxpasta=0.2.1"
2023-02-16 13:29:52 +00:00
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
2023-03-01 21:12:09 +00:00
'https://depot.galaxyproject.org/singularity/taxpasta:0.2.1--pyhdfd78af_0':
'quay.io/biocontainers/taxpasta:0.2.1--pyhdfd78af_0' }"
2023-02-16 13:29:52 +00:00
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
"""
}