Skip to content

Repository files navigation

PyPI Bioconda Conda chewBBACA Documentation Status License: GPL v3 DOI:10.1099/mgen.0.000166

chewBBACA_fbi

This was the preliminary development repo, the final forked repo is here https://github.com/ssi-dk/bifrost_chewbbaca

SSI FoodBourne Infections (FBI) repo with bifrost_chewbbaca related changes

  • fo.move_file(results['invalid_alleles'][0], output_directory) -> TypeError: 'NoneType' object is not subscriptable
  • for self_scores of Nonetype returns no binary self_scores. If binary self_scores exist and no new novel alleles are to be added, the existing self_score remains unchanged and not overwritten.
  • Added both the fbi_allelecaller (AlleleCall) and kept the original chewbbaca allele caller (AlleleCallOrig) without any changes to fit with the github chewBBACA
  • added arguments to the fbi allelecaller to represent the BLAST max target seqs, BLAST max hsps, BLAST evalue
  • changed the run_blast function in blast_wrapper.py and changed all functions related to that! While keeping an original copy of the changed functions to fit with AlleleCallOrig, e.g. run_blast_orig.
  • added cleanup of selfscore files, if it exist and are "corrupted" containing None value, it will automatically be removed.

Example of run on ugerm

srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCall -i /users/data/Projects/FBI_ekstern_data/proj/salmonella/events/25-00063/blast_gene_call/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o /dpssi/home/henras/ChewieTest/fbi/ --cpu 6 --cds

srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance CHEWBBACA/chewBBACA.py AlleleCall -i /users/data/Projects/FBI_SOFI/proj/chewBBACA/Analysis/test_SOFI_ugerm_chew_20250630/test_1_sample/blast_gene_call/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o /dpssi/home/henras/ChewieTest/fbi/ --cpu 6 --cds --blast-max-target-seqs 2000 --blast-max-hsps 2 --blast-evalue 0.05

srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCallOrig -i /users/data/Projects/FBI_ekstern_data/proj/salmonella/events/25-00063/blast_gene_call/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o /dpssi/home/henras/ChewieTest/fbi/ --cpu 6 --cds

chewBBACA original readme

chewBBACA is a software suite for the creation and evaluation of core genome and whole genome MultiLocus Sequence Typing (cg/wgMLST) schemas and results. The "BBACA" stands for "BSR-Based Allele Calling Algorithm". BSR stands for BLAST Score Ratio as proposed by Rasko DA et al.. The "chew" part adds extra coolness to the name and could be thought of as "Comprehensive and Highly Efficient Workflow". chewBBACA allows to define the target loci in a schema based on multiple genomes (e.g. define target loci based on the distinct loci identified in a dataset of high-quality genomes for a species or lineage of interest) and performs allele calling to determine the allelic profiles of bacterial strains, easily scaling to thousands of genomes with modest computational resources. chewBBACA includes functionalities to annotate the schema loci, compute the set of loci that constitute the core genome for a given dataset, and generate interactive reports for schema and allele calling results evaluation to enable an intuitive analysis of the results in surveillance and outbreak detection settings or population studies. Pre-defined cg/wgMLST schemas can be downloaded from Chewie-NS or adapted from other cg/wgMLST platforms.

Check the documentation for implementation details and guidance on using chewBBACA.

News

3.4.1 - 2025-07-30

  • Changed the -max_target_seqs value used by the select_representatives function to the square of the number of potential new representative alleles or to a minimum of 100. This change tries to fix an issue where BLASTp would not report the self-alignment for some alleles because it reached the limit of the number of alignments to report before reporting all self-alignments (e.g. for very large datasets, the number of potential new representatives may lead to a number of alignments that exceeds the value passed to -max_target_seqs).

Check our Changelog to learn about the latest changes.

Citation

When using chewBBACA, please use the following citation:

Silva M, Machado MP, Silva DN, Rossi M, Moran-Gilad J, Santos S, Ramirez M, Carriço JA. 2018. chewBBACA: A complete suite for gene-by-gene schema creation and strain identification. Microb Genom 4:000166. doi:10.1099/mgen.0.000166

TESTS COMMANDS - 04-09-2025

  1. Comparing all three commands first on BN blast gene call results
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCall -i ../data_test/BN/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/BN/ --cpu 6 --cds
    - results_20250904T113211
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCallOrig -i ../data_test/BN/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/BN/ --cpu 6 --cds
    • results_20250904T114001
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCall -i ../data_test/BN/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/BN/ --cpu 6 --cds --blast-max-target-seqs 2000 --blast-max-hsps 2 --blast-evalue 0.05
    • results_20250904T123824
  1. Comparing all three commands first on SOFI blast gene call results
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCall -i ../data_test/SOFI/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/SOFI/ --cpu 6 --cds
    • /dpssi/home/henras/chewbbaca_fbi/results_test/SOFI/results_20250904T124524
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCallOrig -i ../data_test/SOFI/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/SOFI/ --cpu 6 --cds
    • /dpssi/home/henras/chewbbaca_fbi/results_test/SOFI/results_20250904T125158
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCall -i ../data_test/SOFI/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/SOFI/ --cpu 6 --cds --blast-max-target-seqs 2000 --blast-max-hsps 2 --blast-evalue 0.05
    • /dpssi/home/henras/chewbbaca_fbi/results_test/SOFI/results_20250904T125952
  1. Comparing all three commands first on UGERM blast gene call results
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCall -i ../data_test/Ugerm/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/Ugerm --cpu 6 --cds
    • /dpssi/home/henras/chewbbaca_fbi/results_test/Ugerm/results_20250904T130646
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCallOrig -i ../data_test/Ugerm/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/Ugerm --cpu 6 --cds
    • /dpssi/home/henras/chewbbaca_fbi/results_test/Ugerm/results_20250904T131417
  • srun -J chewbbaca_test -c 12 --mem=15G --time=00:30:00 -p surveillance ./chewBBACA.py AlleleCall -i ../data_test/Ugerm/ -g /users/data/Projects/FBI_SOFI/proj/chewBBACA/Resources/dbs_chewBBACA_3/test_enterobase_Salmonella_cgMLSTv2_230207_chewBBACA3.4.0_sizefilter40_st_05p/ -o ~/chewbbaca_fbi/results_test/Ugerm --cpu 6 --cds --blast-max-target-seqs 2000 --blast-max-hsps 2 --blast-evalue 0.05
    • /dpssi/home/henras/chewbbaca_fbi/results_test/Ugerm/results_20250904T132138
  1. Pairwise comparisons of the results based on the input

TESTS DATASET - 09-09-2025

(/users/data/SSI/Conda_envs/chewie_test_raah) henras@dpssi-002:/users/data/Projects/FBI_SOFI/proj/chewBBACA/Analysis/test_SOFI_ugerm_chew_20250630 > ls ST*

(base) henras@dpssi-002:/users/data/Projects/FBI_ekstern_data/proj/salmonella/events/25-00063 > ls

CHECKING if all files across the three datasets (BN, SOFI, SKESA) commands are identical

find results_* -type f -exec md5sum {} + | awk '{gsub(".*/","",$2); md5s[$2]=md5s[$2]"\t"$1; seen[$2][$1]++} END{for(f in md5s){status=(length(seen[f])==1?"identical":"different"); print f md5s[f] "\t" status}}' | sort

Example of the md5sums of BN results

find BN/results_* -type f -exec md5sum {} + | awk '{gsub(".*/","",$2); md5s[$2]=md5s[$2]"\t"$1; seen[$2][$1]++} END{for(f in md5s){status=(length(seen[f])==1?"identical":"different"); print f md5s[f] "\t" status}}' | sort
invalid_cds.txt f7bce31ea228591fa61042362fe21d30        f7bce31ea228591fa61042362fe21d30        f7bce31ea228591fa61042362fe21d30        identical
loci_summary_stats.tsv  4df9727634b176b0ab24604ddc9a8ead        4df9727634b176b0ab24604ddc9a8ead        4df9727634b176b0ab24604ddc9a8ead        identical
logging_info.txt        0ee4abddc6dd5ecac6c55f6a0fe8fb21        c8e814f5d65504f30aeef218514fbdbc        cf05356436e52f01c2cab223e84bfe93        different
paralogous_counts.tsv   cf217118247ae9a5e08339360a4be452        cf217118247ae9a5e08339360a4be452        cf217118247ae9a5e08339360a4be452        identical
paralogous_loci.tsv     bf96303c1e604b3dced432f990d59a01        bf96303c1e604b3dced432f990d59a01        bf96303c1e604b3dced432f990d59a01        identical
results_alleles.tsv     dc95c78f69b9b3c15fa0ffb1f7c8ed21        dc95c78f69b9b3c15fa0ffb1f7c8ed21        dc95c78f69b9b3c15fa0ffb1f7c8ed21        identical
results_contigsInfo.tsv 5c4ac28d6bec3b16667c7a4ec5d8e2c6        5c4ac28d6bec3b16667c7a4ec5d8e2c6        5c4ac28d6bec3b16667c7a4ec5d8e2c6        identical
results_statistics.tsv  7cceb3024ba8e06e660adc77a997096b        7cceb3024ba8e06e660adc77a997096b        7cceb3024ba8e06e660adc77a997096b        identical

Example of the md5sums of SOFI results

find SOFI/results_* -type f -exec md5sum {} + | awk '{gsub(".*/","",$2); md5s[$2]=md5s[$2]"\t"$1; seen[$2][$1]++} END{for(f in md5s){status=(length(seen[f])==1?"identical":"different"); print f md5s[f] "\t" status}}' | sort
invalid_cds.txt 68b329da9893e34099c7d8ad5cb9c940        68b329da9893e34099c7d8ad5cb9c940        68b329da9893e34099c7d8ad5cb9c940        identical
loci_summary_stats.tsv  3f61abc6788db5684b3bbc694cb99eec        3f61abc6788db5684b3bbc694cb99eec        3f61abc6788db5684b3bbc694cb99eec        identical
logging_info.txt        35b5b801c0f0b43097a81c73127b181a        e97781a78747308051405d857b053b08        02576cba70521d74873ea16dac32e352        different
paralogous_counts.tsv   cf217118247ae9a5e08339360a4be452        cf217118247ae9a5e08339360a4be452        cf217118247ae9a5e08339360a4be452        identical
paralogous_loci.tsv     bf96303c1e604b3dced432f990d59a01        bf96303c1e604b3dced432f990d59a01        bf96303c1e604b3dced432f990d59a01        identical
results_alleles.tsv     071c1a0e0d27d9255a4e7bf00f53ab48        071c1a0e0d27d9255a4e7bf00f53ab48        071c1a0e0d27d9255a4e7bf00f53ab48        identical
results_contigsInfo.tsv 19a5bf003d6681e47531ddcc37305bf7        19a5bf003d6681e47531ddcc37305bf7        19a5bf003d6681e47531ddcc37305bf7        identical
results_statistics.tsv  b4c7ecbec025a8c8b06f4c7e00480c1c        b4c7ecbec025a8c8b06f4c7e00480c1c        b4c7ecbec025a8c8b06f4c7e00480c1c        identical

Example of the md5sums of skesa results

find Ugerm/results_* -type f -exec md5sum {} + | awk '{gsub(".*/","",$2); md5s[$2]=md5s[$2]"\t"$1; seen[$2][$1]++} END{for(f in md5s){status=(length(seen[f])==1?"identical":"different"); print f md5s[f] "\t" status}}' | sort
invalid_cds.txt 68b329da9893e34099c7d8ad5cb9c940        68b329da9893e34099c7d8ad5cb9c940        68b329da9893e34099c7d8ad5cb9c940        identical
loci_summary_stats.tsv  79f7adfbe39ce21cd6f5bd8a249fc461        79f7adfbe39ce21cd6f5bd8a249fc461        79f7adfbe39ce21cd6f5bd8a249fc461        identical
logging_info.txt        04f8fb229dbff0d302f00378f160c39b        3aff8f358c849c77ddffc83426c93f62        cf5302b91cc68093936c299da7326664        different
paralogous_counts.tsv   cf217118247ae9a5e08339360a4be452        cf217118247ae9a5e08339360a4be452        cf217118247ae9a5e08339360a4be452        identical
paralogous_loci.tsv     bf96303c1e604b3dced432f990d59a01        bf96303c1e604b3dced432f990d59a01        bf96303c1e604b3dced432f990d59a01        identical
results_alleles.tsv     453f52a7fd59fa77628a472fcb92acb6        453f52a7fd59fa77628a472fcb92acb6        453f52a7fd59fa77628a472fcb92acb6        identical
results_contigsInfo.tsv c958679468f8146dd37acd08ecb5aa28        c958679468f8146dd37acd08ecb5aa28        c958679468f8146dd37acd08ecb5aa28        identical
results_statistics.tsv  5e3f791f7c7aef3dec1d1760742fbc05        5e3f791f7c7aef3dec1d1760742fbc05        5e3f791f7c7aef3dec1d1760742fbc05        identical

All files are identical (logging information is irrelevant) thus the commands with the fbi local changes are not affecting the actual functionality of ChewBBACA but it is only fixing some of the bugs we have identified within the code

TRANSFER TO SOFI

ensure identical environment

conda env export --prefix /users/data/SSI/Conda_envs/FBI_cgMLST_call > FBI_cgMLST_call_env.lock.yml

About

SSI FBI specific version of chewbbaca with slight alterations to allelecalling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages