Giter VIP home page Giter VIP logo

regulation-pwm-tools's Introduction

MOODS-tools

This package provides a more pythonic wrapper around the MOODS Cpp // swig motif scanning tool.

There is also a notebook and some test data showing an example workflow. The deps for this are included as poetry development dependencies.

Package Structure

There are two main classes in the package, Scanner and Motif. Motif provides a representation of a scanning matrix (for example a PWM, but not limited to just this) in numpy format, alongside an ID field and a threshold. There are convenience functions for loading PWMs from PFMs, and for calculating p-values (this just wraps MOODS).

The Scanner class takes a list of motifs, and builds a scanner, which will efficiently scan a nucleotide sequence in one pass. This is a bit fiddly, since the scanner is not strand-aware, and returns hits by motif order. I've taken a similar approach to the moods-py script we use in regulation, but this is wrapped up so that the .scan() method takes a pyfaidx.Sequence and outputs a list of TFBSs (small dataclass, effectively just a BED row, tuples might be faster).

There is also a cli scan command, which should be very similar to the moods-py script, but taking PWMs in json input, and some functions in readers.py for parsing MOODS or JASPAR PWMs.

Multicore

Currently the package doesn't have an easy way to use multiple cores: because Scanner uses Swig objects, they can't be pickled. The most straightforward way would probably be to create N processes to do the scanning, and just build a new Scanner in each one.

regulation-pwm-tools's People

Contributors

mgperry avatar

Watchers

James Cloos avatar  avatar

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.