nichesphere.coloc.spatialSingleCTPlot

nichesphere.coloc.spatialSingleCTPlot#

nichesphere.coloc.spatialSingleCTPlot(adata, cell_type, CTprobs, spot_size=1, legend_fontsize=7, title='', legend_loc='right margin', save_name='test.pdf', ax=None, vmin=0, vmax=None, cmap='magma')#

Plot a single cell type proportions in spatial data (MERFISH / visium slices)

Parameters:
  • adata (AnnData) – sample specific spatial anndata object

  • CTprobs (pd.DataFrame (default: None)) – sample specific cell type probabilities per spot (not needed if there is a cell type column (maxCT_col) in the anndata obs)

  • cell_type (str) – cell type to plot

  • spot_size (int (default: 1)) – size of spots in the spatial plot

  • legend_fontsize (int (default: 7))

  • title (str)

  • legend_loc (str (default: 'right margin')) – legend location , can switch to ‘on data’

  • save_name (str (default: 'test.pdf'))

  • ax (matplotlib.axes.Axes (default: None)) – The axes object to draw the plot onto.

  • vmin (int (default: 0)) – Minimum value in the color scale

  • vmax (int (default: None)) – Maximum value in the color scale

  • cmap (str (default: 'magma')) – Name of the color map to be used

Return type:

Spatial plot where spots are colored by probability of the selected cell type