Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.


Bayesian tests for set enrichment.

Tests!

Installation

Install from PyPI

pip install brioche-enrichment

or install from the Github repository

git clone git@github.com:dpohanlon/brioche.git
pip install -r requirements.txt .

Usage

Prepare some data in a contingency table format, with row and column set annotations

row_names = ["a", "b", "c", ...]
col_names = ["l", "m", "n", ...]

data = np.array([[30, 27, 10, ...], [28, 25, 11, ...], [31, 29, 15, ...], ...])

Import Brioche and create the multi-set enrichment object

from brioche.multisetEnrichment import MultisetEnrichment

enrichment = MultisetEnrichment(data, col_names, row_names, likelihood_type="sum")

Optionally, specify whether there are total-sum constraints on the rows or columns

enrichment = MultisetEnrichment(data, row_names, col_names, row_constraint = True,
								col_constraint = False, likelihood_type="sum")

likelihood_type determines the form of the likelihood model for each cell, and also therefore what the 'null' model is. Both assume that each cell is a combination of a row and a column term, and a term that describes the deviation of the cell from the row and column terms:

$$n_{ij} = r_i + c_j + d_{ij}$$

When likelihood_type = 'sum', these are combined with a sum (the default), and when likelihood_type = 'prod' these are multiplied.

Run the Markov-chain Monte Carlo inference on the enrichment model, retrieve samples from the posterior, and return a Pandas DataFrame of enrichment z scores

samples = enrichment.runMCMC(num_samples=10000)

results = enrichment.getSummary(samples)

Plot model parameters and enrichment posterior probability distributions

from brioche.plot import plotDeviations

plotDeviations(samples, threshold=2, x_labels=col_names, y_labels=row_names, name="test-")

Metadata

Release files for brioche-enrichment 0.1.2a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brioche-enrichment 0.1.2a0
File Size Uploaded Provenance Actions
brioche_enrichment-0.1.2a0.tar.gz 9.9 kB Without provenance Details for brioche_enrichment-0.1.2a0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brioche-enrichment 0.1.2a0
File Interpreter ABI Platform Actions
brioche_enrichment-0.1.2a0-py3-none-any.whl Python 3 none any Details for brioche_enrichment-0.1.2a0-py3-none-any.whl

Total release size: 21.0 kB

Release files / brioche_enrichment-0.1.2a0.tar.gz

Download URL brioche_enrichment-0.1.2a0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5ccc3ce8fb1a63cb673fd235e833ef53395e7025320b4246140c269a7aed0843
BLAKE2b-256 checksum
How to use checksums
c61a8edb3358820ad8eb5a554fa1de4b12dbc339ea497c33c21527cabcab611c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / brioche_enrichment-0.1.2a0-py3-none-any.whl

Download URL brioche_enrichment-0.1.2a0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1729e9b84ea2ebbd9573ff18b244fe326515d0655c8f3d5bd50214f9e1d7d317
BLAKE2b-256 checksum
How to use checksums
3368c4bd37dd31237d1f105436c8e7ff3d6355de074d8ccc2fafa3cfa502fa23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Security for brioche-enrichment 0.1.2a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page