https://github.com/althonos/pymemesuite

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

https://github.com/althonos/pymemesuite

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords

bioinformatics cython-library genomics meme-suite sequence-analysis sequence-motif
Last synced: 5 months ago · JSON representation

Repository

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

Basic Info
  • Host: GitHub
  • Owner: althonos
  • License: mit
  • Language: Cython
  • Default Branch: main
  • Homepage:
  • Size: 23.7 MB
Statistics
  • Stars: 15
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 1
Topics
bioinformatics cython-library genomics meme-suite sequence-analysis sequence-motif
Created almost 4 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog Contributing License

README.md

🐍Ⓜ️ 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

🚩 If you are interested in running sequence motif analyses with PSSMs, I recommend using the lightmotif project, which is a re-implementation of the algorithm used in FIMO, which can process sequences at speeds of GB/s.

🗺️ 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: console $ 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:

```python from pymemesuite.common import MotifFile

with MotifFile("tests/data/fimo/prodoricmx000001meme.txt") as motiffile: motif = motiffile.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:

```python 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(bothstrands=False) pattern = fimo.scoremotif(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: ```python 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.

Owner

  • Name: Martin Larralde
  • Login: althonos
  • Kind: user
  • Location: Heidelberg, Germany
  • Company: EMBL / LUMC, @zellerlab

PhD candidate in Bioinformatics, passionate about programming, SIMD-enthusiast, Pythonista, Rustacean. I write poems, and sometimes they are executable.

GitHub Events

Total
  • Watch event: 5
  • Issue comment event: 4
  • Push event: 8
Last Year
  • Watch event: 5
  • Issue comment event: 4
  • Push event: 8

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 89
  • Total Committers: 1
  • Avg Commits per committer: 89.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Martin Larralde m****e@e****e 89
Committer Domains (Top 20 + Academic)
embl.de: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 0
  • Average time to close issues: 6 days
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 0
  • Average comments per issue: 4.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 6 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 4.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • j-andrews7 (1)
  • jhahnfeld (1)
Pull Request Authors
Top Labels
Issue Labels
enhancement (1) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 645 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
pypi.org: pymemesuite

Cython bindings and Python interface to the MEME suite.

  • Homepage: https://github.com/althonos/pymemesuite
  • Documentation: https://pymemesuite.readthedocs.io/
  • License: MIT License Copyright (c) 2021-2024 Martin Larralde <martin.larralde@embl.de> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.1.0a4
    published 9 months ago
  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 645 Last month
Rankings
Dependent packages count: 4.8%
Downloads: 13.0%
Average: 18.5%
Dependent repos count: 21.6%
Stargazers count: 23.1%
Forks count: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/requirements.txt pypi
  • auditwheel *
  • codecov *
  • coverage *
  • cython *
  • psutil *
  • setuptools >=46.4
  • wheel >=0.35.0
.github/workflows/package.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v3 composite
  • actions/upload-artifact v2 composite
  • docker/setup-qemu-action v2 composite
  • pypa/cibuildwheel v2.11.3 composite
  • pypa/gh-action-pypi-publish master composite
  • rasmus-saks/release-a-changelog-action v1.0.1 composite
.github/workflows/test.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v3 composite
pymemesuite/tests/requirements.txt pypi
  • importlib-resources * test
  • numpy * test
setup.py pypi