rapids_singlecell.dcg.mlm#
- rapids_singlecell.dcg.mlm = <rapids_singlecell.decoupler_gpu._helper._Method.Method object>#
Multivariate Linear Model (MLM).
This approach uses the molecular features from one observation as the population of samples and it fits a linear model with with multiple covariates, which are the weights of all feature sets .
Where:
is the observed feature statistic (e.g. gene expression, , etc.) for feature
is the weight of feature in feature set . For unweighted sets, membership in the set is indicated by 1, and non-membership by 0.
is the intercept
is the slope coefficient for feature set
is the error term for feature
The enrichment score for each is then calculated as the t-value of the slope coefficients.
Where:
is the t-value of the slope
is the standard error of the slope
Next, are obtained by evaluating the two-sided survival function () of the Student’s t-distribution.
- Parameters:
- data
AnnData instance, DataFrame or tuple of [matrix, samples, features].
- net
Dataframe in long format. Must include
sourceandtargetcolumns, and optionally aweightcolumn.- tmin
Minimum number of targets per source. Sources with fewer targets will be removed.
- layer
Layer key name of an
anndata.AnnDatainstance.- raw
Whether to use the
.rawattribute ofanndata.AnnData.- empty
Whether to remove empty observations (rows) or features (columns).
- bsize
For large datasets in sparse format, this parameter controls how many observations are processed at once. Increasing this value speeds up computation but uses more memory. If omitted, uses the method’s default batch size.
- verbose
Whether to display progress messages and additional execution details.
- pre_load
Whether to pre-load the data into memory. If
True, the data will be pre-loaded into memory before processing.- adj_pv_gpu
Whether to use GPU for adjusting p-values.
- tval
Whether to return the t-value (
tval=True) the coefficient of the fitted model (tval=False).
- Returns:
Enrichment scores and, if applicable, adjusted by Benjamini-Hochberg.
Example
import decoupler as dc adata, net = dc.ds.toy() rsc.dcg.mlm(adata, net, tmin=3)