spared.plotting.visualize_gene_expression

spared.plotting.visualize_gene_expression(param_dict: dict, processed_adata: AnnData, from_layer: str, path: str, split_names: dict) None[source]

Plot specific gene expression

This function selects the genes specified in param_dict[‘plotting_genes’] and param_dict[‘plotting_slides’] to plot gene expression for the specified genes in the specified slides. If either of them is ‘None’, then the method chooses randomly (4 genes or 4 slides in the stnet_dataset or 2 slides in visium datasets). The data is plotted from the .layers[from_layer] expression matrix

Parameters:
  • param_dict – Dictionary of dataset parameters

  • processed_adata (ad.AnnData) – The processed adata with the filtered patient collection

  • from_layer (str) – The key to the layer of the data to plot

  • path (str) – Path to save the image

  • split_names (dict) – dictionary containing split names