mechanochat.plotting.vis_contact_signal#
- mechanochat.plotting.vis_contact_signal(sem: SEM2 | None = None, adata: AnnData | None = None, spatial_key: str | None = 'spatial', sig_mat: csr_matrix | ndarray[Any, dtype[_ScalarType_co]] | None = None, signal: str | None = None, cid_list: ndarray[Any, dtype[int64]] | ndarray[Any, dtype[bool_]] | Sequence[int] | None = None, scaling: bool = True, line_width: float | Iterable[float] = 1, line_color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] = 'k', line_alpha: float | Iterable[float] = 1, ax: Axes | None = None) Axes[source]#
Visualize contact signals or relationships between cells
- Parameters:
sem (
SEM) – A subcellular element method object.adata (
AnnData, optional) – Used when sem is None. Coordinates are read from adata.obsm[spatial_key] and the signal matrix from adata.obsp[signal]spatial_key (
str, default'spatial') – Key in adata.obsm for spatial coordinates. Only used when sem is Nonesig_mat (
csr_matrixorndarray, optional) –Signal matrix to visualize. If signal is provided, this parameter will be ignored, and the signal matrix will be retrieved from sem.adata.obsp[signal].
If sig_mat and signal both are None, the contact matrix sem.contact_matrix will be visualized.
signal (
str, optional) – Key for signal matrix in sem.adata.obsp. If given, sig_mat will be ignored.cid_list (
ndarray, optional) – Array of index for cells to be visualized. Default: all cellsscaling (
bool, defaultTrue) – Scale coordinates back to original data if True, otherwise visualize directlyline_width (
float, default1) – Cell-cell contacts line widthline_color (
color, default'k') – Cell-cell contacts line colorline_alpha (
float, default1) – Cell-cell contacts line opacity, 0 (fully transparent), 1 (fully opaque)ax (
Axes, optional) – Target matplotlib axes object. Creates new figure if None
- Returns:
ax (
Axes)