liana.method.lrMistyData

liana.method.lrMistyData(adata, resource_name='consensus', resource=None, nz_threshold=0.1, use_raw=False, layer=None, spatial_key='spatial', kernel='misty_rbf', bandwidth=100, set_diag=False, cutoff=0.1, zoi=0, verbose=False)

Generate a MistyData object from an AnnData object in ligand-receptor format.

Parameters:
adataanndata.AnnData

AnnData object

resource_namestr, optional (default: ‘consensus’)

The name of the resource to use. See show_resources for available resources.

resourcepandas.DataFrame, optional (default: None)

A resource in the form of a pandas DataFrame. If None, the resource is selected using select_resource.

nz_thresholdfloat, optional (default: 0.1)

The threshold for the number of non-zero entries in each view.

use_rawbool, optional (default: False)

Whether to use the raw data of the AnnData object.

layerstr, optional (default: None)

The layer of the AnnData object to use.

spatial_keystr, optional (default: ‘spatial’)

The key in adata.obsm where the spatial coordinates are stored.

kernelstr, optional (default: ‘misty_rbf’)

A radial basis function kernel to use for the generation of the connectivity matrix for the extra view. Default is ‘misty_rbf’, a kernel derivative of a Gaussian kernel.

bandwidthfloat, optional (default: 100)

The bandwidth of the kernel.

set_diagbool, optional (default: True)

Whether to set the diagonal of the connectivity matrix to 1.

cutofffloat, optional (default: 0.1)

The minimum value cutoff for the connectivity matrix.

zoifloat, optional (default: 0)

Zone of indifference of the kernel, i.e. the kernel is set to 0 for distances smaller than zoi.

verbosebool, optional (default: False)

Whether to print progress.

Returns:
A MistyData object with receptors in the intra view & ligands in the extra view.