mechanochat.tools.biochemical_lr_communication#
- mechanochat.tools.biochemical_lr_communication(adata: AnnData, df_ligrec: DataFrame, spatial_key: str = 'spatial', heteromeric_delimiter: str = '_', lr_delimiter: str = '-', prefix: str = 'LR')[source]#
Biochemical ligand(diffusive)-receptor cell-cell communication inference.
The signal between two cells is weighted by a Gaussian function of their distance.
- Parameters:
adata (
AnnData) – AnnData object providing spatial coordinates in .obsm[spatial_key].df_ligrec (
pandas.Dataframe) – Dataframe of ligand-receptor pairs. Required columns: Ligand, Receptor, Pathway.spatial_key (
str, default'spatial') – Key of the spatial coordinates in .obsm.lr_delimiter (
str, default'-') – Delimiter used to construct ligand-receptor pair names in output.heteromeric_delimiter (
str, default'_') – Delimiter used to separate subunits in heteromeric complexes within df_ligrec.prefix (
str, default'LR') – Prefix of the keys written to .obsp.
- Returns:
Sets the following fields in adata–.obsp[‘<key_added>_<ligand>-<receptor>’] : (nc, nc) csr_matrix of cell-cell communication mediated by <ligand>-<receptor> pair.
.uns[‘LR_signal_info’] : dict with keys ‘signal’, ‘db’ and ‘params’ (‘dc_m’, ‘gaussian_sigma’)
Notes
Orientation:
s[i, j]is the signal from senderjto receiveri(row = receiver, column = sender).