From daff863c8cdcbb0028725ec1bd97eb48bb3e0edc Mon Sep 17 00:00:00 2001 From: Marc Hoeppner Date: Fri, 10 Jan 2025 07:26:18 +0100 Subject: [PATCH] Merging abricate databases per sample into one json --- assets/test/samples.csv | 2 +- bin/gabi.py | 4 ++-- modules/hamronization/abricate/main.nf | 8 ++++---- nextflow.config | 2 +- subworkflows/amr_profiling/main.nf | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/assets/test/samples.csv b/assets/test/samples.csv index 691872d..2b22e3a 100644 --- a/assets/test/samples.csv +++ b/assets/test/samples.csv @@ -1,2 +1,2 @@ sample_id,platform,single_end,R1,R2 -ERR1008684,ILLUMINA,false,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR100/004/ERR1008684/ERR1008684_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR100/004/ERR1008684/ERR1008684_2.fastq.gz +SAMEA2707761,ILLUMINA,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR580/ERR580964/ERR580964_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR580/ERR580964/ERR580964_2.fastq.gz diff --git a/bin/gabi.py b/bin/gabi.py index 18ef7fc..669caa5 100755 --- a/bin/gabi.py +++ b/bin/gabi.py @@ -448,7 +448,7 @@ def main(yaml, template, output, reference, version, call, wd): if busco_data_all: # Draw the busco stats graph bdata = pd.DataFrame(data=busco_data_all, index=samples) - plot_labels = { "index": "Samples", "value": "Percentage"} + plot_labels = {"index": "Samples", "value": "Percentage"} h = len(samples)*25 if len(samples) > 10 else 300 fig = px.bar(bdata, orientation='h', labels=plot_labels, height=h) data["Busco"] = fig.to_html(full_html=False) @@ -559,4 +559,4 @@ def check_gc(refs, query): if __name__ == '__main__': - main(args.input, args.template, args.output, args.references, args.version, args.call, args.wd) \ No newline at end of file + main(args.input, args.template, args.output, args.references, args.version, args.call, args.wd) diff --git a/modules/hamronization/abricate/main.nf b/modules/hamronization/abricate/main.nf index 186853d..09ede0d 100644 --- a/modules/hamronization/abricate/main.nf +++ b/modules/hamronization/abricate/main.nf @@ -8,7 +8,7 @@ process HAMRONIZATION_ABRICATE { 'quay.io/biocontainers/hamronization:1.1.4--pyhdfd78af_0' }" input: - tuple val(meta), path(report) + tuple val(meta), path(reports) val(format) val(software_version) val(reference_db_version) @@ -23,16 +23,16 @@ process HAMRONIZATION_ABRICATE { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.sample_id}" + def prefix = task.ext.prefix ?: "${report.getBaseName()}" """ hamronize \\ abricate \\ - ${report} \\ + ${reports} \\ $args \\ --format ${format} \\ --analysis_software_version ${software_version} \\ --reference_database_version ${reference_db_version} \\ - > ${prefix}.${format} + --output ${prefix}.${format} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/nextflow.config b/nextflow.config index 7003f97..0a9f63f 100644 --- a/nextflow.config +++ b/nextflow.config @@ -84,7 +84,7 @@ params { manifest { name = "bio-raum/gabi" - version = "0.9.1" + version = "0.9.2" description = "GABI Pipeline for assembly and profiling of bacterial isolates" author = "Marc Hoeppner" homePage = "https://github.com/bio-raum/gabi" diff --git a/subworkflows/amr_profiling/main.nf b/subworkflows/amr_profiling/main.nf index 8130322..ee857b5 100644 --- a/subworkflows/amr_profiling/main.nf +++ b/subworkflows/amr_profiling/main.nf @@ -77,7 +77,7 @@ workflow AMR_PROFILING { // Join basic Abricate results HAMRONIZATION_ABRICATE( - ABRICATE_RUN.out.report.mix(ABRICATE_RUN_ECOLI_VIRULENCE.out.report), + ABRICATE_RUN.out.report.mix(ABRICATE_RUN_ECOLI_VIRULENCE.out.report).groupTuple(), 'json', '1.0.1', '2021-Mar-27'