nf-core_modules/modules/ivar/trim/main.nf
2022-02-04 09:53:32 +01:00

38 lines
1 KiB
Text

process IVAR_TRIM {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::ivar=1.3.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ivar:1.3.1--h089eab3_0' :
'quay.io/biocontainers/ivar:1.3.1--h089eab3_0' }"
input:
tuple val(meta), path(bam), path(bai)
path bed
output:
tuple val(meta), path("*.bam"), emit: bam
tuple val(meta), path('*.log'), emit: log
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
ivar trim \\
$args \\
-i $bam \\
-b $bed \\
-p $prefix \\
> ${prefix}.ivar.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
ivar: \$(echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//')
END_VERSIONS
"""
}