simba.pl.query

simba.pl.query(adata, comp1=0, comp2=1, obsm='X_umap', layer=None, color=None, dict_palette=None, size=8, drawing_order='random', dict_drawing_order=None, show_texts=False, texts=None, text_expand=(1.05, 1.2), text_size=10, n_texts=8, fig_size=None, fig_ncol=3, fig_legend_ncol=1, fig_legend_order=None, alpha=0.9, alpha_bg=0.3, pad=1.08, w_pad=None, h_pad=None, save_fig=None, fig_path=None, fig_name='plot_query.pdf', vmin=None, vmax=None, **kwargs)[source]

Plot query output

Parameters:
  • adata (Anndata) – Annotated data matrix.

  • comp1 (int, optional (default: 0)) – Component used for x axis.

  • comp2 (int, optional (default: 1)) – Component used for y axis.

  • obsm (str, optional (default: ‘X_umap’)) – The field to use for plotting

  • layer (str, optional (default: None)) – The layer to use for plotting

  • color (list, optional (default: None)) – A list of variables that will produce points with different colors. e.g. color = [‘anno1’, ‘anno2’]

  • dict_palette (dict,optional (default: None)) – A dictionary of palettes for different variables in color. Only valid for categorical/string variables e.g. dict_palette = {‘ann1’: {},’ann2’: {}}

  • size (int (default: 8)) – Point size.

  • drawing_order (str (default: ‘random’)) –

    The order in which values are plotted, This can be one of the following values

    • ’original’: plot points in the same order as in input dataframe

    • ’sorted’ : plot points with higher values on top.

    • ’random’ : plot points in a random order

  • dict_drawing_order (dict,optional (default: None)) – A dictionary of drawing_order for different variables in color. Only valid for categorical/string variables e.g. dict_drawing_order = {‘ann1’: ‘original’,’ann2’: ‘sorted’}

  • show_texts (bool, optional (default: False)) – If True, text annotation will be shown.

  • text_size (int, optional (default: 10)) – The text size.

  • texts (list optional (default: None)) – Point names to plot.

  • text_expand (tuple, optional (default: (1.05, 1.2))) – Two multipliers (x, y) by which to expand the bounding box of texts when repelling them from each other/points/other objects.

  • n_texts (int, optional (default: 8)) – The number of texts to plot.

  • fig_size (tuple, optional (default: (4, 4))) – figure size.

  • fig_ncol (int, optional (default: 3)) – the number of columns of the figure panel

  • fig_legend_order (dict,optional (default: None)) – Specified order for the appearance of the annotation keys. Only valid for categorical/string 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.

  • alpha (float, optional (default: 0.9)) – The alpha blending value, between 0 (transparent) and 1 (opaque) for returned points.

  • alpha_bg (float, optional (default: 0.3)) – The alpha blending value, between 0 (transparent) and 1 (opaque) for background points

  • 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.

  • fig_name (str, optional (default: ‘plot_query.pdf’)) – if save_fig is True, specify figure name.

Return type:

None