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.7.tar.gz (58.9 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.7-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.7-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (7.4 MB view details)

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

pymmseqs-1.0.7-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.7.tar.gz.

File metadata

  • Download URL: pymmseqs-1.0.7.tar.gz
  • Upload date:
  • Size: 58.9 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.7.tar.gz
Algorithm Hash digest
SHA256 be527fc2477b2674d6450729dcb0817a1067a411668131787a078347d6a91929
MD5 d0fd75a9f76b6cfb0bdb351d4284c6dc
BLAKE2b-256 47c01a9d2dc42911fe8ecb5ea42fd4df93e33d9c48efccb835d408962388869e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.7.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.7-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymmseqs-1.0.7-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f468420fd81ec6bcf726c87510bb6d32d9e158411b5f62a8424a88e8357a0303
MD5 1cec0ff370b2f1e29ec7d05a1bfbe740
BLAKE2b-256 4bc5aaeed4a8b5104cdc9e3a3ba692753794ba9fdee2801ec3931acedcce9692

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.7-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.7-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pymmseqs-1.0.7-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6c53d24652eae42a86d82bf56d0de63035a47e613a54acb9034d609f90139b79
MD5 76f3ccb1ad317dcefe645cf1c7649dd8
BLAKE2b-256 ff56717f029142d5f9e65de5735b6e9c09099b6147d0b5834ca78f31ab8c92d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.7-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_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.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymmseqs-1.0.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af2ea833691d25f79a803780ddb63e44d935f5cc2385619afd00d50ae83cc81f
MD5 c1f9ac335239ae900fec9f60503e5e5c
BLAKE2b-256 37ec76873572df40ba5ce1bbfd0afb7e0692892111f8a4ce68268a45aea450e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.0.7-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