Usage Overview
mlstdb has three commands. Most users only need the first two.
Workflow
┌──────────────────────────────────────────────────────────────┐
│ mlstdb workflow │
├──────────────────────────────────────────────────────────────┤
│ │
│ mlstdb connect ──► Register OAuth credentials │
│ │ (one-time per database) │
│ ▼ │
│ mlstdb update ──► Download schemes + build BLAST DB │
│ │ (uses built-in curated scheme list) │
│ ▼ │
│ mlst tool ──► Run MLST analysis with updated DB │
│ │
├──────────────────────────────────────────────────────────────┤
│ OPTIONAL │
│ │
│ mlstdb purge ──► Remove contaminated STs or alleles │
│ │ from your local database │
│ ▼ │
│ BLAST DB rebuilt automatically │
│ │
├──────────────────────────────────────────────────────────────┤
│ ADVANCED (optional) │
│ │
│ mlstdb fetch ──► Explore all available schemes │
│ │ with custom filters │
│ ▼ │
│ mlstdb update ──► Download using custom scheme list │
│ --input <file> │
└──────────────────────────────────────────────────────────────┘
Commands
mlstdb connect — Register credentials
Sets up OAuth authentication with PubMLST or Pasteur. Run once per database.
Credentials are saved to ~/.config/mlstdb/ and reused automatically by update and fetch.
mlstdb update — Download and build
Downloads MLST schemes and creates a BLAST database. This is the main command you'll use regularly.
By default, it uses the built-in curated list of ~170 MLST schemes from both PubMLST and Pasteur. You can also provide a custom scheme list generated by fetch.
mlstdb purge — Remove contaminated entries
If a sequence type or allele in your local database turns out to be erroneous or contaminated, mlstdb purge lets you remove it without re-downloading the entire scheme.
# Remove a single ST (orphaned alleles are cleaned up automatically)
mlstdb purge --scheme salmonella --st 3
# Remove an allele (also removes all STs that reference it)
mlstdb purge --scheme salmonella --allele aroC:1
# Batch purge across multiple schemes from a YAML config
mlstdb purge --config purge_config.yaml
The BLAST database is rebuilt automatically after every purge operation.
mlstdb fetch — Explore schemes (advanced)
Discovers and lists all available MLST schemes from PubMLST or Pasteur with custom filtering. Useful when you need to find specific schemes or build a custom scheme list.
Most users don't need this — the update command already includes a curated list of validated schemes.
Typical usage
First time setup
# Install
conda create -n mlst -c bioconda mlst && conda activate mlst
pip install mlstdb
# Register (one-time)
mlstdb connect --db pubmlst
mlstdb connect --db pasteur
# Download everything
mlstdb update