kkonganti@0: process SOURMASH_GATHER { kkonganti@0: tag "$meta.id" kkonganti@0: label 'process_micro' kkonganti@0: kkonganti@0: module (params.enable_module ? "${params.swmodulepath}${params.fs}sourmash${params.fs}4.6.1" : null) kkonganti@0: conda (params.enable_conda ? "conda-forge::python bioconda::sourmash=4.6.1" : null) kkonganti@0: container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? kkonganti@0: 'https://depot.galaxyproject.org/singularity/sourmash:4.6.1--hdfd78af_0': kkonganti@0: 'quay.io/biocontainers/sourmash:4.6.1--hdfd78af_0' }" kkonganti@0: kkonganti@0: input: kkonganti@0: tuple val(meta), path(signature), path(database) kkonganti@0: val save_unassigned kkonganti@0: val save_matches_sig kkonganti@0: val save_prefetch kkonganti@0: val save_prefetch_csv kkonganti@0: kkonganti@0: output: kkonganti@0: tuple val(meta), path("*.csv.gz") , emit: result , optional: true kkonganti@0: tuple val(meta), path("*_scaffolded_genomic.fna.gz"), emit: genomes_fasta, optional: true kkonganti@0: tuple val(meta), path("*_unassigned.sig.zip") , emit: unassigned , optional: true kkonganti@0: tuple val(meta), path("*_matches.sig.zip") , emit: matches , optional: true kkonganti@0: tuple val(meta), path("*_prefetch.sig.zip") , emit: prefetch , optional: true kkonganti@0: tuple val(meta), path("*_prefetch.csv.gz") , emit: prefetchcsv , optional: true kkonganti@0: path "*FAILED.txt" , emit: failed , optional: true kkonganti@0: path "versions.yml" , emit: versions kkonganti@0: kkonganti@0: when: kkonganti@0: task.ext.when == null || task.ext.when kkonganti@0: kkonganti@0: script: kkonganti@0: def args = task.ext.args ?: '' kkonganti@0: def args2 = task.ext.args2 ?: '' kkonganti@0: def prefix = task.ext.prefix ?: "${meta.id}" kkonganti@0: def unassigned = save_unassigned ? "--output-unassigned ${prefix}_unassigned.sig.zip" : '' kkonganti@0: def matches = save_matches_sig ? "--save-matches ${prefix}_matches.sig.zip" : '' kkonganti@0: def prefetch = save_prefetch ? "--save-prefetch ${prefix}_prefetch.sig.zip" : '' kkonganti@0: def prefetchcsv = save_prefetch_csv ? "--save-prefetch-csv ${prefix}_prefetch.csv.gz" : '' kkonganti@0: kkonganti@0: """ kkonganti@0: sourmash gather \\ kkonganti@0: $args \\ kkonganti@0: --output ${prefix}.csv.gz \\ kkonganti@0: ${unassigned} \\ kkonganti@0: ${matches} \\ kkonganti@0: ${prefetch} \\ kkonganti@0: ${prefetchcsv} \\ kkonganti@0: ${signature} \\ kkonganti@0: ${database} kkonganti@0: kkonganti@0: sourmash_filter_hits.py \\ kkonganti@0: $args2 \\ kkonganti@0: -csv ${prefix}.csv.gz kkonganti@0: kkonganti@0: cat <<-END_VERSIONS > versions.yml kkonganti@0: "${task.process}": kkonganti@0: sourmash: \$(echo \$(sourmash --version 2>&1) | sed 's/^sourmash //' ) kkonganti@0: python: \$( python --version | sed 's/Python //g' ) kkonganti@0: END_VERSIONS kkonganti@0: """ kkonganti@0: }