Skip to main content

A Python package to find strong correlations among P variables, each with N observations.

Project description

betaMixPy

The betaMixPy package is used to find edges in gene networks using co-expression data. The betaMixPy method is built on the insightful results of Frankl and Maehara (1990) who showed that two random vectors are approximately perpendicular with high probability, if the dimension of the space is sufficiently large. The pair-wise correlations between pairs of predictors are equal to the cosine of the angles between the pairs. From these angles we compute $z_j=\sin^2(\theta)$ and fit a mixture of two beta distributions to the $z_j$'s. For pairs of random vectors (the null set) the distribution of $z_j$ is Beta((N-1)/2, 1/2), where N is the sample size. The nonnull set is assumed to follow a Beta(a,b) distribution, and using the EM algorithm we estimate a,b, and the proportion, p0, of the null set of pairs. The betaMix function determines a threshold which will control the error rate given by the user. Any $z_j$ below that threshold corresponds to a significantly correlated pair of predictors (an edge in the graphical model.)

The input to the program is a normalized expression matrix, with predictors/genes (nodes) in the rows, and samples in the columns.

With a large number of predictors, P, the estimation may be slow, so it is recommended to set the parameter subsamplesize to something smaller than choose(P,2). The minimum allowed by the program is 20,000. Using anything smaller will cause betaMixPy to fit the model to all choose(P,2) pairs.

If the N samples can be assumed to be indepndent, set the parameter ind to True (the default). If it is set to False, the null set follows a Beta((nu-1)/2, 1/2) distribution and nu (the effective sample size) is estimated from the data in the EM algorithm.

To install the package, run

pip3 install betaMixPy

Additional documentation and examples are available in the doc, code and data folders on GitHub

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

betaMixPy-0.1.4.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

betaMixPy-0.1.4-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file betaMixPy-0.1.4.tar.gz.

File metadata

  • Download URL: betaMixPy-0.1.4.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for betaMixPy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0366cb532c43db9716857e33b75fb7d77a0822834b858464ea97e5ca8c87a7d4
MD5 f33e400f6898e4848d77bd18209fbcee
BLAKE2b-256 492170503ded8b734f1b77910bb1819407b5b45e8a91f634617d546397706be8

See more details on using hashes here.

File details

Details for the file betaMixPy-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: betaMixPy-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for betaMixPy-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2d7731a9d4229eea25467f3194ee7abb115652e144d8e98b5df296daeeed33f0
MD5 c692974c49795a815b696f397eb3e76a
BLAKE2b-256 a0130ef2bcf3cb9dc24ac53627a3bbf9b96405e5b8f84a73e7f5fe05363378a3

See more details on using hashes here.

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