spatialtis.abc.AnalysisBase#

class spatialtis.abc.AnalysisBase(data, method=None, exp_obs=None, roi_key=None, export_key=None, cell_type_key=None, centroid_key=None, shape_key=None, marker_key=None, mp=None, display_name=None, verbose=True)[source]#

The base class for all analysis function

All parameters apply in this class can be used in analysis

Parameters
dataAnnData

The AnnData to work with.

methodstr, default: None

The method used in the run of the analysis.

export_keystr

The key used to store result.

display_namestr, default: None

The name use to display the name of analysis.

mpbool, default: Config.mp

Enable parallel processing, no effect since v0.5.0.

exp_obsstr or list of str, default: Config.exp_obs

The columns in .obs that tells how your experiments organized. This will temporarily overwrite the global config.

roi_keystr, default: Config.roi_key

The columns in .obs that specific ROI.This will temporarily overwrite the global config.

cell_type_keystr, default: Config.cell_type_key

The column in .obs to store cell types.This will temporarily overwrite the global config.

centroid_keystr or list of str, default: Config.centroid_key

The column in .obs or .obsm to store centroid. This will temporarily overwrite the global config.

shape_keystr, default: Config.shape_key

The column in .var to store cell shape in wkt format. This will temporarily overwrite the global config.

marker_keystr, default: Config.marker_key

The column in .var to store marker names.By default will read from the index of .var. This will temporarily overwrite the global config.

Methods

iter_roi([fields, filter_rois, sort, desc, ...])

A generator to iterate ROI

iter_roi(fields=None, filter_rois=None, sort=False, desc=None, disable_pbar=None, selected_markers=None, layer_key=None, dtype=None)[source]#

A generator to iterate ROI

Parameters
fieldslist of str, {‘centroid’, ‘exp’, ‘neighbors’, ‘cell_type’, ‘shape’, ‘label’, ‘index’}

What fields to retrieve when iterate ROI.

filter_roislist of str

The roi to be filtered.

sortbool

Whether to sort ROI.

descstr

The description in the progress bar.

disable_pbarbool

Whether to disable progress bar.

selected_markerslist of str

The list of markers to be selected.

layer_keystr

The layer to use for expression.

dtype

The datatype.