celldancer.cdplt.scatter_gene¶
- celldancer.cdplt.scatter_gene(ax=None, x=None, y=None, cellDancer_df=None, colors=None, custom_xlim=None, custom_ylim=None, vmin=None, vmax=None, alpha=0.5, s=5, velocity=False, gene=None, legend='off', arrow_grid=(15, 15))¶
Plot the velocity (splice-unsplice) of a gene, or plot the parameter (‘alpha’, ‘beta’, ‘gamma’, ‘splice’, ‘unsplice’) in pseudotime, or customize the parameters in x-axis and y-axis of a gene.
- Parameters
ax (ax of plt.subplots()) – ax to add subplot.
x (str) – Set x axis as one of {‘splice’, ‘unsplice’, ‘alpha’, ‘beta’, ‘gamma’, ‘pseudotime’}.
y (str) – Set y axis as one of {‘splice’, ‘unsplice’, ‘alpha’, ‘beta’, ‘gamma’, ‘pseudotime’}.
cellDancer_df (pandas.DataFrame) – Dataframe of velocity estimation, cell velocity, and pseudotime results. Columns=[‘cellIndex’, ‘gene_name’, ‘unsplice’, ‘splice’, ‘unsplice_predict’, ‘splice_predict’, ‘alpha’, ‘beta’, ‘gamma’, ‘loss’, ‘cellID’, ‘clusters’, ‘embedding1’, ‘embedding2’, ‘velocity1’, ‘velocity2’, ‘pseudotime’]
colors (list, dict, or str) – When the input is a list: build a colormap dictionary for a list of cell type; When the input is a dictionary: the customized color map dictionary of each cell type; When the input is a str: one of {‘alpha’, ‘beta’, ‘gamma’, ‘splice’, ‘unsplice’, ‘pseudotime’} is used as value of color.
custom_xlim (optional, float (default: None)) – Set the x limit of the current axes.
custom_ylim (optional, float (default: None)) – Set the y limit of the current axes.
vmin (optional, float (default: None)) – Set the minimum color limit of the current image.
vmax (optional, float (default: None)) – Set the maximum color limit of the current image.
alpha (optional, float (default: 0.5)) – The alpha blending value, between 0 (transparent) and 1 (opaque).
s (optional, float (default: 5)) – The marker size.
velocity (optional, bool (default: False)) – True if velocity in gene level is to be plotted.
gene (optional, str (default: None)) – Gene selected to be plotted.
legend (optional, str (default: ‘off’)) – ‘off’ if the color map of cell type legend is not to be plotted; ‘only’ if only plot the cell type legend.
arrow_grid (optional, tuple (default: (15,15))) – The sparsity of the grids of velocity arrows. The larger, the more compact and more arrows will be shown.
- Returns
ax
- Return type
matplotlib.axes.Axes