dotools_py.pl.slides

Contents

dotools_py.pl.slides#

dotools_py.pl.slides(adata, color, batch_key='batch', ncols=4, sp_size=1.5, path=None, filename='Spatial.svg', common_legend=True, order=None, figsize=(15, 8), layer=None, img_key='hires', title_fontsize=15, title_fontweight=None, select_samples=None, show=True, minimal_title=True, vmax=None, verbose=True, spacing=(0.3, 0.2), **kwargs)[source]#

Plot multiple visium slides

Plot a feature in var_names or a column from obs in multiple visium slides.

Parameters:
adata AnnData

annotated data matrix.

color str

var_names or obs column to plot.

batch_key str (default: 'batch')

obs column containing Batch/Sample Information. This column should have the same names system use to save the spatial images in adata.uns['spatial'].keys().

ncols int (default: 4)

number of subplots per row.

sp_size float (default: 1.5)

size of the dots.

path str (default: None)

path to save the plot.

filename str (default: 'Spatial.svg')

filename of the plot.

common_legend bool (default: True)

if set to true only the legend of the last column will be shown. Otherwise, the legend of all the subplots will be shown.

order list (default: None)

provide a list with the order of the slides to show. If not set the obs_col will be sorted.

figsize tuple (default: (15, 8))

size of the subplots.

layer str (default: None)

layer to use to plot dt. If not specified, .X will be used.

img_key str (default: 'hires')

image key to use for plotting (hires or lowres).

title_fontsize int (default: 15)

fontsize of the title for the subplots.

title_fontweight str (default: None)

change fontweight of the title.

select_samples list | str (default: None)

list with a subset of samplename that want to be plotted.

show bool (default: True)

if False, return axs.

minimal_title bool (default: True)

if set to true only the sample name will be shown as title, otherwise title + color

vmax float (default: None)

maximum value for continus values (e.g., expression). If common legend is set to True and vmax is not specified, it will be automatically computed taking the p99.2 expression value across all subplots.

verbose bool (default: True)

show a progress bar when plotting multiple slides.

kwargs

additional arguments for the function scanpy.pl.spatial().

spacing tuple (default: (0.3, 0.2))

spacing between subplots (height, width) padding between plots

Return type:

Axes

Returns:

a matplotlib axes object