OmicVerse plotting: volcano, venn, boxplot, embedding, density, heatmap families, dotplot, convex hull, stacked bar, and Forbidden City color palettes.
Leverage this skill when a user wants help recreating or adapting plots from the OmicVerse plotting tutorials:
It covers how to configure OmicVerse's plotting style, choose colors from the Forbidden City palette, and generate bulk as well as single-cell specific figures.
omicverse as ov, matplotlib.pyplot as plt, and other libraries required by the user's request (pandas, seaborn, scanpy, etc.).ov.ov_plot_set() (or ov.plot_set() depending on the installed version) to apply OmicVerse's default styling before generating figures.ov.read(...)/ov.pp.preprocess(...) or instruct users to supply their own AnnData/CSV files.t_visualize_bulk)
ov.pl.venn(sets=..., palette=...) to display overlaps among DEG lists (no more than 4 groups). Encourage setting sets as a dictionary of set names → gene lists.result = ov.read('...csv')) and call ov.pl.volcano(result, pval_name='qvalue', fc_name='log2FoldChange', ...). Explain optional keyword arguments such as sig_pvalue, sig_fc, palette, and label formatting.seaborn.load_dataset('tips')) and invoke ov.pl.boxplot(data, x_value=..., y_value=..., hue=..., ax=ax, palette=...). Mention how to adjust figure size, legend placement, and significance annotations.t_visualize_colorsystem)
fb = ov.pl.ForbiddenCity() and demonstrate fb.get_color(name='凝夜紫') for specific hues.ov.pl.green_color, ov.pl.red_color, etc.) and build dicts mapping cell types/groups to color hex codes.ov.pl.get_cmap_seg(colors, name='custom'), then pass the colormap into Matplotlib/Scanpy plotting functions.ov.pl.embedding(adata, basis='X_umap', color='clusters', palette=color_dict, ax=ax).t_visualize_single)
adata = ov.pp.preprocess(adata, mode='shiftlog|pearson', n_HVGs=2000)).# Before plotting by clustering or other categorical variable
color_col = 'leiden' # or 'clusters', 'celltype', etc.
if color_col not in adata.obs.columns:
raise ValueError(f"Column '{color_col}' not found in adata.obs. Available columns: {list(adata.obs.columns)}")
# Before plotting embeddings
basis = 'X_umap' # or 'X_pca', 'X_tsne', etc.
if basis not in adata.obsm.keys():
raise ValueError(f"Embedding '{basis}' not found in adata.obsm. Available embeddings: {list(adata.obsm.keys())}")
ov.pl.optim_palette(adata, basis='X_umap', colors='clusters') to auto-generate color schemes when categories clash.ov.pl.cellproportion(adata, groupby='clusters', celltype_clusters='celltype', ax=ax) and transform into stacked area charts by setting kind='area'.ov.pl.embedding_celltype to place counts/proportions alongside UMAPs.ov.pl.ConvexHull or ov.pl.contour for highlighting regions of interest.ov.pl.embedding_adjust to reposition legends automatically.ov.pl.embedding_density for density overlays, controlling smoothness with adjust.ov.pl.calculate_gene_density(adata, genes=[...], basis='spatial'), then overlay with ov.pl.embedding(..., layer='gene_density', cmap='...').ov.pl.group_heatmap for grouped expression summaries.ov.pl.feature_heatmap for cell-level ordered heatmaps.ov.pl.dynamic_heatmap for pseudotime/lineage heatmaps.ov.pl.cell_cor_heatmap for group similarity heatmaps.ov.pl.complexheatmap and ov.pl.marker_heatmap as compatibility entry points for older workflows rather than the default extension surface.border=False unless a user explicitly asks for framed panels; this matches current OmicVerse heatmap styling more closely.ov.pl.single_group_boxplot, ov.pl.bardotplot, ov.pl.dotplot, and legacy ov.pl.marker_heatmap, emphasizing input formats (long-form DataFrame vs. AnnData with .obs annotations) and optional helpers such as ov.pl.add_palue for manual p-value annotations.fig.tight_layout() to prevent clipping.fig.savefig('plot.png', dpi=300, bbox_inches='tight') and documenting color mappings for reproducibility.adata.obs columns and adata.obsm embeddings exist before plottingfb.get_color selections, and render an embedding with adjusted legend placement."t_visualize_bulk.ipynbt_visualize_colorsystem.ipynbt_visualize_single.ipynbreference.md