2021-02-09 18:26:35 +00:00
|
|
|
process IVAR_CONSENSUS {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
2021-02-12 22:43:50 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::ivar=1.3.1" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
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' }"
|
2021-02-09 18:26:35 +00:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(bam)
|
2021-02-12 23:01:53 +00:00
|
|
|
path fasta
|
2021-02-09 18:26:35 +00:00
|
|
|
|
|
|
|
output:
|
2021-02-10 18:00:54 +00:00
|
|
|
tuple val(meta), path("*.fa") , emit: fasta
|
|
|
|
tuple val(meta), path("*.qual.txt"), emit: qual
|
2021-02-16 05:07:31 +00:00
|
|
|
tuple val(meta), path("*.mpileup") , optional:true, emit: mpileup
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-02-09 18:26:35 +00:00
|
|
|
|
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
|
|
|
def args2 = task.ext.args2 ?: ''
|
|
|
|
def prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
2021-02-12 22:43:50 +00:00
|
|
|
def save_mpileup = params.save_mpileup ? "tee ${prefix}.mpileup |" : ""
|
2021-02-09 18:26:35 +00:00
|
|
|
"""
|
|
|
|
samtools mpileup \\
|
2021-02-23 20:36:03 +00:00
|
|
|
--reference $fasta \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args2 \\
|
2021-02-09 18:26:35 +00:00
|
|
|
$bam | \\
|
2021-02-10 18:00:22 +00:00
|
|
|
$save_mpileup \\
|
2021-02-09 18:26:35 +00:00
|
|
|
ivar consensus \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2021-02-12 22:57:06 +00:00
|
|
|
-p $prefix
|
2021-02-09 18:26:35 +00:00
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
ivar: \$(echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-02-09 18:26:35 +00:00
|
|
|
"""
|
|
|
|
}
|