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:
adata (
AnnData) – AnnData objectresource_name (
str(default:'consensus')) – The name of the resource to use. Seeshow_resourcesfor available resources.resource (
DataFrame(default:None)) – A resource in the form of a pandas DataFrame. If None, the resource is selected usingselect_resource.nz_threshold (
float(default:0.1)) – The threshold for the number of non-zero entries in each view.use_raw (
bool(default:False)) – Whether to use the raw data of the AnnData object.layer (
str(default:None)) – The layer of the AnnData object to use.spatial_key (
str(default:'spatial')) – The key in adata.obsm where the spatial coordinates are stored.kernel (
str(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.bandwidth (
float(default:100)) – The bandwidth of the kernel.set_diag (
bool(default:False)) – Whether to set the diagonal of the connectivity matrix to 1.cutoff (
float(default:0.1)) – The minimum value cutoff for the connectivity matrix.zoi (
float(default:0)) – Zone of indifference of the kernel, i.e. the kernel is set to 0 for distances smaller than zoi.verbose (
bool(default:False)) – Whether to print progress.
- Return type:
- Returns:
A
MistyDataobject with receptors in the intra view & ligands in the extra view.