nf-core_modules/modules/checkm/lineagewf/main.nf
James A. Fellows Yates a740a6ff48
New module: checkm/lineagewf (#899)
* Specify more guidelines on input channels

* Linting

* Updates based on code review

* Update README.md

* Fix broken sentence

* feat: add megahit module, currently decompressed output

* Update main.nf

* Update tests/modules/megahit/test.yml

Co-authored-by: Maxime Borry <maxibor@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* feat: compress all outputs, remove md5sums due to gz stochasicity

* fix: wrong conda channel for pigz

* fix: broken singleend tests and update meta.yml

* Missed one

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* fix: pigz formatting

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Apply suggestions from code review

* Added but test failing due to null on output channel

* fix prefix variable

* Complete checkm_lineagewf

* Remove TODOs

* Add description of fasta_ext parameter

* Improve meta map for this context

* Update meta.yml

* Update modules/checkm/lineagewf/meta.yml

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
Co-authored-by: Maxime Borry <maxibor@users.noreply.github.com>
Co-authored-by: Daniel Lundin <erik.rikard.daniel@gmail.com>
2021-10-26 21:54:10 +01:00

49 lines
1.6 KiB
Text

// Import generic module functions
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:]
options = initOptions(params.options)
process CHECKM_LINEAGEWF {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
conda (params.enable_conda ? "bioconda::checkm-genome=1.1.3" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/checkm-genome:1.1.3--py_1"
} else {
container "quay.io/biocontainers/checkm-genome:1.1.3--py_1"
}
input:
tuple val(meta), path(fasta)
val fasta_ext
output:
tuple val(meta), path("${prefix}") , emit: checkm_output
tuple val(meta), path("${prefix}.tsv"), emit: checkm_tsv
path "versions.yml" , emit: versions
script:
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
checkm \\
lineage_wf \\
-t $task.cpus \\
-f ${prefix}.tsv \\
--tab_table \\
--pplacer_threads $task.cpus \\
-x $fasta_ext \\
$options.args \\
. \\
$prefix
cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$( checkm 2>&1 | grep '...:::' | sed 's/.*CheckM v//;s/ .*//' )
END_VERSIONS
"""
}