spateo.external.STAGATE_pyG.utils

Functions

Transfer_pytorch_Data(adata)

Batch_Data(adata, num_batch_x, num_batch_y[, ...])

Cal_Spatial_Net(adata[, rad_cutoff, k_cutoff, model, ...])

Construct the spatial neighbor networks.

Cal_Spatial_Net_3D(adata, rad_cutoff_2D, rad_cutoff_Zaxis)

Construct the spatial neighbor networks.

Stats_Spatial_Net(adata)

mclust_R(adata, num_cluster[, modelNames, used_obsm, ...])

Clustering using the mclust algorithm.

Module Contents

spateo.external.STAGATE_pyG.utils.Transfer_pytorch_Data(adata)[source]
spateo.external.STAGATE_pyG.utils.Batch_Data(adata, num_batch_x, num_batch_y, spatial_key=['X', 'Y'], plot_Stats=False)[source]
spateo.external.STAGATE_pyG.utils.Cal_Spatial_Net(adata, rad_cutoff=None, k_cutoff=None, model='Radius', verbose=True)[source]

Construct the spatial neighbor networks.

Parameters:
adata

AnnData object of scanpy package.

rad_cutoff

radius cutoff when model=’Radius’

k_cutoff

The number of nearest neighbors when model=’KNN’

model

The network construction model. When model==’Radius’, the spot is connected to spots whose distance is less than rad_cutoff. When model==’KNN’, the spot is connected to its first k_cutoff nearest neighbors.

Return type:

The spatial networks are saved in adata.uns[‘Spatial_Net’]

spateo.external.STAGATE_pyG.utils.Cal_Spatial_Net_3D(adata, rad_cutoff_2D, rad_cutoff_Zaxis, key_section='Section_id', section_order=None, verbose=True)[source]

Construct the spatial neighbor networks.

Parameters:
adata

AnnData object of scanpy package.

rad_cutoff_2D

radius cutoff for 2D SNN construction.

rad_cutoff_Zaxis

radius cutoff for 2D SNN construction for consturcting SNNs between adjacent sections.

key_section

The columns names of section_ID in adata.obs.

section_order

The order of sections. The SNNs between adjacent sections are constructed according to this order.

Return type:

The 3D spatial networks are saved in adata.uns[‘Spatial_Net’].

spateo.external.STAGATE_pyG.utils.Stats_Spatial_Net(adata)[source]
spateo.external.STAGATE_pyG.utils.mclust_R(adata, num_cluster, modelNames='EEE', used_obsm='STAGATE', random_seed=2020)[source]

Clustering using the mclust algorithm. The parameters are the same as those in the R package mclust.