spared.plotting.visualize_moran_filtering

spared.plotting.visualize_moran_filtering(param_dict: dict, processed_adata: AnnData, from_layer: str, path: str, split_names: dict, top: bool = True) None[source]

Plot the most or least auto-correlated genes

This function visualizes the spatial expression of the 4 most and least auto-correlated genes in processed_adata. The title of each subplot shows the value of the moran I statistic for a given gene. The plot is saved to the specified path. This plot uses the slide list in string format in param_dict[‘plotting_slides’] to plot these specific observations. If no list is provided (param_dict[‘plotting_slides’]==’None’), 4 random slides are chosen.

Parameters:
  • param_dict – Dictionary with dataset parameters

  • processed_adata (ad.AnnData) – Processed and filtered data ready to use by the model

  • from_layer (str) – Layer of the adata object to use for plotting

  • path (str) – Path to save the generated image

  • split_names (dict) – dictionary containing split names

  • top (bool, optional) – If True, the top 4 most auto-correlated genes are visualized. If False, the top 4 least auto-correlated genes are visualized. Defaults to True