Skip to main content

A Python package to update and manage the MLST database for the MLST tool.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlstdb-1.3.0.tar.gz (40.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlstdb-1.3.0-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file mlstdb-1.3.0.tar.gz.

File metadata

  • Download URL: mlstdb-1.3.0.tar.gz
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1

File hashes

Hashes for mlstdb-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ed7a19a9ed14318c2237763fdbe2d274f88489cf82b7cfa4446b0b20296ec5b5
MD5 c685d4107c61b9e10bfdb1566f0e338a
BLAKE2b-256 699cc630a83b30782f355cac5e7c84d75234e74d429951aaec90cebbecc1b9b7

See more details on using hashes here.

File details

Details for the file mlstdb-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: mlstdb-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1

File hashes

Hashes for mlstdb-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76fb061900d6e8abd9569f650b6629abb73198b3d42be56701f2a863db78495f
MD5 15d1d9d7df80de070ccec83a994ecc90
BLAKE2b-256 3a0a1b2d5a7ee2b4caf6ca46562515f521cf646df27166ec51bc2916df55847c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page