liana.method.genericMistyData

liana.method.genericMistyData(intra, intra_use_raw=False, intra_layer=None, extra=None, extra_use_raw=False, extra_layer=None, nz_threshold=0.1, add_para=True, spatial_key='spatial', set_diag=False, kernel='misty_rbf', bandwidth=100, zoi=0, cutoff=0.1, add_juxta=True, n_neighs=6, max_neighs=18, verbose=False)

Construct a MistyData object from an AnnData object with views as presented in the manuscript.

Parameters:
intraanndata.AnnData

AnnData object with the intraview

intra_use_rawbool, optional (default: False)

Whether to use the raw data of the intraview.

intra_layerstr, optional (default: None)

The layer of the intraview to use.

extraanndata.AnnData, optional (default: None)

AnnData object with the extraview(s). If None, the extraview is set to be the same as the intraview.

extra_use_rawbool, optional (default: False)

Whether to use the raw data of the extraview.

extra_layerstr, optional (default: None)

The layer of the extraview(s) to use.

nz_threshold: `float`, optional (default: 0.1)

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

add_parabool, optional (default: True)

Whether to add the paraview.

spatial_keystr, optional (default: ‘spatial’)

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

set_diagbool, optional (default: True)

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

kernelstr, optional (default: ‘misty_rbf’)

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

bandwidthfloat, optional (default: 100)

The bandwidth of the kernel.

zoifloat, optional (default: 0)

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

cutofffloat, optional (default: 0.1)

The cutoff for the connectivity matrix.

add_juxtabool, optional (default: True)

Whether to add the juxtaview. The juxtaview is constructed using only the nearest neighbors. A bandwidth of 5 times the bandwidth of the paraview is used to ensure that the nearest neighbors within the radius.

n_neighsint, optional (default: 6)

The number of neighbors to consider when constructing the juxtaview.

max_neighs: `int`, optional (default: 18)

The maximum number of neighbors to consider when constructing the Paraview.

verbosebool, optional (default: False)

Whether to print progress.

Returns:
MistyData object with the intra view, and two fixed extra view(s): para and juxta.