Skip to main content

XL-mHG: A Semiparametric Test for Enrichment

Project description

PyPI version Python versions supported License

master

Build Status (master branch) Coverage (master branch)

develop

Build Status (develop branch) Coverage (develop branch)

This is an efficient Python/Cython implementation of the semiparametric XL-mHG test for enrichment in ranked lists. The XL-mHG test is an extension of the nonparametric mHG test, which was developed by Dr. Zohar Yakhini and colleagues.

If you use the XL-mHG test in your research, please cite Eden et al. (PLoS Comput Biol, 2007) and Wagner (PLoS One, 2015).

Installation

$ pip install xlmhg

Usage

import xlmhg
stat, cutoff, pval = xlmhg.xlmhg_test(v, X, L)

Where: v is the ranked list of 0’s and 1’s, represented by a NumPy array of type "np.uint8", X` and L are parameters, and the return values have the following meanings:

  • stat: The XL-mHG test statistic

  • cutoff: The cutoff at which the XL-mHG test statistic was attained

  • pval: The XL-mHG p-value

What do the X and L parameters mean?

  • X refers to the minimum number of “1’s” that have to be seen before anything can be called “enrichment”.

  • L is the lowest cutoff (i.e., the largest n) that is being tested for enrichment.

A more direct way to understand X and L is through the definition of the XL-mHG test statistic. It is defined as the minimum hypergeometric p-value over all cutoffs at which at least X “1’s” have already been seen, and excluding any cutoffs larger than L. For X=1 and L=N, the XL-mHG test reduces to the mHG test.

Background

For a discussion of the statistical background and implementation of this test, please see the Technical Report on arXiv, as well as the XL-mHG PeerJ Preprint article.

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

xlmhg-2.2.4.tar.gz (120.3 kB view hashes)

Uploaded Source

Built Distributions

xlmhg-2.2.4-cp35-cp35m-win_amd64.whl (74.1 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

xlmhg-2.2.4-cp35-cp35m-win32.whl (62.7 kB view hashes)

Uploaded CPython 3.5m Windows x86

xlmhg-2.2.4-cp35-cp35m-manylinux1_x86_64.whl (280.6 kB view hashes)

Uploaded CPython 3.5m

xlmhg-2.2.4-cp35-cp35m-manylinux1_i686.whl (261.9 kB view hashes)

Uploaded CPython 3.5m

xlmhg-2.2.4-cp27-cp27mu-manylinux1_x86_64.whl (285.6 kB view hashes)

Uploaded CPython 2.7mu

xlmhg-2.2.4-cp27-cp27mu-manylinux1_i686.whl (267.9 kB view hashes)

Uploaded CPython 2.7mu

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