2022-10-14 12:48:27 +00:00
|
|
|
process KRAKEN2_STANDARD_REPORT {
|
2022-10-14 08:56:14 +00:00
|
|
|
tag "$meta.id"
|
2022-10-14 10:18:07 +00:00
|
|
|
label 'process_single'
|
2022-10-14 08:56:14 +00:00
|
|
|
|
|
|
|
conda (params.enable_conda ? 'conda-forge::sed=4.8' : null)
|
2022-10-14 10:18:07 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv2/biocontainers_v1.2.0_cv2.img' :
|
|
|
|
'biocontainers/biocontainers:v1.2.0_cv2' }"
|
2022-10-14 08:56:14 +00:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(report)
|
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(meta), path(result), emit: report
|
2022-10-14 10:49:07 +00:00
|
|
|
path 'versions.yml' , emit: versions
|
2022-10-14 08:56:14 +00:00
|
|
|
|
2022-10-14 10:18:07 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2022-10-14 08:56:14 +00:00
|
|
|
script:
|
2022-10-14 10:18:07 +00:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
|
|
result = "${prefix}_standardized.kraken2.report.txt"
|
2022-10-14 08:56:14 +00:00
|
|
|
"""
|
2022-10-14 10:18:07 +00:00
|
|
|
cut -f1-3,6-8 '${report}' > '${result}'
|
2022-10-14 10:49:07 +00:00
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
"${task.process}":
|
|
|
|
cut: \$(echo \$(cut --version 2>&1) | sed 's/^.*(GNU coreutils) //; s/ Copyright.*\$//')
|
|
|
|
END_VERSIONS
|
2022-10-14 08:56:14 +00:00
|
|
|
"""
|
|
|
|
}
|
|
|
|
|