liana.plotting.annulus_plot#
- liana.plotting.annulus_plot(adata, spatial_key='spatial', annulus_width=20.0, radius_step=20.0, extend_first_annulus=True, n_rings=10, seed=1337, figure_size=(6, 6))#
Visualise concentric annuli around a randomly chosen cell on a tissue section.
Useful for inspecting the local neighbourhood structure and choosing sensible
radius_step/annulus_widthparameters before running spatial statistics (e.g. cross-PCF or LRIC).- Parameters:
adata (
AnnData) – Annotated data object.spatial_key (
str(default:'spatial')) – Key inadata.obsmthat contains the spatial coordinates. Default is'spatial'.annulus_width (
float(default:20.0)) – Radial width of each annulus ring (in coordinate units, e.g. µm). Settingannulus_width == radius_stepavoids double-counting.radius_step (
float(default:20.0)) – Step size between successive ring inner radii (in the same units as the spatial coordinates).extend_first_annulus (
bool(default:True)) – IfTrue(default), draw the innermost ring from radius 0 (spanning[0, radius_step + annulus_width)) to mirror the merged first bin used byliana.mt.lric()/liana.mt.cross_pcf().Falsestarts the first ring atradius_step.n_rings (
int(default:10)) – Number of concentric rings to draw.seed (
int(default:1337)) – Random seed for reproducibility.figure_size (
tuple(default:(6, 6))) – Figure x,y size
- Raises:
KeyError – If
spatial_keyis not found inadata.obsm.- Return type: