2021-03-25 20:46:00 +00:00
|
|
|
// Import generic module functions
|
2021-09-27 08:41:24 +00:00
|
|
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
2021-03-25 20:46:00 +00:00
|
|
|
|
|
|
|
params.options = [:]
|
|
|
|
options = initOptions(params.options)
|
|
|
|
|
|
|
|
process MSISENSOR_SCAN {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_low'
|
|
|
|
publishDir "${params.outdir}",
|
|
|
|
mode: params.publish_dir_mode,
|
2021-04-09 16:23:56 +00:00
|
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
2021-03-25 20:46:00 +00:00
|
|
|
|
|
|
|
conda (params.enable_conda ? "bioconda::msisensor=0.5" : null)
|
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
|
|
|
container "https://depot.galaxyproject.org/singularity/msisensor:0.5--hb3646a4_2"
|
|
|
|
} else {
|
|
|
|
container "quay.io/biocontainers/msisensor:0.5--hb3646a4_2"
|
|
|
|
}
|
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(fasta)
|
|
|
|
|
|
|
|
output:
|
2021-10-01 13:04:56 +00:00
|
|
|
tuple val(meta), path("*.tab"), emit: txt
|
|
|
|
path "versions.yml" , emit: versions
|
2021-03-25 20:46:00 +00:00
|
|
|
|
|
|
|
script:
|
2021-10-01 13:04:56 +00:00
|
|
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
2021-03-25 20:46:00 +00:00
|
|
|
"""
|
|
|
|
msisensor \\
|
|
|
|
scan \\
|
|
|
|
-d $fasta \\
|
|
|
|
-o ${prefix}.msisensor_scan.tab \\
|
|
|
|
$options.args
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
${getProcessName(task.process)}:
|
|
|
|
${getSoftwareName(task.process)}: \$(msisensor 2>&1 | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p')
|
|
|
|
END_VERSIONS
|
2021-03-25 20:46:00 +00:00
|
|
|
"""
|
|
|
|
}
|