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:
intra (
AnnData) – AnnData object with the intraviewintra_use_raw (
bool(default:False)) – Whether to use the raw data of the intraview.intra_layer (
str(default:None)) – The layer of the intraview to use.extra (
AnnData(default:None)) – AnnData object with the extraview(s). If None, the extraview is set to be the same as the intraview.extra_use_raw (
bool(default:False)) – Whether to use the raw data of the extraview.extra_layer (
str(default:None)) – The layer of the extraview(s) to use.nz_threshold (
float(default:0.1)) – The threshold for the number of non-zero entries in each view.add_para (
bool(default:True)) – Whether to add the paraview.spatial_key (
str(default:'spatial')) – The key in adata.obsm where the spatial coordinates are stored.set_diag (
bool(default:False)) – Whether to set the diagonal of the connectivity matrix to 1.kernel (
str(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.bandwidth (
float(default:100)) – The bandwidth of the kernel.zoi (
float(default:0)) – The zone of indifference of the kernel, i.e. the kernel is set to 0 for distances smaller than zoi.cutoff (
float(default:0.1)) – The cutoff for the connectivity matrix.add_juxta (
bool(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_neighs (
int(default:6)) – The number of neighbors to consider when constructing the juxtaview.max_neighs (
int(default:18)) – The maximum number of neighbors to consider when constructing the Paraview.verbose (
bool(default:False)) – Whether to print progress.
- Return type:
- Returns:
MistyDataobject with the intra view, and two fixed extra view(s): para and juxta.