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

# Remove an entire scheme
mlstdb purge --scheme salmonella

# Batch purge across multiple schemes from a YAML config file
mlstdb purge --config purge_config.yaml

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.1.0.tar.gz (37.8 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.1.0-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mlstdb-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2bfb1e1c241a5b995fab9fea26e5d72bee1d5c143e9ea0f3961401ba22359eb7
MD5 bcfcd0b55944c6140d20cb756a660662
BLAKE2b-256 e362412dcf0c56d89e915d89516e2144583f57b375950bf53a33f55356f4289d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mlstdb-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de9868826d55e4a824ee82655d10fa9254844bc8e6ba5e3c0ee22550e64a8e28
MD5 6c96ad42e1cea71631296963169fe061
BLAKE2b-256 5d6d951033dfe77d977b0a25fe3d587ba85939f15a34d34d0aa4840159517251

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