cellrefiner.pl.plot_contact_signal

cellrefiner.pl.plot_contact_signal(sem=None, adata=None, sig_mat=None, signal=None, spatial_key='spatial', cid_list=None, scaling=True, line_width=1, line_color='k', line_alpha=1, ax=None)[source]

Visualize contact signals or relationships between cells

Parameters:
  • sem (SEM) – A subcellular element method object.

  • sig_mat (csr_matrix or ndarray, 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 cells

  • scaling (bool, default=True) – Scale coordinates back to original data if True, otherwise visualize directly

  • line_width (float, default=1) – Cell-cell contacts line width

  • line_color (str or tuple, default='k') – Cell-cell contacts line color

  • line_alpha (float, default=1) – 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

Return type:

Axes

Examples

>>> fig,ax=plt.subplots(figsize=(12,12))
>>> cr.pl.plot_cell_shape(sem,ax=ax,vis_key='NOTCH',boundary_color='gray',boundary_width=0.1)
>>> cr.pl.plot_contact_signal(sem,ax=ax,signal = 'NOTCH')