nf-core_modules/modules/checkm/lineagewf/main.nf
James A. Fellows Yates 03de60e6fa
Add CHECKM/QA (#2137)
* Bump checkM version and add support for pre-defined database

* Add markfile output to checkm/lineagewf and add checkm/qa

* Remove unnecessary BAM from tests

* Fix channels to ensure single meta

* Blah

* Use secondary name evwyhere

* Remove second incovcatiojn

* Don't run module directrly for join

* And for the other test

* Correct module name

* Fix name again

* Try and fix out_format 9 not being picked up

* Contains to matches to allow regex

* Fix tests (finally)

* Fix verisoning

* [automated] Fix linting with Prettier

* Update modules/checkm/qa/main.nf

Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com>

Co-authored-by: nf-core-bot <core@nf-co.re>
Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com>
2022-09-30 15:50:47 +02:00

47 lines
1.4 KiB
Text

process CHECKM_LINEAGEWF {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::checkm-genome=1.2.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/checkm-genome:1.2.1--pyhdfd78af_0' :
'quay.io/biocontainers/checkm-genome:1.2.1--pyhdfd78af_0' }"
input:
tuple val(meta), path(fasta)
val fasta_ext
path db
output:
tuple val(meta), path("${prefix}") , emit: checkm_output
tuple val(meta), path("${prefix}/lineage.ms"), emit: marker_file
tuple val(meta), path("${prefix}.tsv") , emit: checkm_tsv
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
checkm_db = db ? "export CHECKM_DATA_PATH=${db}" : ""
"""
$checkm_db
checkm \\
lineage_wf \\
-t $task.cpus \\
-f ${prefix}.tsv \\
--tab_table \\
--pplacer_threads $task.cpus \\
-x $fasta_ext \\
$args \\
. \\
$prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
checkm: \$( checkm 2>&1 | grep '...:::' | sed 's/.*CheckM v//;s/ .*//' )
END_VERSIONS
"""
}