pymodulon.util
General utility functions for the pymodulon package
Module Contents
Functions
|
|
|
|
|
|
|
Computes D’agostino-test-based threshold for a component of an M matrix |
|
Creates DIMA table of differentially expressed iModulons |
|
Parses sample inputs into a list of sample IDs |
|
Computes the fraction of variance explained by iModulons (from 0 to 1) |
|
Infer iModulon activities for external data |
|
|
|
Mutual information of x and y (conditioned on z if z is not None) |
|
The classic K-L k-nearest neighbor continuous entropy estimator |
|
Small noise to break degeneracy, see doc. |
|
|
|
|
|
This part finds number of neighbors in some radius in the marginal space |
|
|
|
-
pymodulon.util.
compute_threshold
(ic, dagostino_cutoff)[source] Computes D’agostino-test-based threshold for a component of an M matrix
-
pymodulon.util.
dima
(ica_data, sample1, sample2, threshold=5, fdr=0.1, alternate_A=None)[source] Creates DIMA table of differentially expressed iModulons
- Parameters
sample1 (str or list) – List of sample IDs or name of “project:condition”
sample2 (str or list) – List of sample IDs or name of “project:condition”
threshold (float) – Minimum activity difference to determine DiMAs (default = 5)
fdr (float) – False Detection Rate (default = .1)
alternate_A (DataFrame) – Alternate A to use (default = None)
- Returns
results – Table of differentially expressed iModulons
- Return type
DataFrame
-
pymodulon.util.
_parse_sample
(ica_data, sample)[source] Parses sample inputs into a list of sample IDs
-
pymodulon.util.
explained_variance
(ica_data, genes=None, samples=None, imodulons=None, reference=None)[source] Computes the fraction of variance explained by iModulons (from 0 to 1)
- Parameters
genes (str or list, optional) – List of genes to use (default: all genes)
samples (str or list, optional) – List of samples to use (default: all samples)
imodulons (int or str or list, optional) – List of iModulons to use (default: all iModulons)
reference (list, optional) – List of samples that represent the reference condition for the set. If none are provided, uses the dataset-specific reference condition.
- Returns
Fraction of variance explained by selected iModulons for selected genes/samples
- Return type
-
pymodulon.util.
infer_activities
(ica_data, data)[source] Infer iModulon activities for external data
-
pymodulon.util.
mi
(x, y, z=None, k=3, base=2, alpha=0)[source] Mutual information of x and y (conditioned on z if z is not None) x, y should be a list of vectors, e.g. x = [[1.3], [3.7], [5.1], [2.4]] if x is a one-dimensional scalar and we have four samples
-
pymodulon.util.
entropy
(x, k=3, base=2)[source] The classic K-L k-nearest neighbor continuous entropy estimator x should be a list of vectors, e.g. x = [[1.3], [3.7], [5.1], [2.4]] if x is a one-dimensional scalar and we have four samples