kkonganti@17
|
1 process BCS_DISTANCE_MATRIX {
|
kkonganti@17
|
2 tag "Samples vs Genomes"
|
kkonganti@17
|
3 label "process_pico"
|
kkonganti@17
|
4
|
kkonganti@17
|
5 module (params.enable_module ? "${params.swmodulepath}${params.fs}python${params.fs}3.8.1" : null)
|
kkonganti@17
|
6 conda (params.enable_conda ? "conda-forge::python=3.10 conda-forge::pyyaml" : null)
|
kkonganti@17
|
7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
kkonganti@17
|
8 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' :
|
kkonganti@17
|
9 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }"
|
kkonganti@17
|
10
|
kkonganti@17
|
11 input:
|
kkonganti@17
|
12 path matrix
|
kkonganti@17
|
13 path labels
|
kkonganti@17
|
14
|
kkonganti@17
|
15 output:
|
kkonganti@17
|
16 path 'bcs_sourmash_matrix.tblsum.txt', emit: mqc_txt, optional: true
|
kkonganti@17
|
17 path 'bcs_sourmash_matrix_mqc.json' , emit: mqc_json, optional: true
|
kkonganti@17
|
18 path 'bcs_sourmash_matrix_mqc.yml' , emit: mqc_yml, optional: true
|
kkonganti@17
|
19 path 'versions.yml' , emit: versions
|
kkonganti@17
|
20
|
kkonganti@17
|
21 when:
|
kkonganti@17
|
22 task.ext.when == null || task.ext.when
|
kkonganti@17
|
23
|
kkonganti@17
|
24 script:
|
kkonganti@17
|
25 def args = task.ext.args ?: ''
|
kkonganti@17
|
26
|
kkonganti@17
|
27 """
|
kkonganti@17
|
28 sourmash_sim_matrix.py \\
|
kkonganti@17
|
29 -pickle ${params.tuspy_ps} \\
|
kkonganti@17
|
30 -csv $matrix \\
|
kkonganti@17
|
31 -labels $labels
|
kkonganti@17
|
32
|
kkonganti@17
|
33 if [ -e "bcs_sourmash_matrix.tblsum.txt" ] && [ -s "bcs_sourmash_matrix.tblsum.txt" ]; then
|
kkonganti@17
|
34 create_mqc_data_table.py \\
|
kkonganti@17
|
35 "bcs_sourmash_matrix" \\
|
kkonganti@17
|
36 "The following table is an asymmetrical matrix of all <code>v.</code> all <b>ANI</b> values between each of the sample <b>FASTQ</b>'s sketch and genome <b>FASTA</b>'s sketch. Please note that there may be multiple genomes belonging to a serotype as processed by the initial screening steps of the workflow."
|
kkonganti@17
|
37 fi
|
kkonganti@17
|
38
|
kkonganti@17
|
39 cat <<-END_VERSIONS > versions.yml
|
kkonganti@17
|
40 "${task.process}":
|
kkonganti@17
|
41 python: \$( python --version | sed 's/Python //g' )
|
kkonganti@17
|
42 bash: \$( bash --version 2>&1 | sed '1!d; s/^.*version //; s/ (.*\$//' )
|
kkonganti@17
|
43 END_VERSIONS
|
kkonganti@17
|
44 """
|
kkonganti@17
|
45 } |