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

⚠️ Known Issue: mlstdb connect is currently not working

Due to recent changes in the BIGSdb (v1.53.x), the mlstdb connect OAuth authentication flow is currently broken. We are actively working on a fix.

Workaround: Use the --no-auth flag with mlstdb update to download public schemes without authentication in the interim:

mlstdb update --no-auth

We apologise for the inconvenience and will release a fix as soon as possible. Track progress in #35.

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
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.

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.2.0.tar.gz (39.4 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.2.0-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mlstdb-1.2.0.tar.gz
  • Upload date:
  • Size: 39.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 b54aa9e95c3a6cef797f0e68f6bfa8e18cf7d0c2ebeb3ae94381e5ccb028f9a5
MD5 6e7777cdb916d57d6ce220e381af6d33
BLAKE2b-256 d280f598232a64bade03dfd1d0c9b95f8406e0ddfd4a91c90bcf71ba35b98704

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlstdb-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79c0070c4220e632e578b1424278628aa655be70fb9197ad4ab0937b573648d9
MD5 89f8aa4b3f02914431d10172b4fb4593
BLAKE2b-256 87a2af3b445dafb825d4be47b8d4b7d0dbd80fb5400b43ab98d2e80029d634ba

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