spateo.external.STAGATE_pyG.utils ================================= .. py:module:: spateo.external.STAGATE_pyG.utils Functions --------- .. autoapisummary:: spateo.external.STAGATE_pyG.utils.Transfer_pytorch_Data spateo.external.STAGATE_pyG.utils.Batch_Data spateo.external.STAGATE_pyG.utils.Cal_Spatial_Net spateo.external.STAGATE_pyG.utils.Cal_Spatial_Net_3D spateo.external.STAGATE_pyG.utils.Stats_Spatial_Net spateo.external.STAGATE_pyG.utils.mclust_R Module Contents --------------- .. py:function:: Transfer_pytorch_Data(adata) .. py:function:: Batch_Data(adata, num_batch_x, num_batch_y, spatial_key=['X', 'Y'], plot_Stats=False) .. py:function:: Cal_Spatial_Net(adata, rad_cutoff=None, k_cutoff=None, model='Radius', verbose=True) Construct the spatial neighbor networks. :param adata: AnnData object of scanpy package. :param rad_cutoff: radius cutoff when model='Radius' :param k_cutoff: The number of nearest neighbors when model='KNN' :param 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. :rtype: The spatial networks are saved in adata.uns['Spatial_Net'] .. py:function:: Cal_Spatial_Net_3D(adata, rad_cutoff_2D, rad_cutoff_Zaxis, key_section='Section_id', section_order=None, verbose=True) Construct the spatial neighbor networks. :param adata: AnnData object of scanpy package. :param rad_cutoff_2D: radius cutoff for 2D SNN construction. :param rad_cutoff_Zaxis: radius cutoff for 2D SNN construction for consturcting SNNs between adjacent sections. :param key_section: The columns names of section_ID in adata.obs. :param section_order: The order of sections. The SNNs between adjacent sections are constructed according to this order. :rtype: The 3D spatial networks are saved in adata.uns['Spatial_Net']. .. py:function:: Stats_Spatial_Net(adata) .. py:function:: mclust_R(adata, num_cluster, modelNames='EEE', used_obsm='STAGATE', random_seed=2020) Clustering using the mclust algorithm. The parameters are the same as those in the R package mclust.