Skip to main content

Python wrapper for MMseqs2

Project description

PyMMseqs 🚀

GitHub Actions License PyPI Version Docker

PyMMseqs is a powerful Python wrapper for MMseqs2. It seamlessly integrates MMseqs2’s advanced functionality into your Python workflows, allowing you to effortlessly execute MMseqs2 commands and parse their outputs into convenient Python objects for further analysis. Whether you're clustering sequences, searching databases, or analyzing large-scale biological data, PyMMseqs simplifies the process while maintaining the performance and flexibility of MMseqs2.


🎯 5-Minute Tour of PyMMseqs

Want to see the power of PyMMseqs in action?

Try our quick tour on Google Colab and experience the full power of PyMMseqs, all in just 5 minutes!

Ready to dive in?

PyMMseqs Quick Tour


🗝️ Features

  • Seamless Integration: Execute MMseqs2 commands directly within your Python code, eliminating the need for shell scripting or external command-line tools.
  • Output Parsing: Convert MMseqs2 outputs into Python objects (e.g., Pandas DataFrame, generators, dictionaries) for easy manipulation and analysis.
  • High Performance: Leverage the speed and efficiency of MMseqs2 while enjoying the flexibility of Python.
  • Cross-Platform: Use PyMMseqs via pip or Docker, ensuring compatibility across different environments. PyMMseqs works seamlessly on Linux and macOS.

Note: Windows users should either use Windows Subsystem for Linux (WSL) or Docker to run PyMMseqs.


🛠️ Installation

PyMMseqs can be installed in two ways: via pip (recommended for most users) or using a Docker image (ideal for reproducible environments).

Installing via pip

The pymmseqs package is currently available on PyPI. To install it, use the following command:

pip install pymmseqs

Using Docker Image

For users who prefer not to install PyMMseqs locally or want a pre-configured environment, a Docker image is available on GitHub Container Registry (GHCR).

Debian-based Image

To pull the Debian-based Docker image, run:

docker pull ghcr.io/heispv/pymmseqs:latest-debian

Note: If you want to use a specific version of PyMMseqs, you can replace latest with the desired version.

Tip: Using Docker ensures that all dependencies, including MMseqs2, are pre-installed and configured, making it ideal for reproducible workflows.


🚀 Example Usage

Here's a simple example to get you started with PyMMseqs. This example demonstrates how to perform sequence clustering and parse the results.

If you were using MMseqs2 directly in the terminal, you would run the following command to cluster sequences:

mmseqs easy-cluster human.fasta human_clust tmp --min-seq-id 0.9

With PyMMseqs, you can achieve the same result directly in Python, and parse the output to Python objects for further analysis.

from pymmseqs.commands import easy_cluster

# Perform clustering on a FASTA file (equivalent to the terminal command above)
human_cluster = easy_cluster("human.fasta", "human_clust", "tmp", min_seq_id=0.9)

# Get results as a Python generator for easy processing
cluster_gen = human_cluster.to_gen()

# Let's get the representative sequence of a cluster with more than 100 members
for cluster in cluster_gen:
    if len(cluster["members"]) > 100:
        print(f"Representative sequence of a large cluster: {cluster['rep']}")
        break

📖 Documentation

For detailed usage instructions, advanced examples, and API references, please visit the PyMMseqs Wiki.


🔧 Prerequisites

To use PyMMseqs, you only need:

  • Python: Version 3.10 or higher.

Note: All other dependencies, including MMseqs2, are automatically installed when you install pymmseqs via pip or use the Docker image.


🤝 Contributing

We'd love your contributions to PyMMseqs! Simply fork, branch, commit, push, and open a PR.

For bug reports, feature requests, or questions, please open an issue on the GitHub Issues page.


📜 License

PyMMseqs is licensed under the MIT License.


🌟 Support

If you find PyMMseqs useful, please consider giving the repository a star on GitHub! ⭐

It helps others discover the project and motivates further development.

For questions, feedback, or support, feel free to open an issue or contact the maintainers.

↑ Back to Top

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

pymmseqs-1.0.6.tar.gz (58.0 kB view details)

Uploaded Source

Built Distributions

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

pymmseqs-1.0.6-cp310-cp310-musllinux_1_2_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pymmseqs-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pymmseqs-1.0.6-cp310-cp310-macosx_11_0_arm64.whl (10.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file pymmseqs-1.0.6.tar.gz.

File metadata

  • Download URL: pymmseqs-1.0.6.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymmseqs-1.0.6.tar.gz
Algorithm Hash digest
SHA256 ba147285d12ddbcbada952687cf1870a70a90d3517e7923bb449487aef1e0b33
MD5 86640092cc1a9405b8cd3b6b6fb86d58
BLAKE2b-256 9076e81ce8dbdf3255ef1872677129352dc30b04c003972d303fb0ae15d00a0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.6.tar.gz:

Publisher: release.yaml on peymanvahidi/pymmseqs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymmseqs-1.0.6-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymmseqs-1.0.6-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 868a43d856da81bb6fdc996c4bdf69bd7adfd9493c675cd788ca7c930b4a580b
MD5 37e6507e122dae3b5a344c03951a7254
BLAKE2b-256 3d85b93c0914e714e4d000dbacd4bc563eebed77880bf26d049342aebf4a6f91

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.6-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: release.yaml on peymanvahidi/pymmseqs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymmseqs-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymmseqs-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 faa3f946faae0a72c97a587557b07c732ba6a7894ea03059a0ae83c1e881d15a
MD5 0ae14087ada836bc1190c568b1cf26f7
BLAKE2b-256 95f20f5c11b3acaf34c6aaa19568c2c189a05a3934fe4b3de2cfda8d08ab8c82

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on peymanvahidi/pymmseqs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymmseqs-1.0.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymmseqs-1.0.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3fb125a0926eb9896173beb2cac0ecfb1d3b284f63caccf61a180ec0de0e0c85
MD5 8d50e903033273f53d4b0dae6b19960e
BLAKE2b-256 56b04fd0d941d4adc3990ad0d9ea63c0b3a30a1b25409ac7453019d7b72a4b8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.6-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yaml on peymanvahidi/pymmseqs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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