nichesphere.coloc.spatialNichePlot

nichesphere.coloc.spatialNichePlot#

nichesphere.coloc.spatialNichePlot(adata, niche_dict, CTprobs, spot_size=1, legend_fontsize=7, title='', legend_loc='right margin', save_name='test.pdf', niche_colors=None, ax=None, vmin=0, vmax=None)#

Plot niches in spatial data (MERFISH / visium slices)

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

  • niche_dict (dict) – dictionary with niche names as keys and lists of their corresponding cell types as values

  • CTprobs (pd.DataFrame) – sample specific cell type probabilities per spot

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

  • niche_colors (pd.Series) – series of colors with niche names as indexes

  • 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

Return type:

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