tacco.plots.annotation_coordinate

annotation_coordinate(adata, annotation_key, coordinate_key, group_key=None, reference_key=None, max_coordinate=None, delta_coordinate=None, axsize=None, colors=None, stacked=True, verbose=1)[source]

Plots an annotation density with respect to a scalar coordinate.

Parameters:
  • adata – A AnnData.

  • annotation_key – The .obs or .obsm key to plot.

  • coordinate_key – The .obs key or (.obsm key, column name) pair with the scalar coordinate(s).

  • group_key – A categorical group annotation. The plot is done separately per group. If None, plots for only one group are generated.

  • reference_key – The .obs key to use as weights (i.e. the weight to use for calculating the annotation density). If None, use 1 per observation, which makes sense if the annotation is categorical or fractional annotations which should sum to 1.

  • max_coordinate – The maximum coordinate to use. If None or np.inf, uses the maximum coordinate in the data.

  • delta_coordinate – The width in coordinate for coordinate discretization. If None, takes max_coordinate/100.

  • axsize – Size of a single axis in the plot

  • colors – A mapping of annotation values to colors. If None, default colors are used.

  • stacked – Whether to plot the different annotations on different scales on separate stacked plots or on the same scale in a single plot.

  • verbose – Level of verbosity, with 0 (no output), 1 (some output), …

Returns:

A Figure.