anndict.plot.module_score_barplot#
- anndict.plot.module_score_barplot(adata, group_cols, score_cols, figsize=(10, 8), adt_key=None)[source]#
Create a bar plot of mean module scores grouped by specified columns.
- Parameters:
- adata
AnnData
The
AnnData
object containing the data.- group_cols
str
|list
[str
] The column(s) in adata.obs to group by.
- score_cols
str
|list
[str
] The column(s) in adata.obs that contain the module scores.
- figsize
tuple
[int
,int
] (default:(10, 8)
) The figure size (width, height)
- adt_key
tuple
[str
,...
] |None
(default:None
) Used by
adata_dict_fapply()
andadata_dict_fapply_return()
when passing this function.
- adata
- Return type:
tuple
[Figure
,Axes
]- Returns:
The
Figure
andAxes
objects of the plot.
Examples
import anndict as adt # Calculate Scores adt.cell_type_marker_gene_score(adata, cell_type_col='cell_type', species='Human', list_length="longer") # Calculate a umap sc.pp.neighbors(adata) sc.tl.umap(adata) # Plot the results plots = adt.module_score_barplot(adata, group_cols='cell_type', score_cols=score_cols)
See also
cell_type_marker_gene_score()
To calculate cell type marker gene scores.