kkonganti@17: process BCS_DISTANCE_MATRIX { kkonganti@17: tag "Samples vs Genomes" kkonganti@17: label "process_pico" kkonganti@17: kkonganti@17: module (params.enable_module ? "${params.swmodulepath}${params.fs}python${params.fs}3.8.1" : null) kkonganti@17: conda (params.enable_conda ? "conda-forge::python=3.10 conda-forge::pyyaml" : null) kkonganti@17: container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? kkonganti@17: 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' : kkonganti@17: 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" kkonganti@17: kkonganti@17: input: kkonganti@17: path matrix kkonganti@17: path labels kkonganti@17: kkonganti@17: output: kkonganti@17: path 'bcs_sourmash_matrix.tblsum.txt', emit: mqc_txt, optional: true kkonganti@17: path 'bcs_sourmash_matrix_mqc.json' , emit: mqc_json, optional: true kkonganti@17: path 'bcs_sourmash_matrix_mqc.yml' , emit: mqc_yml, optional: true kkonganti@17: path 'versions.yml' , emit: versions kkonganti@17: kkonganti@17: when: kkonganti@17: task.ext.when == null || task.ext.when kkonganti@17: kkonganti@17: script: kkonganti@17: def args = task.ext.args ?: '' kkonganti@17: kkonganti@17: """ kkonganti@17: sourmash_sim_matrix.py \\ kkonganti@17: -pickle ${params.tuspy_ps} \\ kkonganti@17: -csv $matrix \\ kkonganti@17: -labels $labels kkonganti@17: kkonganti@17: if [ -e "bcs_sourmash_matrix.tblsum.txt" ] && [ -s "bcs_sourmash_matrix.tblsum.txt" ]; then kkonganti@17: create_mqc_data_table.py \\ kkonganti@17: "bcs_sourmash_matrix" \\ kkonganti@17: "The following table is an asymmetrical matrix of all v. all ANI values between each of the sample FASTQ's sketch and genome FASTA'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: fi kkonganti@17: kkonganti@17: cat <<-END_VERSIONS > versions.yml kkonganti@17: "${task.process}": kkonganti@17: python: \$( python --version | sed 's/Python //g' ) kkonganti@17: bash: \$( bash --version 2>&1 | sed '1!d; s/^.*version //; s/ (.*\$//' ) kkonganti@17: END_VERSIONS kkonganti@17: """ kkonganti@17: }