Skip to main content

XL-mHG lite: A light implementation of the Semiparametric Enrichment Test

Project description

Useful links: Documentation | Source code | Bug reports | PyPI version | Python versions supported | Build status | Downloads | License

xlmhg 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.

xlmhglite is a fork of the original xlmhg package (which is unfortunately no longer being maintained). This fork was updated to support modern Python versions (Python >=3.8), fix bugs in the original implementation, and reduce the mandatory dependencies of the project to a minimum. To that end, the plotting functionality of xlmhg is not part of the core xlmhglite package, instead being an optional requirement.

Installation

To install the core (“lite”) version of xlmhglite: .. code-block:: bash

$ pip install xlmhglite

To install the complete version of xlmhglite (including the plotting functionality): .. code-block:: bash

$ pip install xlmhglite[‘all’]

Getting started

The xlmhglite package provides two functions (one simple and more more advanced) for performing XL-mHG tests. These functions are documented in the User Manual. Here’s a quick example using the “simple” test function:

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

Where: v is the ranked list of 0’s and 1’s, represented by a NumPy array of integers, X and L are the XL-mHG parameters, and the return values have the following meanings:

  • stat: The XL-mHG test statistic

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

  • pval: The XL-mHG p-value

Documentation

Please refer to the XL-mHG User Manual (hosted on ReadTheDocs).

Citing XL-mHG

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

1.0.1 (2023-06-11)

Minor patch addressing installation issues.

1.0.0 (2023-06-10)

First stable release.

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

xlmhglite-1.0.1.tar.gz (260.3 kB view hashes)

Uploaded Source

Built Distribution

xlmhglite-1.0.1-cp38-cp38-win_amd64.whl (84.9 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

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