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