mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-09-21 15:52:05 +00:00
52 lines
2 KiB
Text
52 lines
2 KiB
Text
|
// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters.
|
||
|
// All other parameters MUST be provided using the "task.ext" directive, see here:
|
||
|
// https://www.nextflow.io/docs/latest/process.html#ext
|
||
|
// where "task.ext" is a string.
|
||
|
// Any parameters that need to be evaluated in the context of a particular sample
|
||
|
// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately.
|
||
|
// TODO nf-core: Software that can be piped together SHOULD be added to separate module files
|
||
|
// unless there is a run-time, storage advantage in implementing in this way
|
||
|
// e.g. it's ok to have a single module for bwa to output BAM instead of SAM:
|
||
|
// bwa mem | samtools view -B -T ref.fasta
|
||
|
|
||
|
process VSEARCH_USEARCHGLOBAL {
|
||
|
tag '$queryfasta'
|
||
|
label 'process_low'
|
||
|
|
||
|
conda (params.enable_conda ? "bioconda::vsearch=2.21.1" : null)
|
||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||
|
'https://depot.galaxyproject.org/singularity/vsearch:2.21.1--hf1761c0_1':
|
||
|
'quay.io/biocontainers/vsearch:2.21.1--h95f258a_0' }"
|
||
|
|
||
|
input:
|
||
|
path queryfasta
|
||
|
path db
|
||
|
val outprefix
|
||
|
|
||
|
// TODO nf-core: Where applicable please provide/convert compressed files as input/output
|
||
|
// e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc.
|
||
|
|
||
|
output:
|
||
|
path ("*.tsv") , emit: tsv
|
||
|
path "versions.yml" , emit: versions
|
||
|
|
||
|
when:
|
||
|
task.ext.when == null || task.ext.when
|
||
|
|
||
|
script:
|
||
|
def args = task.ext.args ?: ''
|
||
|
"""
|
||
|
vsearch \\
|
||
|
--usearch_global $queryfasta \\
|
||
|
--db $db \\
|
||
|
--threads $task.cpus \\
|
||
|
$args \\
|
||
|
--blast6out ${outprefix}.tsv
|
||
|
|
||
|
cat <<-END_VERSIONS > versions.yml
|
||
|
"${task.process}":
|
||
|
vsearch: \$(vsearch --version 2>&1 | head -n 1 | sed 's/vsearch //g' | sed 's/,.*//g' | sed 's/^v//' | sed 's/_.*//')
|
||
|
END_VERSIONS
|
||
|
"""
|
||
|
}
|