Skip to main content

mlstdb

Tests GitHub release (latest by date) PyPI - Version PyPI - Python Version Anaconda-Server Badge License: GPL v3 Anaconda-Server Badge

Keep your mlst databases up to date. mlstdb handles OAuth authentication with PubMLST and BIGSdb Pasteur so you can download the latest MLST schemes and build a BLAST database, in two commands.

Full Documentation

Install

conda create -n mlst -c bioconda mlst
conda activate mlst
pip install mlstdb
Other installation methods
# From bioconda (include conda-forge for dependencies)
conda install -c conda-forge -c bioconda mlstdb

# Or install both tools together
conda create -n mlst -c conda-forge -c bioconda mlst mlstdb

# From PyPI only
pip install mlstdb

Quick Start

1. Register with each database (one-time setup):

mlstdb connect --db pubmlst
# or use --api-key for pubmlst (currently not available for pasteur)
mlstdb connect --db pubmlst --api-key
mlstdb connect --db pasteur

This opens a browser for OAuth registration. Follow the prompts to authorise mlstdb.

2. Download schemes and build the BLAST database:

mlstdb update

This downloads the curated MLST schemes from both PubMLST and Pasteur and creates a BLAST database.

3. Use with mlst:

mlst --blastdb blast/mlst.fa --datadir pubmlst your_assembly.fasta

That's it. For advanced scheme exploration, custom filtering, and detailed option reference, see the full documentation.

Probing API endpoints

To verify that a specific API endpoint is reachable and your credentials are working, use mlstdb ping:

mlstdb ping https://rest.pubmlst.org/db/pubmlst_neisseria_seqdef/schemes/67/profiles_csv --db pubmlst

See the ping documentation for the full reference.

Removing contaminated STs or alleles

Discovered a dodgy sequence type or allele in your local database? You can remove it without re-downloading the whole scheme:

# Remove a single ST (orphaned alleles are cleaned up automatically)
mlstdb purge --scheme salmonella --st 3

# Remove a specific allele (also removes any STs that reference it)
mlstdb purge --scheme salmonella --allele aroC:1

The BLAST database is rebuilt automatically after each purge. See the purge documentation for the full reference.

Caution

  • Back up your existing MLST databases before running updates.
  • If using mlstdb fetch to build a custom scheme list, double-check that all schemes are compatible with the mlst tool. Not all schemes are validated for use with mlst. The mlst tool is designed for bacterial species only.
  • mlstdb purge permanently modifies your local database. Take a backup of your pubmlst/ directory before purging, especially when using --force.

Acknowledgements

Built upon the work of:

License

mlstdb was previously licensed under MIT. As of version 0.1.7, it is licensed under GPL v3. Original MIT‑licensed code is preserved and attributed according to MIT terms.

For additional support, please raise an issue.

Metadata

Release files for mlstdb 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlstdb 1.3.0
File Size Uploaded
mlstdb-1.3.0.tar.gz 40.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlstdb 1.3.0
File Interpreter ABI Platform
mlstdb-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 89.7 kB

Release files / mlstdb-1.3.0.tar.gz

Download URL mlstdb-1.3.0.tar.gz
Size 40.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ed7a19a9ed14318c2237763fdbe2d274f88489cf82b7cfa4446b0b20296ec5b5
BLAKE2b-256 checksum
How to use checksums
699cc630a83b30782f355cac5e7c84d75234e74d429951aaec90cebbecc1b9b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1

Release files / mlstdb-1.3.0-py3-none-any.whl

Download URL mlstdb-1.3.0-py3-none-any.whl
Size 49.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76fb061900d6e8abd9569f650b6629abb73198b3d42be56701f2a863db78495f
BLAKE2b-256 checksum
How to use checksums
3a0a1b2d5a7ee2b4caf6ca46562515f521cf646df27166ec51bc2916df55847c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page