nichesphere.coloc.spatialCTPlot

Contents

nichesphere.coloc.spatialCTPlot#

nichesphere.coloc.spatialCTPlot(adata, cell_types, CTprobs=None, maxCT_col=None, spot_size=1, legend_fontsize=7, title='', legend_loc='right margin', save_name='test.pdf', ax=None)#

Plot cell types in spatial data (MERFISH / visium slices)

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

  • cell_types (pd.Series) – categorical series of cell types

  • 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)

  • maxCT_col (string (default: None)) – cell type column in anndata object

  • 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.

Return type:

Spatial plot where spots are colored by cell type with highest proportion