Plotting functions
- vega.plotting.volcano(adata, group1, group2, sig_lvl=3.0, metric_lvl=3.0, annotate_gmv=None, s=10, fontsize=10, textsize=8, figsize=None, title=False, save=False)[source]
Plot Differential GMV results. Please run the Bayesian differential acitvity method of VEGA before plotting (“model.differential_activity()”)
- Parameters
adata (
AnnData
) – scanpy single-cell objectgroup1 (
str
) – name of reference groupgroup2 (
str
) – name of out-groupsig_lvl (
float
) – absolute Bayes Factor cutoff (>=0)metric_lvl (
float
) – mean Absolute Difference cutoff (>=0)annotate_gmv (
Union
[str
,list
,None
]) – GMV to be displayed. If None, all GMVs passing significance thresholds are displayeds (
int
) – dot sizefontsize (
int
) – text size for axistextsize (
int
) – text size for GMV name displaytitle (
str
) – title for plotsave (
Union
[str
,bool
]) – path to save figure as pdf
- vega.plotting.gmv_embedding(adata, x, y, color=None, palette=None, title=None, save=False, sct_kwds=None)[source]
2-D scatter plot in GMV space.
- Parameters
adata (
AnnData
) – scanpy single-cell object. VEGA analysis needs to be run beforex (
str
) – GMV name for x-coordinates (eg. ‘REACTOME_INTERFERON_SIGNALING’)y (
str
) – GMV name for y-coordinates (eg. ‘REACTOME_INTERFERON_SIGNALING’)color (
Optional
[str
]) – categorical field of Anndata.obs to color single-cellstitle (
Optional
[str
]) – plot titlesave (
Union
[str
,bool
]) – path to save plotsct_kwds (
Optional
[dict
]) – kwargs for matplotlib.pyplot.scatter function
- vega.plotting.gmv_plot(adata, x, y, color=None, title=None, palette=None)[source]
GMV embedding plot, but using the Scanpy plotting API.
- Parameters
adata (
AnnData
) – scanpy single-cell datasetx (
str
) – GMV name for x-coordinates (eg. ‘REACTOME_INTERFERON_SIGNALING’)y (
str
) – GMV name for x-coordinates (eg. ‘REACTOME_INTERFERON_SIGNALING’)color (
Optional
[str
]) – .obs field to color bytitle (
Optional
[str
]) – title for the plotpalette (
Optional
[str
]) – matplotlib colormap to be used
- vega.plotting.loss(model, plot_validation=True)[source]
Plot training loss and validation if plot_validation is True.
- Parameters
model (
VEGA
) – VEGA model (trained)plot_validation (
bool
) – Whether to plot validation loss as well
- vega.plotting.rank_gene_weights(model, gmv_list, n_genes=10, color_in_set=True, n_panels_per_row=3, fontsize=8, star_names=[], save=False)[source]
Plot gene members of input GMVs according to their magnitude (abs(w)). Inspired by scanpy.pl.rank_gene_groups() API.
- Parameters
model (
VEGA
) – VEGA trained modelgmv_list (
Union
[str
,list
]) – list of GMV namesn_genes (
int
) – number of top gene to displaycolor_in_set (
bool
) – Whether to color genes annotated as part of GMVs differently.n_panels_per_row (
int
) – number of panels max. per rowstar_names (
list
) – Name of genes to be highlighted with starssave (
Union
[bool
,str
]) – path to save figure
- vega.plotting.weight_heatmap(model, cluster=True, cmap='viridis', display_gmvs='all', display_genes='all', title=None, figsize=None, save=False, hm_kwargs=None)[source]
Heatmap plots of weights.
- Parameters
model (
VEGA
) – VEGA trained modelcluster (
bool
) – if True, use hierarchical clustering (seaborn.clustermap)cmap (
str
) – colormap to usedisplay_gmvs (
Union
[str
,list
]) – if all, display all latent variables weights. Else (list) only the subsetdisplay_genes (
Union
[str
,list
]) – if all, display all gene weights of GMV. Else (list) only the subsettitle (
Optional
[str
]) – figure titlefigsize (
Union
[tuple
,list
,None
]) – figure sizesave (
Union
[bool
,str
]) – path to save figurehm_kwargs (
Optional
[dict
]) – kwargs for sns.clustermap or sns.heatmap (depending on ifcluster=True
)