Skip to main content

Cython bindings and Python interface to the MEME suite.

Project description

🐍Ⓜ️ pyMEMEsuite Stars

Cython bindings and Python interface to the MEME suite, a collection of tools for the analysis of sequence motifs.

Actions Coverage PyPI Wheel Python Versions Python Implementations License Source GitHub issues Docs Changelog Downloads

🗺️ Overview

The MEME suite is a collection of tools used for discovery and analysis of biological sequence motifs.

pymemesuite is a Python module, implemented using the Cython language, that provides bindings to the MEME suite. It directly interacts with the MEME internals, which has the following advantages over CLI wrappers:

  • single dependency: If your software or your analysis pipeline is distributed as a Python package, you can add pymemesuite as a dependency to your project, and stop worrying about the MEME binaries being properly setup on the end-user machine.
  • no intermediate files: Everything happens in memory, in Python objects you have control on, making it easier to pass your inputs to MEME without needing to write them to a temporary file. Output retrieval is also done in memory.

This library is still a work-in-progress, and in an experimental stage, but it should already pack enough features to run biological analyses or workflows involving FIMO.

🔧 Installing

pymemesuite can be installed from PyPI, which hosts some pre-built CPython wheels for x86-64 Linux, as well as the code required to compile from source with Cython:

$ pip install pymemesuite

💡 Example

Use MotifFile to load a motif from a MEME motif file, and display the consensus motif sequence followed by the letter frequencies:

from pymemesuite.common import MotifFile

with MotifFile("tests/data/fimo/prodoric_mx000001_meme.txt") as motif_file:
    motif = motif_file.read()

print(motif.name.decode())
print(motif.consensus)

for row in motif.frequencies:
    print(" ".join(f'{freq:.2f}' for freq in row))

Then use FIMO to find occurences of this particular motif in a collection of sequences, and show coordinates of matches:

import Bio.SeqIO
from pymemesuite.common import Sequence
from pymemesuite.fimo import FIMO

sequences = [
    Sequence(str(record.seq), name=record.id.encode())
    for record in Bio.SeqIO.parse("tests/data/fimo/mibig-genes.fna", "fasta")
]

fimo = FIMO(both_strands=False)
pattern = fimo.score_motif(motif, sequences, motif_file.background)

for m in pattern.matched_elements:
    print(
        m.source.accession.decode(),
        m.start,
        m.stop,
        m.strand,
        m.score,
        m.pvalue,
        m.qvalue
    )

You should then get a single matched element on the forward strand:

BGC0002035.1_3425_15590 6700 6714 + 9.328571428571422 1.1024163606971822e-05 0.6174858127445146

📋 Features

🧶 Thread-safety

FIMO objects are thread-safe, and the FIMO.score_motif and FIMO.score_pssm methods are re-entrant. This means you can search occurences of several motifs in parallel with a ThreadPool and a single FIMO instance:

from multiprocessing.pool import ThreadPool
from pymemesuite.fimo import FIMO

fimo = FIMO()
with ThreadPool() as pool:
    patterns = pool.map(
        lambda motif: fimo.score_motif(motif, sequences, background),
        motifs
    )

📌 Roadmap

  • error management: Make sure to catch exceptions raised by the MEME core without exiting forcefully.
  • transfac: Support for TRANSFAC motifs in addition to MEME motifs.
  • meme: Motif discovery through enrichment analysis between two collections of sequences.

💭 Feedback

⚠️ Issue Tracker

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.

🏗️ Contributing

Contributions are more than welcome! See CONTRIBUTING.md for more details.

⚖️ License

This library is provided under the MIT License. The MEME suite code is available under an academic license which allows distribution and non-commercial usage. See vendor/meme/COPYING for more information.

Test sequence data were obtained from MIBiG and are distributed under the CC BY 4.0 license. Test motifs were obtained from PRODORIC and are distributed under the CC BY-NC 4.0 license.

This project is in no way affiliated, sponsored, or otherwise endorsed by the original MEME suite authors. It was developed by Martin Larralde during his PhD project at the European Molecular Biology Laboratory in the Zeller team.

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

pymemesuite-0.1.0a1.tar.gz (3.6 MB view details)

Uploaded Source

Built Distributions

pymemesuite-0.1.0a1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded PyPy macOS 10.9+ x86-64

pymemesuite-0.1.0a1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded PyPy macOS 10.9+ x86-64

pymemesuite-0.1.0a1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.6 MB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

pymemesuite-0.1.0a1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded PyPy macOS 10.9+ x86-64

pymemesuite-0.1.0a1-pp36-pypy36_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.6 MB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

pymemesuite-0.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (8.6 MB view details)

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

pymemesuite-0.1.0a1-cp310-cp310-macosx_10_15_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pymemesuite-0.1.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

pymemesuite-0.1.0a1-cp39-cp39-macosx_10_15_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pymemesuite-0.1.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

pymemesuite-0.1.0a1-cp38-cp38-macosx_10_15_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

pymemesuite-0.1.0a1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

pymemesuite-0.1.0a1-cp37-cp37m-macosx_10_15_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

pymemesuite-0.1.0a1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

pymemesuite-0.1.0a1-cp36-cp36m-macosx_10_14_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

Details for the file pymemesuite-0.1.0a1.tar.gz.

File metadata

  • Download URL: pymemesuite-0.1.0a1.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pymemesuite-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 d85905916f79b52771e5c337961420eb818c820ff2d0d8a5deba24a3af21b243
MD5 db0e3de1909807501216923da2b0310e
BLAKE2b-256 6322897a0a16319c5346e41ec2b50345d23907c24bcf74dd238d23aa7e892eaa

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fdfc3f1951256cf2c771b0de24d79dfabfd4f435bd93993876dd82296ca9f7e3
MD5 d7b96fb20c4bc0613be01dc9cae7ea7a
BLAKE2b-256 359519b6290dbfabee85008ddf90236e47b39cb7b6cb8e3aed94baf71c00c128

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a399fd847f0abb5f77386d255a261a77ed89eaa67be24c08255e8dcff7f7bb68
MD5 0e4d20181651c94d5dfddf13b5dc9512
BLAKE2b-256 4183b2a370eeae1f42c7d4f086df05c5dd4d4435ab07f507f6692b9210e56e83

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4d41ae625f185df2c0ec5a46273893e58f2b075ac7c8332c93fb3e56d01c1e68
MD5 2e6115012cdab971a76ba7a6de9dbb58
BLAKE2b-256 bf46cdc67d586953e0731614dc4e3e84186f62616bcdedbd667fc67eb95c38a7

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1dd574b877339823d20c862f080724efc2dccb6bc2629d6691a125d5b91cc520
MD5 a679db90b7bfcd3adb34b79e26ad3887
BLAKE2b-256 9efeb701f177771722a6c0fffab49222fd193c2687997a69e9eeab68e6a273e3

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-pp36-pypy36_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-pp36-pypy36_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 040ee048bfd799d5e09a03971898b073b8a462ab9a8898142dead10164aab86d
MD5 4ab9b69761a9c4342fa95783b35acc0a
BLAKE2b-256 f97c7dbba94410fc15df2cff7325b9bceacf87b9e2c1e16093f87f30ef1ef89a

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 54989ddac2ce62b3689265c1d89619c13afaff8b5bc33570129cded1b4ce4a31
MD5 2f5937ba1205c9c2abacb1eeb3ba531f
BLAKE2b-256 1b49883c904a873c82c4de61ef961eb24ca1428385865d87ac13b11008ea370d

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7e977f95338a5001283a09f2e7de3699dc716b79d1a4a6cafe255defde8738d8
MD5 d9df40401f18fb27137647b898116c2a
BLAKE2b-256 b4f7eaae9d6db088ec5dd201dbe440f835410057580f355cf84cf6b3f98f7d12

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 39eb9e091dbf823bd8827355ef8043dc4c8358b5c643f2df61c149a6fb3a1308
MD5 a992b911ba99658048263f99448d87b3
BLAKE2b-256 76138214fa038215914a4d87db51c6b85017f9800ac2f0066872ef07e334745f

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 38a7e35a6154be28972ccb5abe03ebbbf44c714a1f9da38d4dd69a079d5575c1
MD5 ec187fd894dc3bb38fad20d9d2d717aa
BLAKE2b-256 6d57bbb63738e014c3f9e676b3e2f8cee7894a32d9a579fb5258e0ccaa131473

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 ef3dc1a5c6f4d057c0f74e730f61d6afae80a8c512572303a6ef5085805b41f4
MD5 17d059f452d704c67818bbbe1d6e7ab7
BLAKE2b-256 0d58ef8fc705a4420b8f75384deca0cc37da20b5ea7898db74970d2cd9c32635

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f8623e7a0c8743a871134ee3efa306d6363053d5544a63d2cf688bd9190e7d08
MD5 062b9c1a90b5cdf17d038129901db7d7
BLAKE2b-256 a0037dc75764148561a3a3eb4e5672d60cd2e44ee4bb37ecbe02c95db8c13fbb

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 979d8cfd9289205b2bf821bd6b5620ab6ba6e82ba73f736e3ecd3fbccdddc027
MD5 1906bd8095860205780c3c389377b18f
BLAKE2b-256 0b059926c05eecb8af288a4e9c4bf073fcf5903789aa9c546e37c01ef477ee89

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a189e0d08adaa9a7d1f6354db652d22e801f0a7d5bb746a47a4a84754512e384
MD5 10d34c27e4560aa0b5e13b24898fbebb
BLAKE2b-256 6796e739d91b5a58dc942b9d427a9d933d29a2e2917300649df389127560a733

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 a7d1c01a0a2d821dd140a382cc9525fff87993eb7a786862322075801ba84f43
MD5 98d3c6494907dbc0a3d112a908f7fa48
BLAKE2b-256 1a08107d81f3f6c4593ac55057663c67b4671e8aff11d2bf1124030e847894ba

See more details on using hashes here.

Provenance

File details

Details for the file pymemesuite-0.1.0a1-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pymemesuite-0.1.0a1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7708b733a84b23d270e36c376b38c3ff26daf028705a58ef180c31f705cf979b
MD5 bd3ec805907de03f1abee4b356da13b9
BLAKE2b-256 2917011d646ed0e8ae8458a1f0ad5db0532af64f12dfd96663777d2392c93188

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page