stream2.pl.stream
- stream2.pl.stream(adata, source=0, key='epg', color=None, dict_palette=None, preference=None, dist_scale=0.9, factor_num_win=10, factor_min_win=2.0, factor_width=2.5, factor_nrow=200, factor_ncol=400, log_scale=False, factor_zoomin=100.0, fig_size=(7, 4.5), fig_legend_order=None, fig_legend_ncol=1, fig_colorbar_aspect=30, vmin=None, vmax=None, pad=1.08, w_pad=None, h_pad=None, save_fig=False, fig_path=None, fig_format='png')[source]
Generate stream plot at density level
- Parameters:
adata (AnnData) – Annotated data matrix.
root (str, optional (default: ‘S0’):) – The starting node
color (list optional (default: None)) – Column names of observations (adata.obs.columns) or variable names(adata.var_names) A list of names to be plotted.
preference (list, optional (default: None):) – The preference of nodes. The branch with speficied nodes are preferred and will be put on the upper part of stream plot. The higher ranks the node have, the closer to the top the branch containing the node is.
dist_scale (float,optional (default: 0.9)) – Scaling factor. It controls the width of STREAM plot branches. The smaller, the thinner the branch will be.
factor_num_win (int, optional (default: 10)) – Number of sliding windows used for making stream plot. It controls the smoothness of STREAM plot.
factor_min_win (float, optional (default: 2.0)) – The minimum number of sliding windows. It controls the resolution of STREAM plot. The window size is calculated based on shortest branch. (suggested range: 1.5~3.0)
factor_width (float, optional (default: 2.5)) – The ratio between length and width of stream plot.
factor_nrow (int, optional (default: 200)) – The number of rows in the array used to plot continuous values.
factor_ncol (int, optional (default: 400)) – The number of columns in the array used to plot continuous values
log_scale (bool, optional (default: False)) – If True,the number of cells (the width) is logarithmized when drawing stream plot.
factor_zoomin (float, optional (default: 100.0)) – If log_scale is True, the factor used to zoom in the thin branches
fig_size (tuple, optional (default: (7,4.5))) – figure size.
fig_legend_order (dict,optional (default: None)) – Specified order for the appearance of the annotation keys. Only valid for ategorical variable. e.g. fig_legend_order = {‘ann1’:[‘a’,’b’,’c’],’ann2’:[‘aa’,’bb’,’cc’]}
fig_legend_ncol (int, optional (default: 1)) – The number of columns that the legend has.
vmin (float, optional (default: None)) – The min and max values are used to normalize continuous values. If None, the respective min and max of continuous values is used.
vmax (float, optional (default: None)) – The min and max values are used to normalize continuous values. If None, the respective min and max of continuous values is used.
pad (float, optional (default: 1.08)) – Padding between the figure edge and the edges of subplots, as a fraction of the font size.
h_pad (float, optional (default: None)) – Padding (height/width) between edges of adjacent subplots, as a fraction of the font size. Defaults to pad.
w_pad (float, optional (default: None)) – Padding (height/width) between edges of adjacent subplots, as a fraction of the font size. Defaults to pad.
save_fig (bool, optional (default: False)) – if True,save the figure.
fig_path (str, optional (default: None)) – if save_fig is True, specify figure path. if None, adata.uns[‘workdir’] will be used.
fig_format (str, optional (default: ‘pdf’)) – if save_fig is True, specify figure format.
- Return type:
None