decoupler.run_ulm

decoupler.run_ulm(mat, net, source='source', target='target', weight='weight', min_n=5, verbose=False, use_raw=True)

Univariate Linear Model (ULM).

ULM fits a linear model for each sample and regulator, where the observed molecular readouts in mat are the response variable and the regulator weights in net are the explanatory one. Target features with no associated weight are set to zero. The obtained t-value from the fitted model is the activity (ulm_estimate) of a given regulator.

Parameters
matlist, DataFrame or AnnData

List of [features, matrix], dataframe (samples x features) or an AnnData instance.

netDataFrame

Network in long format.

sourcestr

Column name in net with source nodes.

targetstr

Column name in net with target nodes.

weightstr

Column name in net with weights.

min_nint

Minimum of targets per source. If less, sources are removed.

verbosebool

Whether to show progress.

use_rawbool

Use raw attribute of mat if present.

Returns
estimateDataFrame

ULM scores. Stored in .obsm[‘ulm_estimate’] if mat is AnnData.

pvalsDataFrame

Obtained p-values. Stored in .obsm[‘ulm_pvals’] if mat is AnnData.