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.1.0.tar.gz (85.1 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.1.0-cp310-cp310-musllinux_1_2_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pymmseqs-1.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (6.9 MB view details)

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

pymmseqs-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for pymmseqs-1.1.0.tar.gz
Algorithm Hash digest
SHA256 31b4beec07f324b75e1b04d28fcd8e4b83f718c509d184f798f00f8d4cb0ef25
MD5 a0b99284ae0227d17570c45ced3c79b5
BLAKE2b-256 253108a89ffff946c1e994befba0524c5a151e3306a5a4abc7d0872bb22a7c0c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pymmseqs-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5579f93d2f01b9308e97e84db0f2fabbd225ce6e6c1e257579cd6a7a3e1f57b5
MD5 3a8c0b9db39119052df09f75ff0c5315
BLAKE2b-256 a38c6a641ccd3fd2538f33341f731093e3eea4a2171ace596d9924e0a2a8d674

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pymmseqs-1.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8ed5651f2361060330357992ec9c71309f9cbf0d756700d00a268f33d7fd1d62
MD5 c07838b6e7dc0c2c2f6d2c774ccf7f6a
BLAKE2b-256 150ffd12707b19f26fecf2387170b04b3a96b1f86f1920856d360dd0cc152e5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymmseqs-1.1.0-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.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymmseqs-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 facb5de2d5510e548e4c4f77de99b02c136f3fa042d38e4936fda8dc3f4dcd8d
MD5 4a87ada3305f14b3275bb4557adc4c98
BLAKE2b-256 c0ac997e326bfa410ed4c75845c3a2b38b89f1b6d6c1992c5c476b7499fd6878

See more details on using hashes here.

Provenance

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