Code Monkey home page Code Monkey logo

malax's Introduction

MALAX

Association testing of bisulfite sequencing methylation data via a Laplace approximation

MALAX (Mixed model Association via Laplace ApproXimation) is a Python package for association testing of bisulfite sequencing methylation data. It models the phenotype as an explanatory variable and each tested site as a reponse variable, using a binomial generalized linear mixed model (GLMM). The likelihood is approximated via a Laplace approximation.

MALAX was published in: Association testing of bisulfite-sequencing methylation data via a Laplace approximation. Bioinformatics 33.14, i325-i332 (2017).

Several parts of the code are loosely based on code translated from the GPML toolbox.



Installation

MALAX is designed to work in Python 2.7, and depends on the following freely available Python packages:

Typically, the packages can be installed with the command "pip install --user <package_name>".

MALAX is particularly easy to use with the Anaconda Python distribution. The numerically optimized version of Anaconda can speed MALAX significantly. Alternatively (if numerically optimized Anaconda can't be installed), for very fast performance it is recommended to have an optimized version of Numpy/Scipy installed on your system, using optimized numerical libraries such as OpenBLAS or Intel MKL (see Compilation instructions for scipy with Intel MKL).

Once all the prerequisite packages are installed, MALAX can be installed on a git-enabled machine by typing:

git clone https://github.com/omerwe/MALAX

The project can also be downloaded as a zip file from the Github website.

After downloading the code, please compile the code by going to the MALAX directory and typing:

python setup.py build_ext --inplace

To verify that the compilation succeeded, please verify that the file laplace_cython.so was created in the directory.



Usage Overview

MALAX can be invoked via the script run_laplace.py.The list of available options can be seen by typing run_laplace.py --help.

TL;DR

For an example, please run the following command (using the anaconda version of python if available):

python run_laplace.py --mcounts example/y.txt --counts example/r.txt --predictor example/pred.txt --kernel example/K.txt --kernel2 example/cell_types_K.txt --covar example/covars.txt --out example/malax_2K.txt

This will analyze the data in the example directory using two variance components and will print the results to the file example/malax_2K.txt.



Detailed Instructions

MALAX takes as input a file with number of reads (r.txt in the example directory), a file with with number of methylated reads (y.txt), a file with a predictor (pred.txt), a file with covariates (covars.txt), and one or two covariance matrices associated with random effects (K.txt and cell_types_K.txt). The corresponding flags can be seen in the example above. The code will print a file with a p-value for every tested site.

Additionally, the code supports a fixed effects beta-binomial model, which can be invoked by adding the flag --test bb to the example command above. This code will ignore the --kernel and --kernel2 commands.

The format of the files can be seen in the example directory. It is the same format as used by MACAU.

malax's People

Contributors

omerwe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.