spateo.tools.cluster._stagate ============================= .. py:module:: spateo.tools.cluster._stagate .. autoapi-nested-parse:: Module providing a encapsulation of pySTAGATE. Classes ------- .. autoapisummary:: spateo.tools.cluster._stagate.pySTAGATE Module Contents --------------- .. py:class:: pySTAGATE(adata: anndata.AnnData, num_batch_x, num_batch_y, basis='spatial', spatial_key: list = ['X', 'Y'], batch_size: int = 1, rad_cutoff: int = 200, num_epoch: int = 1000, lr: float = 0.001, weight_decay: float = 0.0001, hidden_dims: list = [512, 30], device: str = 'cuda:0') Class representing the object of pySTAGATE. .. py:attribute:: device .. py:attribute:: loader .. py:attribute:: num_epoch :value: 1000 .. py:attribute:: lr :value: 0.001 .. py:attribute:: weight_decay :value: 0.0001 .. py:attribute:: hidden_dims :value: [512, 30] .. py:attribute:: adata .. py:attribute:: data .. py:attribute:: model .. py:attribute:: optimizer .. py:method:: train() Train the STAGATE model. .. py:method:: predicted() Predict the STAGATE representation and ReX values for all cells. .. py:method:: cal_pSM(n_neighbors: int = 20, resolution: int = 1, max_cell_for_subsampling: int = 5000, psm_key='pSM_STAGATE') Calculate the pseudo-spatial map using diffusion pseudotime (DPT) algorithm. :param n_neighbors: Number of neighbors for constructing the kNN graph. :type n_neighbors: int :param resolution: Resolution for clustering. :type resolution: float :param max_cell_for_subsampling: Maximum number of cells for subsampling. If the number of cells is larger than this value, the subsampling will be performed. :type max_cell_for_subsampling: int :returns: **pSM_values** -- The pseudo-spatial map values. :rtype: numpy.ndarray