decoupler.pp.adjmat

Contents

decoupler.pp.adjmat#

decoupler.pp.adjmat(features, net, verbose=False)#

Converts a network in long format into a regulatory adjacency matrix (targets x sources).

Parameters:

net (DataFrame) – Dataframe in long format. Must include source and target columns, and optionally a weight column.

Return type:

tuple[ndarray, ndarray, ndarray]

Returns:

Returns the source names (columns), target names (rows), and the adjacency matrix of weights.

Example

import decoupler as dc

adata, net = dc.ds.toy()
X, obs_names, var_names = dc.pp.extract(adata)
gst_names, var_names, adjm = dc.pp.adjmat(var_names, net)