decoupler.pp.net_corr#
- decoupler.pp.net_corr(net, data=None, tmin=5, verbose=False, **kwargs)#
Checks the correlation across the sources in a network.
If data is also provided, target features will be prunned to match the ones in mat.
- Parameters:
- net
DataFrame Dataframe in long format. Must include
sourceandtargetcolumns, and optionally aweightcolumn.- data
None|AnnData|DataFrame|tuple[ndarray,ndarray,ndarray] (default:None) anndata.AnnDatainstance,pandas.DataFrame, or a tuple of(matrix, samples, features). All methods assume that input values follow a normal distribution unless otherwise specified. Therefore, when working with observational count data, some form of normalization is required (e.g.,scanpy’s library-size normalization followed by log1p). Using raw integer counts is not recommended, as they follow a Poisson distribution.Feature scaling on normalized counts is also acceptable, but note that it changes the results by assuming equal importance across features, and outcomes will vary depending on which observations are included.
No normalization or transformation is required when using contrast-level feature statistics such as log fold changes or Wald test statistics.
- tmin
int(default:5) Minimum number of targets per source. Sources with fewer targets will be removed.
- verbose
bool(default:False) Whether to display progress messages and additional execution details.
- kwargs
All other keyword arguments are passed to
decoupler.pp.extract
- net
- Return type:
- Returns:
Correlation pairs dataframe.
Example
import decoupler as dc adata, net = dc.ds.toy() dc.pp.net_corr(net, tmin=3)