kkonganti@11: process CHECKM2_PREDICT { kkonganti@11: tag "$meta.id" kkonganti@11: label 'process_low' kkonganti@11: kkonganti@11: module (params.enable_module ? "${params.swmodulepath}${params.fs}checkm2${params.fs}1.0.1" : null) kkonganti@11: conda (params.enable_conda ? "conda-forge::scipy bioconda::checkm2=1.0.1" : null) kkonganti@11: container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? kkonganti@11: 'https://depot.galaxyproject.org/singularity/checkm2:1.0.1--pyh7cba7a3_0' : kkonganti@11: 'quay.io/biocontainers/checkm2:1.0.1--pyh7cba7a3_0+' }" kkonganti@11: kkonganti@11: input: kkonganti@11: tuple val(meta), path(database_path), path(acc_chunk_file, stageAs: 'acc_chunk_file.txt') kkonganti@11: kkonganti@11: output: kkonganti@11: tuple val(meta), path("**${params.fs}*quality_report.tsv") , emit: quality_report kkonganti@11: tuple val(meta), path("**${params.fs}*quality_report.passed.tsv"), emit: quality_report_passed kkonganti@11: path "versions.yml" , emit: versions kkonganti@11: kkonganti@11: when: kkonganti@11: task.ext.when == null || task.ext.when kkonganti@11: kkonganti@11: script: kkonganti@11: def args = task.ext.args ?: '' kkonganti@11: def prefix = task.ext.prefix ?: "${meta.id}" kkonganti@11: def outdir = prefix + (task.index ?: '') kkonganti@11: def fgq_py_args = [] kkonganti@11: fgq_py_args.addAll([ kkonganti@11: ("${params.fgq_py_cm2_extract}" ? "-extract ${params.fgq_py_cm2_extract}" : "-extract Name"), kkonganti@11: ("${params.fgq_py_cm2_fcn}" ? "-fcn ${params.fgq_py_cm2_fcn}" : "-fcn 'Completeness_General,Contamination,Completeness_Specific'"), kkonganti@11: ("${params.fgq_py_cm2_fcv}" ? "-fcv ${params.fgq_py_cm2_fcv}" : "-fcv '97.5,1,99'"), kkonganti@11: ("${params.fgq_py_cm2_conds}" ? "-conds ${params.fgq_py_cm2_conds}" : "-conds '>=,<=,>='") kkonganti@11: ]) kkonganti@11: """ kkonganti@11: datasets download genome accession \\ kkonganti@11: --dehydrated \\ kkonganti@11: --inputfile $acc_chunk_file kkonganti@11: kkonganti@11: unzip ncbi_dataset.zip kkonganti@11: kkonganti@11: datasets rehydrate \\ kkonganti@11: --gzip \\ kkonganti@11: --max-workers $task.cpus \\ kkonganti@11: --directory "." kkonganti@11: kkonganti@11: stage_ncbi_dataset_genomes.py -in ncbi_dataset kkonganti@11: kkonganti@11: checkm2 \\ kkonganti@11: predict \\ kkonganti@11: --threads ${task.cpus} \\ kkonganti@11: --database_path $database_path \\ kkonganti@11: --input unscaffolded \\ kkonganti@11: --output_directory $outdir \\ kkonganti@11: $args kkonganti@11: kkonganti@11: filter_genomes_by_qual.py \\ kkonganti@11: -tsv $outdir${params.fs}quality_report.tsv \\ kkonganti@11: -outprefix "${outdir}_" \\ kkonganti@11: ${fgq_py_args.join(' ')} kkonganti@11: kkonganti@11: cat <<-END_VERSIONS > versions.yml kkonganti@11: "${task.process}": kkonganti@11: datasets: \$( datasets --version | sed 's/datasets version: //g' ) kkonganti@11: python: \$( python --version | sed 's/Python //g' ) kkonganti@11: checkm2: \$( checkm2 --version ) kkonganti@11: END_VERSIONS kkonganti@11: """ kkonganti@11: }