2022-05-01 05:18:14 +00:00
process FILTLONG {
tag "$meta.id"
label 'process_low'
2022-12-23 16:23:05 +00:00
conda "bioconda::filtlong=0.2.1"
2022-05-01 05:18:14 +00:00
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/filtlong:0.2.1--h9a82719_0' :
'quay.io/biocontainers/filtlong:0.2.1--h9a82719_0' }"
input:
tuple val(meta), path(shortreads), path(longreads)
output:
2022-05-31 18:11:19 +00:00
tuple val(meta), path("*.fastq.gz"), emit: reads
2022-07-12 15:15:36 +00:00
tuple val(meta), path("*.log") , emit: log
path "versions.yml" , emit: versions
2022-05-01 05:18:14 +00:00
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
2022-05-31 18:11:19 +00:00
def short_reads = !shortreads ? "" : meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}"
if ("$longreads" == "${prefix}.fastq.gz") error "Longread FASTQ input and output names are the same, set prefix in module configuration to disambiguate!"
2022-05-01 05:18:14 +00:00
"""
filtlong \\
$short_reads \\
$args \\
$longreads \\
2022-07-12 15:15:36 +00:00
2> ${prefix}.log \\
2022-05-31 18:11:19 +00:00
| gzip -n > ${prefix}.fastq.gz
2022-05-01 05:18:14 +00:00
cat <<-END_VERSIONS > versions.yml
"${task.process}":
filtlong: \$( filtlong --version | sed -e "s/Filtlong v//g" )
END_VERSIONS
"""
}