BISCOTTI is a high-performance Python tool for generating custom substitution matrices from large-scale multiple sequence alignments (>30k sequences). It features redundancy reduction, Henikoff weighting, and BLOSUM-style log-odds scoring.
BISCOTTI implements:
- Redundancy reduction via CD-HIT clustering
- Henikoff sequence weighting within clusters
- Weighted amino acid pair counting
- Computation of log-odds substitution scores (BLOSUM-style)
- Output of symmetric 20×20 substitution matrices in CSV format
BISCOTTI adapts the widely used Henikoff method for constructing BLOSUM-like matrices by incorporating weighted sequence contributions and custom scoring options. While Henikoff's original approach laid the foundation for position-specific residue weighting and clustering, this implementation extends it to handle large datasets efficiently and allows users to customise the scoring scheme, making it more flexible for diverse protein families.
The full mathematical formulation (Henikoff weighting, pair counting, probability calculations, and log-odds scoring) is available on the MathJax-rendered site:
Biscotti Substitution Matrix MathJax Page
QC and Align Sequences
Filter and align your sequences using a tool like MAFFT or CLUSTALW.
Cluster Sequences
Cluster your FASTA sequences using CD-HIT. For highly conserved proteins, use a > identity cutoff: e.g.
cd-hit -i RSV_A.fasta -o clustered_RSVA90.fasta -c 0.90 -n 5 -d 0
Run BISCOTTI:
python3 biscotti.py --msa_file MSA_FILE --clstr_file CLSTR_FILE --output_file OUTPUT_FILE --nproc 1-10
Output:
foo.csv
Note
Although BISCOTTI is optimised for efficiency, its performance scales with the number of available CPU cores, with more cores yielding faster computation, default = 4
This repository contains the biscotti algorithm and software developed for the following publication:
Mosscrop, L. G.†, Gerardi, V.†, Kose, S. H., Talts, T., Thomas, C., Paschos, K., Brown, J., Williams, T. C., Skinner, M., Zambon, M., Bravi, B., & Tregoning, J. S. An integrated in silico and in vitro genotype-to-phenotype pipeline to predict and characterise RSV F site zero escape mutants. (2025, under review)
If you use this code or adapt components in your research, please cite:
Kose, S. H. (2025). BISCOTTI: A Scalable Tool for Custom BLOSUM Matrix Generation. GitHub repository: https://github.com/kose-bioinfo/biscotti
BISCOTTI was developed for and in collaboration with the Tregoning Lab. With special thanks to Valeria Gerardi, Barbara Bravi and John Tregoning for their help and support in the implementation of this tool.
Henikoff, S., & Henikoff, J. G. (1992). Amino acid substitution matrices from protein blocks. PNAS, 89(22), 10915–10919. PMID: 1438297
Li, W., & Godzik, A. (2006). Cd-hit: a fast program for clustering and comparing large sets of protein or nucleotide sequences. Bioinformatics, 22(13), 1658–1659