Giter VIP home page Giter VIP logo

mbelmadani / motifgp Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 209 KB

Motif discovery for DNA sequences using multiobjective optimization and genetic programming.

Home Page: https://mbelmadani.github.io/motifgp/

License: GNU Lesser General Public License v3.0

Python 99.55% Shell 0.45%
motif genetic-programming multiobjective-optimization bioinformatics chip-seq regular-expressions network-expressions strongly-typed motif-discovery transcription-factors

motifgp's People

Contributors

mbelmadani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

motifgp's Issues

Multiprocessor support

Modify engine.py to evaluate of solutions in parallel. (add toolbox.register("map", some_mapping_function)).

Possibilities include python multiprocessing, Scoop, or pathos. The multiprocessing module is standard python, while Scoop appears to integrate well with DEAP and seems to extend beyong multiprocessing (e.g support for clusters), which is nice. The issue with these modules is that they don't automatically serialize instance methods and certain modules, required by the function mapped to the toolbox.evaluate method, which makes it difficult to use with motifgp without significant modifications. Pathos appears to handle serialization by default, so it might a good start point.

An issue with this multiprocessing is that it might break memoization since the dict for the cache is not shared, so it probably won't be updated or shared between evaluations. This might be possible to fix with a workaround the shared memory using. If not, it might be better to add cache-less parallelism, or reconsider python multiprocessing or scoop.

_

Duplicate

Implement a verbosity system and use the logging module

Standard output (messages) writing is currently used inconsistently (for example, sometimes using sys.write(), others with print() ).

  1. Every message or result specifc output (like the output pareto front, or motif statistics) should be using print() function. Other messages should use the python 'logging' module. Logger.info() for messages that are expected, Logger.critical() when the program errors and terminates, and Logger.warning( ) for anything else.

  2. At the same time, add a check for a verbosity level for each Logger and print. Having the verbosity as a string would allow more flexibility to the user. An idea:

i = info
w = warning
s = stats
r = results
d = debug - Also print the source location of the message

The user provides a string with these tags (e.g. "isr" for everything except warnings) and logging is only done for those in the string. Critical level messages are always printed, unless there's a good reason not to.

Logger should be configured as:

import logging
if "l" in options.verbosity:
    FORMAT = '[%(filename)s:%(lineno)s - %(funcName)20s() ] %(asctime)15s - %(levelname)s : %(message)s'
else:
    FORMAT = '%(asctime)15s - %(levelname)s : %(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger(__name__)

and messages logged with:

if` "w" in options.verbosity:
    logger.warning("The warning message")

This change should not be made for standalone scripts, this is only for motifgp.py and its classes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.