COSIE.downstream_analysis.plot_marker_comparison_superpixel

plot_marker_comparison_superpixel(molecule_name, adata1, adata2, section1_label='Section 1', section2_label='Section 2', basis='spatial', colormap='turbo', plot_style='original', swap_xy=False, invert_x=False, invert_y=False, offset=False, figscale=35, dpi=300, remove_title=False, remove_spine=False, remove_legend=False, save_path=None)[source]

Plot side-by-side spatial expression comparison of a target molecule at the superpixel level.

Parameters

molecule_namestr

Name of the molecule to visualize.

adata1AnnData

First AnnData object with molecule expression and spatial coordinates.

adata2AnnData

Second AnnData object with molecule expression and spatial coordinates.

section1_labelstr, default ‘Section 1’

Title label for the first section.

section2_labelstr, default ‘Section 2’

Title label for the second section.

basisstr, default ‘spatial’

The key in obsm specifying spatial coordinates.

colormapstr, default “turbo”

Name of matplotlib colormap to use for intensity.

plot_stylestr, default “original”

If “equal”, enforce equal aspect ratio for square spatial representation.

swap_xybool, default False

Whether to swap x and y axes.

invert_xbool, default False

Whether to flip the image horizontally.

invert_ybool, default False

Whether to flip the image vertically.

offsetbool, default False

Whether to shift coordinates to align to (0, 0) origin.

figscaleint, default 35

Scaling factor for figure size.

dpiint, default 300

Dots-per-inch for saved figure resolution.

remove_titlebool, default False

Whether to remove plot titles.

remove_spinebool, default False

Whether to remove axes spines.

remove_legendbool, default False

Whether to remove colorbar.

save_pathstr or None, default None

If provided, save the figure to this path.

Returns

None