comparison 0.1.0/modules/checkm2/predict/main.nf @ 0:c8597e9e1a97

"planemo upload"
author kkonganti
date Mon, 27 Nov 2023 12:37:44 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c8597e9e1a97
1 process CHECKM2_PREDICT {
2 tag "$meta.id"
3 label 'process_low'
4
5 module (params.enable_module ? "${params.swmodulepath}${params.fs}checkm2${params.fs}1.0.1" : null)
6 conda (params.enable_conda ? "conda-forge::scipy bioconda::checkm2=1.0.1" : null)
7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
8 'https://depot.galaxyproject.org/singularity/checkm2:1.0.1--pyh7cba7a3_0' :
9 'quay.io/biocontainers/checkm2:1.0.1--pyh7cba7a3_0+' }"
10
11 input:
12 tuple val(meta), path(database_path), path(acc_chunk_file, stageAs: 'acc_chunk_file.txt')
13
14 output:
15 tuple val(meta), path("**${params.fs}*quality_report.tsv") , emit: quality_report
16 tuple val(meta), path("**${params.fs}*quality_report.passed.tsv"), emit: quality_report_passed
17 path "versions.yml" , emit: versions
18
19 when:
20 task.ext.when == null || task.ext.when
21
22 script:
23 def args = task.ext.args ?: ''
24 def prefix = task.ext.prefix ?: "${meta.id}"
25 def outdir = prefix + (task.index ?: '')
26 def fgq_py_args = []
27 fgq_py_args.addAll([
28 ("${params.fgq_py_cm2_extract}" ? "-extract ${params.fgq_py_cm2_extract}" : "-extract Name"),
29 ("${params.fgq_py_cm2_fcn}" ? "-fcn ${params.fgq_py_cm2_fcn}" : "-fcn 'Completeness_General,Contamination,Completeness_Specific'"),
30 ("${params.fgq_py_cm2_fcv}" ? "-fcv ${params.fgq_py_cm2_fcv}" : "-fcv '97.5,1,99'"),
31 ("${params.fgq_py_cm2_conds}" ? "-conds ${params.fgq_py_cm2_conds}" : "-conds '>=,<=,>='")
32 ])
33 """
34 datasets download genome accession \\
35 --dehydrated \\
36 --inputfile $acc_chunk_file
37
38 unzip ncbi_dataset.zip
39
40 datasets rehydrate \\
41 --gzip \\
42 --max-workers $task.cpus \\
43 --directory "."
44
45 stage_ncbi_dataset_genomes.py -in ncbi_dataset
46
47 checkm2 \\
48 predict \\
49 --threads ${task.cpus} \\
50 --database_path $database_path \\
51 --input unscaffolded \\
52 --output_directory $outdir \\
53 $args
54
55 filter_genomes_by_qual.py \\
56 -tsv $outdir${params.fs}quality_report.tsv \\
57 -outprefix "${outdir}_" \\
58 ${fgq_py_args.join(' ')}
59
60 cat <<-END_VERSIONS > versions.yml
61 "${task.process}":
62 datasets: \$( datasets --version | sed 's/datasets version: //g' )
63 python: \$( python --version | sed 's/Python //g' )
64 checkm2: \$( checkm2 --version )
65 END_VERSIONS
66 """
67 }