decoupler.run_consensus

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

Consensus score from top methods.

This consensus score is calculated from the three top performer methods: ulm, mlm and wsum_norm. For each of these methods, the obtained activities are transformed into z-scores, first for positive values and then for negative ones. These two sets of z-score transformed activities are computed by subsetting the values bigger or lower than 0, then by mirroring the selected values into their opposite sign and finally calculating a classic z-score. This transformation ensures that values across methods are comparable, and that they remain in their original sign (active or inactive). The final consensus score is the mean across different methods. A p-value is then estimated from these using a cumulative distribution function.

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

Consensus scores. Stored in .obsm[‘consensus_estimate’] if mat is AnnData.

pvalsDataFrame

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