pseudodynamics.plotting_fns.param_plot.plot_gene_trends¶
- pseudodynamics.plotting_fns.param_plot.plot_gene_trends(adata, gene_list, gene_trend_key, pseudotime_key='palantir_pseudotime', n_bins=100, PINN_params=None, para_name=None, ax=None)[source]¶
Plot gene trends for a list of genes along pseudotime. If the PINN_params and para_name are provided, it will also plot the PINN parameters on a secondary y-axis.
- Parameters:
adata (AnnData object containing the data.)
gene_list (List of genes to plot.)
gene_trend_key (the varm key in adata that contains the gene trends.)
pseudotime_key (Key in adata.obs that contains pseudotime values.)
n_bins (Number of bins for pseudotime.)
PINN_params (Optional, a numpy array of PINN parameters to plot on a secondary y-axis.)
para_name (Optional, a string to label the secondary y-axis for PINN_params.)
- Returns:
fig, ax, ax2
Example
>>> TFgroup1 = ["Cebpe", "Clec4a2", "Cst7", "Elane", "Fcgr3", "Prtn3", "S100a8", "Wfdc21"]
>>> pint_v_project = tl.aggregate_params_by_pseudotime(adata_neu, adata_neu.obsm['v_norm'].T, param_names='v', pseudotime_key='palantir_pseudotime', nbins=100, return_y=True)
>>> plot_gene_trends(adata_raw, TFgroup1, PINN_params=pint_v_project[3], para_name='PINN Day27 v')