Repository navigation
Klebsiella LINcodes case study
⚠️ A general solution is now available.** MiST now retrieves LIN codes directly viamist lincode, for both BIGSdb (Klebsiella and other schemes) and EnteroBase schemes. See LIN codes with MiST for the current, recommended workflow. This page is kept as the original Klebsiella case study for reference; the helper script it describes has been superseded by the built-inmist lincodecommand.
This tutorial describes how to retrieve partial LINcodes with MIST.
For more information on LINcodes, please refer to the official documentation.
The Klebsiella LINcodes are defined using the scgMLST629_S cgMLST scheme, which is hosted on the Institut Pasteur
BIGSdb instance.
To download the scheme, first identify its URL:
mist list --downloader bigsdb --host pasteur # List the available sub-databases on the BIGSdb instance
mist list --downloader bigsdb --host pasteur --db pubmlst_klebsiella_seqdef # List Klebsiella schemesAfterwards, retrieve the scgMLST629_S scheme and its profiles:
mist download \
--downloader bigsdb \
--url https://bigsdb.pasteur.fr/api/db/pubmlst_klebsiella_seqdef/schemes/18 \
--output kleb_scgmlst_s \
--include-profiles💡 Tip: The example above downloads without authentication. To obtain the latest version of the scheme, use the
bigsdb_auth downloader. See Downloading schemes for details.
Once the scheme is downloaded, create a MiST index:
mist index \
--fasta-list kleb_scgmlst_s/fasta_list.txt \
--profiles kleb_scgmlst_s/profiles.tsv \
--output kleb_scgmlst_s-index \
--threads 8Download a Klebsiella genome in FASTA format (or use your own):
curl -L -o GCA_048969535.fasta \
"https://www.ebi.ac.uk/ena/browser/api/fasta/GCA_048969535.1?download=true&gzip=false"
Call the alleles with MiST:
mist call \
--fasta GCA_048969535.fasta \
--db kleb_scgmlst_s-index \
--out-json GCA_048969535.jsonThe log will display the best-matching scgST:
2025-09-26 11:30:24,271 - mistcaller - INFO - Matching ST: 4362 (99.21% match)
Use the provided helper script to extract partial LINcodes from the MiST JSON output:
python mist_to_partial_lin.py GCA_048969535.jsonExample output:
Best matching: scgST-4362
Number of matches: 624/629
LINcode for scgMST-4362: 0_0_369_0_0_0_0_35_0_0
Partial LINcode for input strain: 0_0_369_0_0_0_*_*_*
In addition, the MiST JSON output also contains information on phylogroup, sublineage, and clonal group for the best matching scgST.
When using LINCodes, please cite the original publication.