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