 Research
 Open access
 Published:
HyperGCN: an effective deep representation learning framework for the integrative analysis of spatial transcriptomics data
BMC Genomics volume 25, Article number: 566 (2024)
Abstract
Background
Advances of spatial transcriptomics technologies enabled simultaneously profiling gene expression and spatial locations of cells from the same tissue. Computational tools and approaches for integration of transcriptomics data and spatial context information are urgently needed to comprehensively explore the underlying structure patterns. In this manuscript, we propose HyperGCN for the integrative analysis of gene expression and spatial information profiled from the same tissue. HyperGCN enables data visualization and clustering, and facilitates downstream analysis, including domain segmentation, the characterization of marker genes for the specific domain structure and GO enrichment analysis.
Results
Extensive experiments are implemented on four real datasets from different tissues (including human dorsolateral prefrontal cortex, human positive breast tumors, mouse brain, mouse olfactory bulb tissue and Zabrafish melanoma) and technologies (including 10X visium, osmFISH, seqFISH+, 10X Xenium and Stereoseq) with different spatial resolutions. The results show that HyperGCN achieves superior clustering performance and produces good domain segmentation effects while identifies biologically meaningful spatial expression patterns. This study provides a flexible framework to analyze spatial transcriptomics data with high geometric complexity.
Conclusions
HyperGCN is an unsupervised method based on hypergraph induced graph convolutional network, where it assumes that there existed disjoint tissues with high geometric complexity, and models the semantic relationship of cells through hypergraph, which better tackles the highorder interactions of cells and levels of noise in spatial transcriptomics data.
Background
The development of spatial transcriptomics technologies enables genomewide profiling of transcriptional expressions in captured relative locations at a resolution of several cells or even individual cell level, such as 10X Visium [1], 10X Xenium, Slideseq [2, 3], Stereoseq [4], osmFISH [5], PIXELseq [6], SeqFISH+ [7], and SeqScope [8]. Compared with nonspatial singlecell RNAsequencing technologies, spatial transcriptomics can capture cellular heterogeneity coupled with its spatial coordinates in the same tissue, which provide the rich biological insights of cell functions and their crosstalk [9, 10]. Integrating gene expression and spatial coordinate information to learn a good representation for spatial transcriptomic data analysis is crucial. Computational tools and approaches are urgently needed to dissect spatial organization domains and functions of individual cells.
Increasing evidences have shown that some cell types, such as neurons and endothelia cells have high heterogeneities and specific spatial expression patterns [5, 11, 12]. Even for cells with the same type, such as ependymal cells, high spatial selfaffinity was also observed. In addition, spatial selfevasion was measured in microglia and astrocytes inhibitory neurons [5]. Therefore, spatial neighbors of each cell may provide valuable information for understanding cell heterogeneity and annotating tissue domains. However, some singlecell integration methods which are initially designed for nonspatial singlecell multiomics data [13,14,15,16] cannot employ spatial information to enhance their analytical ability. This situation poses significant challenges in spatial data analysis.
Recently, several new computational approaches have been developed for spatial transcriptomics data analysis [9, 17,18,19,20,21,22,23,24]. SpaGCN integrates gene expression, spatial coordinates, and histological information into an undirected weighted graph, and then employs graph convolution to cluster theses spots into different spatial domains [18]. stLearn utilizes a deep neural network (CNN) on the morphological data to extract lowdimensional morphological features, on which the morphological similarities between neighboring spots are computed [19]. Then, the normalization of gene expression matrix is established based on the morphological similarities and spatial neighbors of each spot, followed by dimensionality reduction with PCA and UMAP [25]. BayesSpace assumes that the spots containing the same cell type should be closer to each other in space, and trains the models with Bayesian statistical approach [21]. SpaceFlow uses the deep graph infomax (DGI) framework where contrastive learning strategy is used to train the graph encoder. Simultaneously, a spatial regularization term is added into the objective function of DGI to preserve the spatial consistency of the lowdimensional spot embeddings [20]. SEDR uses a deep autoencoder network and a variational graph autoencoder network to learn the lowdimension representation of transcriptomic profile matrix, where spatial information is used to construct neighborhood graph [9]. Notably, these approaches that employ GCNs (including SpaGCN, SEDR and SpaceFlow) mainly rely on similarity graph calculated based on the knearest neighbors (kNN) of each spot, and ignore highorder structure information in disjoint tissues with high geometric complexity, which limits their application to unknown and complicated data. Compared with SpaGCN and SpaceFlow, one drawback of stLearn is that linear PCA is used to conduct dimension reduction for the normalized gene expression matrix, and it cannot model complex nonlinear relationships among cells. The disadvantage of BayesSpace is the interpretability: it does not generate jointly embeddings of gene expression and spatial coordinates, hindering its application into some downstream analysis tasks.
In this work, we proposed HyperGCN for the integrative analysis of spatial transcriptomics data, where both gene expression and spatial locations of spots are simultaneous measured. HyperGCN is a versatile tool that enables accurate clustering of spots/cells and data visualization, and it facilitates the downstream analysis, including the identification of layer structures, the characterization of domainspecific marker genes, and biological processes and functional pathways enrichment analysis. HyperGCN is a novel computational framework, referring to Hypergraph induced Graph Convolutional Network. Unlike SpaGCN and SEDR which utilize nearest neighbor information to encode spatial proximity between spots, HyperGCN assumes that there existed disjoint tissues with high geometric complexity, and models the semantic relationship of cells through hypergraph convolution and spatial regularization, which better tackles the highorder interaction of cells and levels of noise in spatial transcriptomics data. HyperGCN not only integrates the complementary information from transcriptomic data and spatial coordinates, but also preserves the geometric structures in original high dimensional space. We applied HyperGCN to four real spatial transcriptomics datasets from different tissues tissues (including human dorsolateral prefrontal cortex, human positive breast tumors, mouse brain, mouse olfactory bulb tissue and Zabrafish melanoma) and technologies (including 10X visium, osmFISH, seqFISH+, 10X Xenium and Stereoseq), the results show that HyperGCN is effective in spatial transcriptomics data analysis: HyperGCN achieves superior performance in clustering and domain segmentation, and it captures and enhances domain structures that were not easily identified by other methods. The clustering assignments obtained from HyperGCN have latent biological application and meaning: the top domainspecific genes for each layer show spatial specific expression patterns with high expression level in this domain and low expression outside this domain. Moreover, it also provided rich information on the biological interpretation of the markers. Gene Ontology (GO) enrichment analysis indicates that enriched biological processes (BPs) are directly related to the biological functions of the underlying structured domains. An overview of HyperGCN is shown in Fig. 1af.
Materials and methods
Datasets and data preprocessing
Four real spatial transcriptomics data were analyzed in this study and can be downloaded from their original publications. Specifically, (1) The LIBD human dorsolateral prefrontal cortex (DLPFC) data was sequenced by the 10x Genomics Visium technique [26]. It contains 12 spatially resolved RNAseq data sets, and it was downloaded from the website (http://research.libd.org/spatialLIBD/); (2) The osmFISH dataset of the somatosensory cortex sequenced with osmFISH technique [5] was downloaded from the website (http://linnarssonlab.org/osmFISH/); (3) The 10X Visium mouse brain sagittal data was downloaded from 10X genomics website (https://www.10xgenomics.com/spatialgeneexpression/datasets). (4) The Stereoseq data from mouse olfactory bulb tissue was downloaded from SEDR website (https://github.com/JinmiaoChenLab/SEDR_analyses).
The raw gene expression data were preprocessed with the SCANPY package [27]. Firstly, the genes that expressed in less than 5 spots/cells are filtered out. Secondly, the counts are normalized such that the total counts of all genes in each spot/cell equal to 1. To alleviate the effect of extreme values, the entries in the matrix were logtransformed with a pseudocount of 1, and scaled to have unit variances and zero means. Finally, we used PCA with 200 principal components to implement dimension reduction on the normalized expression data. For osmFISH data with only 33 genes, we do not conduct PCA as the low dimension of features.
The detailed statistics of these datasets is presented in Additional file 1: Supplementary Table S1.
Hypergraph construction for spatial transcriptomics data
The previous studies assumed that there existed pairwise relationships among the spots/cells [9]. A simple graph is generally used to describe the pairwise relationships. In this graph, two spots/cells are connected by an edge if they are adjacent in space. However, in many real problems, it may cause information loss to represent a group of complex objects only by using simple graph [28]. For example, to group members within one club into different communities, we first construct a simple graph where two members are connected if they share the same coach. Then, clustering methods based on spectral graph are applied [29, 30]. However, this approach mentioned above may lose some useful information in the scenario where the same coach jointly teaches more than two members. Such unexpected information loss may result in the performance degradation of downstream clustering algorithms. Because these members taught by the same coach likely belong to the same community.
A natural way to deal with the information loss issue mentioned above is to represent the highorder relationships by using hypergraph (Fig. 2ab).
Let \(V\) denotes the set of spots/cells and \(E\) be a family of subset of \(V\). For any hyperedge \(e\), \({\bigcup }_{e\in E}=V\). The weight corresponding to each hyperedge \(e\) are denotes as \(w\left(e\right)\). A weighted hypergraph is represented as \(G=\left(V,E,W\right)\). The incidence matrix \(P\in {R}^{\leftV\right\times \leftE\right}\) corresponding to \(G\) is defined as the following.
\(\leftV\right\) indicates the number of vertices. \(\leftE\right\) is the number of hyperedges. Given spot \(v\in V\) and hyperedge \(e\in E\), their degrees are defined as \(d\left(v\right)={\sum }_{e\in E}w\left(e\right)p\left(v,e\right)\) and \(\delta \left(e\right)=\lefte\right\), respectively. Let \({D}_{v}\) and \({D}_{e}\) denote degree matrices for spots and hyperedges, \({W}_{e}\) denote the weight matrix of hyperedges. Then, the normalized hypergraph Laplacian matrix can be formulated as:
The normalized adjacency matrix of hypergraph can be formulated as the follows, and is used to the inputs of HyperGCN together with spatial transcriptomics data.
where, \({P}^{T}\) denotes the transposition of incidence matrix \(P\). In contrast to the previous study [31], we add selfsimilarity to each node to maintain the numerical stability.
Note that we first use the spatial coordinates of spots to construct the kNN graph, and then a hypergraph is constructed based on the kNN graph with the above methodology. In the whole experiments, we set \(k=20\) for all the datasets and \({W}_{e}\) as identity matrix.
The sensitivity analysis of the hyperparameter \(k\) are presented in Additional file 1.
Deep autoencoder for lowdimensional representation learning
The lowdimensional representation of spots/cells is learned by using a deep autoencoder. In the encoder part, two fully connected linear layers with Elu activation function are stacked together, and produces a lowdimensional spot/cell embedding matrix \({H}_{f}\in {\mathbb{R}}^{N\times {D}_{f}}\) from the preprocessed transcript profile matrix \(X\in {\mathbb{R}}^{N\times M}\). In the decoder part, one fully connected linear layer is used to reconstruct the transcript matrix\({X}^{{\prime }}\in {\mathbb{R}}^{N\times M}\) from the latent spot/cell representation matrix\(H\in {\mathbb{R}}^{N\times D}\) which is generated by concatenating the lowdimensional spot/cell embedding \({H}_{f}\) and spatial embedding \({H}_{g}\in {\mathbb{R}}^{N\times {D}_{g}}\) (obtained from hypergraph convolutional network). Here, \(N\) is the number of spots/cells, \(M\) is the number of features, and \({D}_{f}\), \({D}_{g}\) are dimensions of features for autoencoder and spatial embedding, respectively.\(D={D}_{f}+{D}_{g}\) is the final feature dimension learned from HyperGCN.\(H\in {\mathbb{R}}^{N\times D}\) is applied into various downstream analysis tasks.
The deep autoencoder aims to minimize the loss between the input transcript profile matrix \(X\) and the reconstructed matrix \({X}^{{\prime }}\). The objection function is defined as the following.
where \(MSE\left(*\right)\) denotes the mean squared error loss function.
Hypergraph convolution for highorder spatial embedding of spots/cells
In contrast to simple graph, hypergraph encodes the highorder spatial relationships among spots/cells, and is able to identify the latent spatial domain. In terms of the good performance of graph convolutional network [18, 32], we use hypergraph convolution to embed the spatial information of neighboring spots/cells.
Given the normalized adjacency matrix of hypergraph \({A}_{hp}\) and corresponding weight matrix \({W}_{i}\), the twolayer hypergraph convolutional networks is defined as the following.
where\({H}_{f}\) is a lowdimensional representation of spots/cells obtained from the deep autoencoder. To enhance the representation ability of \({H}_{g}\), we introduce the variational graph autoencoder(VGAE) [33] framework. The VGAE utilizes latent variables and learns an interpretable and meaningful embedding with the following function: \(g:\left({A}_{hp}, {H}_{f}\right)\to {H}_{g}\). The inference model of VGAE parameterized by (5) is defined as:
Here, \(\mu ={HGCN}_{\mu }({A}_{hp},{H}_{f})\) is the matrix of mean vectors \({h}_{i}\), and \(log\sigma ={HGCN}_{\sigma }({A}_{hp},{H}_{f})\).
In the proposed HyperGCN model, we only train the autoencoder with reconstruction loss of the input gene expression matrix \(X\), and do not consider the VGAE loss.
Hypergraph induced deep autoencoder clustering framework
HyperGCN implements an unsupervised deep embedded clustering on the lowdimensional embedding \(H\) of the autoencoder [34]. To enhance the initialization step of clustering, kmeans is employed to generate the centroids. The number of centroids in HyperGCN is set as 10 for all datasets.
i. Deep embedding clustering.
Deep embedding clustering (DEC) employs the Kullback–Leibler (KL) divergence to measure the clustering consistence between the soft assignment \(Q\) and the auxiliary target distribution \(T\). The objective function is defined as the following.
where the soft assignment \({q}_{ik}\) indicates the distance between spot/cell \({h}_{i}\) and cluster center \({\mu }_{k}\), and is calculated by Student’s tdistribution [35]:
The auxiliary target distribution \(T\) refines the clusters by emphasizing the higher confidence assignments. Formally, \({t}_{ik}\) is defined as the following.
HyperGCN iteratively refines the clusters with the clustering loss (8) and improves the initial estimate of centroids from kmeans. Thus, a high confident spot/cell assignments are learned.
ii. Enhancing spatial consistency with spatially regularization.
The closeness in the embedding space not only reflects the transcript similarity between spots/cells, but also their spatial proximity [20]. To enhance the spatial consistency among spots/cell, a spatial regularization term is defined as follows.
where\({D}_{ij}^{\left(s\right)}\) is the Euclidean spatial distance between spot/cell \(i\) and \(j\),\({D}_{ij}^{\left(h\right)}\) denotes the embedding distance between \(i\) and \(j\). Obviously, the spots or cells that are spatially distant, are also pushed further from each other in the generated embedding space by imposing the spatial regularization term (11). Strong spatial regularization makes the embeddings more smooth, which may not accord with more complicated biological heterogeneity. To address the problem mentioned above, regularization parameter \(\gamma\) is introduced into Eq. 11 to control the strength of spatial regularization. Oversmoothing or undersmoothing issues may have an significant influence on the performance of domain segmentation and clustering, so tuning of the parameter \(\gamma\) is rigamarole. In the whole experiments, we experientially set \(\gamma =1\) to simplify analysis.
Combining the reconstruction loss, clustering loss and spatial regularization, the final object of HyperGCN is defined as follows.
where \(\lambda\), \(\gamma\) are parameters for the clustering loss and spatial regularization term, respectively. In the whole experiments, we set \(\lambda =0.1\), \(\gamma =1\) across all datasets.
Training procedure
We use the Adam optimizer with a default learning rate \(lr=0.01\) to train HyperGCN. The number of epochs is set as 200. The kNN graph is obtained via “kneighbors_graph” function from scikitlearn package. We use Elu activation function in the autoencoder, in view of its advantages compared other activation functions (Additional file 1). We pretrain the autoencoders without DEC loss for 200 epochs. In the beginning of the DEC stage, we utilize kmeans to enhance the initialization step of cluster centroids. The number of centroids in kmeans is empirically set as 10 for all datasets. For hypergraph convolution layers, the dimensions of hidden layers are set to be 32 and 8, respectively. For autoencoder layers, the dimensions of hidden layers are set to be 100 and 20, respectively. During the clustering stage, the clustering loss, reconstruction loss are optimized together with spatial regularization loss. A GeForce RTX 3060 Laptop GPU with 6G memory is used for training the HyperGCN model.
Competing methods
We compare HyperGCN with several recently published methods on spatial transcriptomics data, including SpaGCN [18], BayesSpace [21], SEDR [9] and SpaceFlow [20]. In the experiments, the numbers of clusters are set as the numbers of annotated layers for DLFPC data and osmFISH data. For 10X Visium data and Stereoseq data, we set the numbers of cluster equal to 12 and 7, respectively.
When benchmarking with SpaGCN, the recommended parameter setting described in their online publishment, such as \(s=1\), \(b=49\) and\(p=0.5\) are used across all datasets.
For BayesSpace benchmarking, the getTopHVGs method is used to select the highly variable genes (HVGs, top 2000 exclude osmFISH data), the spatialPreprocess method is used to lognormalize the count matrix and runPCA method is used for dimension reduction. Then, the spatialCluster function is used to cluster spots/cells with 5000 MCMC iterations, and defaulted gamma for different sequencing platforms.
For SEDR benchmarking, we used the default parameters described in their online tutorial (https://github.com/JinmiaoChenLab/SEDR/), including \(epochs=200\), \(lr=0.01\), \(k=50\).
For SpaceFlow benchmarking, we used the default parameters setting and data preprocessing method provided in their online tutorial (https://github.com/hongleir/SpaceFlow).
Evaluation metrics
The clustering performances of different models are evaluated with Adjusted Rand Index(ARI) [36], Normalized Mutual Information (NMI) [37] and Moran’s Index [38].
Let \(G\) denote the ground truth spot/cell labels, and \(P\) denote the predicted clustering assignments. ARI is computed as:
where \(N\) is the number of spots/cells and \({N}_{ij}\) is the number of spots/cells of class label \({C}_{j}^{*}\in G\) assigned to cluster \({C}_{i}\) in partition \(P\). \({N}_{i}\) is the number of spots/cells in cluster \({C}_{i}\) of partition \(P\), and \({N}_{j}\) is the number of spots/cells in class \({C}^{*}\). NMI is computed as the following:
where \(MI\left(G,P\right)\)denotes the mutual information between \(G\) and \(P\), \(H\left(G\right)\) and \(H\left(P\right)\)denote the information entropy of \(G\) and \(P\), respectively.
ARI and NMI measure the consistency between two sets. Generally, high ARI and NMI values indicate good performance. Acknowledge that the spot/cell annotated in the original publications may not be fully accurate, we also used a variant of Moran’s Index to evaluate the clustering performance [39]. Moran’s Index does not require true labels and is defined as:
where \(N\) is the number of spots/cells, \(A\) is the kNN graph (\(k=20\)) calculated using spatial coordinate information of spots.\({I}^{label}\) measures the celltype spatial concentration. In other words, spots that are close in physical space should also be assigned the same label. A high \({I}^{label}\) score indicates good performance. The values of ARI, NMI and \({I}^{label}\) range from 0 to 1.
Results and discussion
HyperGCN leads to improved clustering performance on four real spatial transcriptomics data from different tissues and technologies
We first assessed the clustering performance of HyperGCN on four spatial transcriptomics datasets. These datasets include human DLPFC data and mouse brain sagittal data that are sequenced by 10X Visium technique; the somatosensory cortex data with osmFISH technique and the Stereoseq data from mouse olfactory bulb tissue.
We compared HyperGCN with four existing methods for spatial transcriptomic data analysis, including SpaGCN [18], BayesSpace [21], SEDR [9] and SpaceFlow [20]. For SpaGCN and BayesSpace, we implemented its default data preprocessing and clustering methods with the recommended parameters. For SpaceFlow and SEDR, we implement Leiden clustering [40] on the generated embeddings. For HyperGCN, we first constructed hypergraph with kNN (\(k=20\)) using the spatial information of spots/cells, and then trained the model and implemented Leiden clustering algorithm on the embeddings.
The clustering performance evaluated by ARI, NMI and Moran’s Index is shown in Fig. 3ab. ARI and NMI are calculated based on the annotated layers in the original publishments, and Moran’s Index is calculated based on the generated clustering assignments and does not require the true labels.
As shown in Fig. 3, we can see that the proposed HyperGCN algorithm performs well on four datasets in terms of ARI, NMI and Moran’s Index. For the DLPFC data, BayesSpace also performs well in terms of ARI and NMI. For the clustering performance evaluated by the Moran’s Index, HyperGCN is the best among all methods. For the osmFISH dataset, HyperGCN significantly outperforms other methods on three clustering metrics. For the 10Xmbs data and the Stereoseq data, which do not have the ground truth labels, HyperGCN also performs well in Moran’s Index. The numeric values of the clustering metrics are also provided in Additional file 1: Supplementary Table S2.
To further demonstrate the effectiveness and efficiency of our proposed HyperGCN, we also implemented extensive experiments on four datasets from different sequencing techniques and tissues, including seqFISH+(mouse brain cortex) [7], ST(human positive breast tumors) [41], 10X Xenium(human colon cancer) and 10X Visium(Zabrafish melanoma). In addition, we have also benchmarked with other stateoftheart methods, including SOTIP [24], STAGATE [23], GraphST [22] and DR_SC [17] on different datasets. The experimental results showed that HyperGCN achieved the consistently superior performance on most cases. The results are presented in Additional file 1: Supplementary Table S3 and S4.
In the construction of hypergraph, we used the kNN graph to generate hypergraph. In the whole experiments, we set \(k=20\) for all the datasets. Sensitivity analysis of hyperparameter \(k\) showed that the different values of \(k\) led to the change of performance of the model. Especially, when the number of cells is small (< 5000), the performance of HyperGCN seems less stable. However, when the scale of dataset is large, the performance of HyperGCN is relatively stable with \(k\) varies (Stereoseq data, 19,527) (Additional file 1). In the experiments, for hyperparameters selection, we set \(\lambda =0.1\), \(\gamma =1\) for all datasets, for other values of these two parameters, HyperGCN still has stable performance(Additional file 1: Supplementary Table S5S6). We also tested the robustness of HyperGCN on the number of centroids in kmeans, the experimental results showed that the performance of HyperGCN was robust to the number of centroids in most cases (Additional file 1). The numbers of clusters are set as the numbers of annotated layers for DLFPC data and osmFISH data, respectively. For 10X Visium data and Stereoseq data, we empirically set the numbers of cluster equal to 12 and 7, respectively. We also implemented experiments to validate the robustness of HyperGCN by varying the numbers of clusters, the results showed that HyperGCN is stable in most cases (Additional file 1: Supplementary Table S7). For a dataset with unknown number of clusters, we suggest that using unsupervised Moran Index to select the number of clusters by implementing grid research.
To further test the performance of HyperGCN, we also implemented two simplified variants of model (12): (1) in the first variant, we only include spatial regularization loss in the model by letting \({\uplambda }\) to be 0; (2) in the second variant, only the clustering loss is included in the model by letting \({\upgamma }\) to be 0. The experimental results show that HyperGCN outperforms its two simplified variants in most of datasets (Additional file 1: Supplementary Table S8), which indicates that introducing DEC and spatial regularization into hypergraph autoencoder clustering framework is an effective strategy in spatial transcriptomics data analysis.
HyperGCN improves the identification of layer structures in the DLPFC tissue
To further evaluate the clustering performance of HyperGCN embeddings, we first compute the domain segmentation for each competitive method and visualize the outputs on Sect. 151,671 of DLPFC data (Fig. 4a). The manually annotated layers and white matter (WM) are used as the ground truth [42]. It can be seen that HyperGCN captures the best layer structures. Both SpaGCN and HyperGCN can identify Layer 5, Layer 6 and WM domains observed in the annotation, but SpaGCN shows noisy boundaries between domains. SEDR identifies Layer 6 and WM domain, but is unable to capture other remaining structures (Layer 3, Layer 4, Layer 5 and Layer 6). SpaceFlow captures the WM structure, but shows irregular and noncontiguous domain structures. Interestingly, HyperGCN found a subdomain at the top right of Layer 3 (labeled in gray). This result is also consistent with the domain observed in SpaceFlow.
We next compared SpaGCN, SEDR, SpaceFlow and HyperGCN (BayesSpace does not produce the embeddings) by implementing UMAP visualization [25]. The spots are colored based on the annotation provided in the original publishment of the data. As Fig. 4b shown, HyperGCN can well separate the spots by layers compared to other methods. For other datasets of DLPFC, HyperGCN still have good performance (Additional file 1: Supplementary Figure S1). The results indicate that HyperGCN achieves better visualization embeddings and can be used to implement some downstream analysis.
A domainspecific gene expression analysis was also performed to check the effectiveness of the identified domains from HyperGCN(Fig. 4c). Using the clustering assignments of HyperGCN, the top1 domainspecific genes for each layer are detected. For example, the domainspecific gene Saa1 for gray domain (top right, Fig .4a) shows spatial specific expression pattern with high expression level in this domain and low expression outside this domain. For domainspecific gene Tsmb10, it has also high expression values in identified domains (layer 5).
HyperGCN reveals spatial domains of the mouse somatosensory cortex profiled by osmFISH
Next, we test whether HyperGCN could provide insights in different tissues profiled by other techniques. We applied HyperGCN onto an osmFISH dataset which contains the gene expressions profiles of the mouse somatosensory cortex section accompanied by spatial information. We found SpaGCN and SEDR identified the roughly domain structures but showed noisy boundaries between layers (Fig. 5a). SpaceFlow captured Pia Layer 1, Layer 6, Layer 2–3 lateral, Ventricle and Internal capsule caudoputamen structures, but also showed an vague and noisy boundaries between domains (Fig. 5a). In contrast, the results of HyperGCN shows a smoother, denoised domain segmentation boundaries and outlines for some layers. Specifically, in hippocampus and Layer 6 region, HyperGCN clearly captured the domain structures which is consistent with the annotation.
We further compare SpaGCN, SEDR, SpaceFlow and HyperGCN by implementing UMAP visualization (Fig. 5b). Spots are colored based on their annotated layer labels provided in the original publishment of the data. We observed that the embeddings of SpaceFlow and HyperGCN could identify the domain spots from different layers. In addition, HyperGCN clearly separated the ventricle and WM domains. This indicates that spatial regularization and hypergraph can encode spatial information and preserve the local and global spatial structure of this data.
We also evaluated the performance of HyperGCN for domainspecific marker gene detection. These structure domains revealed by HyperGCN were clearly supported by the top marker genes of the identified domains (Fig. 5c). We can observed that the top1 marker genes of the identified domains show spatial specific expression pattern, such as Gfab, Syt6, Lamp5, Plp1 and Rorb. This result is consistent with the original publishment of this data (http://linnarssonlab.org/osmFISH/expression/). This indicates our proposed HyperGCN is effective for the identification of domain structures.
We also implement experiments on 10X Visium and Stereoseq datasets which have no ground truth labels provided in this original publishments. The results show HyperGCN achieves consistent good performance in terms of domain segmentation and data visualization (Fig. 6; Additional file 1: Supplementary Figure S2).
HyperGCN provides rich biological insights on the identified domain structure of the 10X visium mouse brain sagittal data
HyperGCN could uncover spatial gene expressions and provide rich biological insights. We applied HyperGCN in the 10X Visium mouse brain sagittal data to better show the domain structures and spatial expression pattern of genes. We compared the domain segmentation results of SpaGCN, SEDR and SpaceFlow with HyperGCN in the mouse brain sagittal data (Fig. 6a). As expected, HyperGCN exhibited denoised and clean domain structures. Similarly, we also implemented the spatial gene expression analysis of marker genes. More specifically, for the mouse brain sagittal data, we first used Scanpy package [27] to obtain differentially expressed marker genes for each clusters of HyperGCN, and then plotted the spatial gene expression heatmaps using top1 marker genes of the identified domains. As shown in Fig. 6b, Pcp2, Ppp1r1b, Fabp7, Cbln1 have high expression scores and show the distinct regional expression patterns in the identified tissue domains. The results are also in accord with SpaGCN and SEDR, which demonstrates that our proposed HyperGCN method can detect the biologically meaningful structure domains on the mouse brain sagittal data profiled with 10X Visium technology.
Other marker genes, the clustering assignment of HyperGCN provided rich information on the biological interpretation of the markers. We performed GO enrichment analysis using Enrichr [43,44,45]. Top 200 genes with small pvalues in each cluster are selected. The enriched terms are in accord with the biological function of the underlying structured domains (Fig. 6c; Additional file 1: Supplementary Table S9). For cluster 7 (pink region in the right subplot of Fig. 6a), GO analysis showed that the marker genes encompassed a wide array of biological processes and pathways such as “Central Nervous System Development” (log10(pvalue) = 7.56), “Nervous System Development” (log10(pvalue) = 7.11), “Brain Development” (log10(pvalue) = 4.28) and “Learning”(log10(pvalue) = 4.17). For cluster 10, the enriched BPs “Nervous System Development”(log10(pvalue) = 4.50), “Chemical Synaptic Transmission”(log10(pvalue) = 5.41), “ Modulation Of Excitatory Postsynaptic Potential”(log10(pvalue) = 3.61) are related to synaptic transmission, which may indicate some underlying biological activities.
To summarize, HyperGCN improves the identification of domain structures. The enrichment analyses for the domainspecific marker genes provide consistent and rich biological insights on the detected tissue domains.
Comparison of computational time
We also compared the computational cost of SpaGCN, BayesSpace, SEDR, SpaceFlow and HyperGCN on four real datasets with different numbers of spots/cells (Fig. 7). For larger datasets (> 20,000 spots), it takes more time to implement BayesSpace. For the DLPFC datasets with 12 spatially resolved RNAseq data sets, it takes more than 20 min to implement BayesSpace. The computational time for SpaGCN, SEDR, SpaceFlow and HyperGCN is comparable in most datasets. In practice, the run time of HyperGCN on spatial transcriptomics data with 7,000 cells/spots (osmFISH, 10Xmbs) is usually less than 2 min on a GPU. For the whole DLPFC data with 12 spatially resolved RNAseq datasets, it only takes less than 15 min to implement HyperGCN. For larger datasets (> 10,000 cells/spots), HyperGCN may implement fast on a GPU with large memory.
Conclusions
Spatially resolved transcriptomics technologies provide an unparalleled opportunity to comprehensively explore transcriptomics data with spatial information. Here we proposed HyperGCN, which integrates the gene expression and spatial proximity information into a hypergraph learning framework. Graphbased methods such as SpaGCN, SEDR and SpaceFlow, utilize nearest neighbors to encode spatial proximity between spots. Unlike these methods, HyperGCN generates a lowdimensional embeddings of spots by hypergraph convolution, which encodes the highorder geometrical structure information of original data into a deep autoencoder clustering framework. Extensive experiments have been conducted on four real spatial transcriptomics datasets. The experimental results show that HyperGCN achieves better clustering performance and clearer domain segmentation, by introducing hypergraph (Fig. 3; Additional file 1: Supplementary Table S2). In addition, HyperGCN facilitates downstream biological analysis, including the characterization of marker genes for the specific domain structure, and GO enrichment analysis. Studying on several real spatial transcriptomics datasets demonstrates the potential of HyperGCN, providing an effective tool to study the difference and functions of domain structures.
The current HyperGCN methodology mainly handles with gene expression and spatial information, and does not consider of histological images [18, 46] and 3D spatial transcriptomics datasets. In the future, we will utilize histological images as an additional modality, and integrate it into the HyperGCN framework to further improve the performance of domain segmentation. An intuitive way is to compute hypergraph by using histology image. Another future direction is to develop new regularization frameworks to adaptively model the spatial distribution patterns and dependencies of different tissues or locations with high geometric complexity [20]. Moreover, integrating single cell RNA data and corresponding spatial information to dissect the mechanism of cell communication is also our future research direction.
Data availability
The datasets generated or analyzed during the current study are available in the GitHub repository, https://github.com/chonghua1983/HyperGCN.
Abbreviations
 GCN:

Graph Convolutional Network
 HyperGCN:

Hypergraph induced Graph Convolutional Network
 ARI:

Adjusted Rand Index
 NMI:

Normalized Mutual Information
 MI:

Moran’s Index
 UMAP:

Uniform Manifold Approximation and Projection
References
Ji AL, Rubin AJ, Thrane K, Jiang S, Reynolds DL, Meyers RM, Guo MG, George BM, Mollbrink A, Bergenstråhle J. Multimodal analysis of composition and spatial architecture in human squamous cell carcinoma. Cell. 2020;182(2):497–514. e422.
Rodriques SG, Stickels RR, Goeva A, Martin CA, Murray E, Vanderburg CR, Welch J, Chen LM, Chen F, Macosko EZ. Slideseq: a scalable technology for measuring genomewide expression at high spatial resolution. Science. 2019;363(6434):1463–7.
Stickels RR, Murray E, Kumar P, Li J, Marshall JL, Di Bella DJ, Arlotta P, Macosko EZ, Chen F. Highly sensitive spatial transcriptomics at nearcellular resolution with SlideseqV2. Nat Biotechnol. 2021;39(3):313–9.
Chen A, Liao S, Cheng M, Ma K, Wu L, Lai Y, Yang J, Li W, Xu J, Hao S. Large field of viewspatially resolved transcriptomics at nanoscale resolution. BioRxiv 2021, 2021.
Codeluppi S, Borm LE, Zeisel A, La Manno G, van Lunteren JA, Svensson CI, Linnarsson S. Spatial organization of the somatosensory cortex revealed by osmFISH. Nat Methods. 2018;15(11):932–5.
Fu X, Sun L, Chen JY, Dong R, Lin Y, Palmiter RD, Lin S, Gu L. Continuous polony gels for tissue mapping with high resolution and RNA capture efficiency. BioRxiv 2021:2021.2003. 2017.435795.
Eng CHL, Lawson M, Zhu Q, Dries R, Koulena N, Takei Y, Yun J, Cronin C, Karp C, Yuan GC. Transcriptomescale superresolved imaging in tissues by RNA seqFISH+. Nature. 2019;568(7751):235–9.
Cho CS, Xi J, Park SR, Hsu JE, Kim M, Jun G, Kang HM, Lee JH. SeqScope: Submicrometerresolution spatial transcriptomics for single cell and subcellular studies. bioRxiv 2021:2021.2001. 2025.427807.
Fu H, Xu H, Chong K, Li M, Ang KS, Lee HK, Ling J, Chen A, Shao L, Liu L. Unsupervised spatially embedded deep representation of spatial transcriptomics. Biorxiv 2021:2021.2006. 2015.448542.
Walker BL, Cang Z, Ren H, BourgainChang E, Nie Q. Deciphering tissue structure and function using spatial transcriptomics. Commun Biology. 2022;5(1):220.
Stoltzfus CR, Filipek J, Gern BH, Olin BE, Leal JM, Wu Y, LyonsCohen MR, Huang JY, PazStoltzfus CL, Plumlee CR. CytoMAP: a spatial analysis toolbox reveals features of myeloid cell organization in lymphoid tissues. Cell Rep. 2020;31(3):107523.
Xia C, Fan J, Emanuel G, Hao J, Zhuang X. Spatial transcriptome profiling by MERFISH reveals subcellular RNA compartmentalization and cell cycledependent gene expression. Proc Natl Acad Sci. 2019;116(39):19490–9.
Butler A, Hoffman P, Smibert P, Papalexi E, Satija R. Integrating singlecell transcriptomic data across different conditions, technologies, and species. Nat Biotechnol. 2018;36(5):411–20.
Ming J, Lin Z, Zhao J, Wan X, Consortium TTM, Yang C, Wu AR. FIRM: flexible integration of singlecell RNAsequencing data for largescale multitissue cell atlas datasets. Brief Bioinform 2022, 23(5).
Kiselev VY, Kirschner K, Schaub MT, Andrews T, Yiu A, Chandra T, Natarajan KN, Reik W, Barahona M, Green AR. SC3: consensus clustering of singlecell RNAseq data. Nat Methods. 2017;14(5):483–6.
Ma Y, Sun Z, Zeng P, Zhang W, Lin Z. JSNMF enables effective and accurate integrative analysis of singlecell multiomics data. Brief Bioinform. 2022;23(3):bbac105.
Liu W, Liao X, Yang Y, Lin H, Yeong J, Zhou X, Shi X, Liu J. Joint dimension reduction and clustering analysis of singlecell RNAseq and spatial transcriptomics data. Nucleic Acids Res. 2022;50(12):e72–72.
Hu J, Li X, Coleman K, Schroeder A, Ma N, Irwin DJ, Lee EB, Shinohara RT, Li M. SpaGCN: integrating gene expression, spatial location and histology to identify spatial domains and spatially variable genes by graph convolutional network. Nat Methods. 2021;18(11):1342–51.
Pham D, Tan X, Xu J, Grice LF, Lam PY, Raghubar A, Vukovic J, Ruitenberg MJ, Nguyen Q. stLearn: integrating spatial location, tissue morphology and gene expression to find cell types, cellcell interactions and spatial trajectories within undissociated tissues. BioRxiv 2020:2020.2005. 2031.125658.
Ren H, Walker BL, Cang Z, Nie Q. Identifying multicellular spatiotemporal organization of cells with SpaceFlow. Nat Commun. 2022;13(1):4076.
Zhao E, Stone MR, Ren X, Guenthoer J, Smythe KS, Pulliam T, Williams SR, Uytingco CR, Taylor SE, Nghiem P. Spatial transcriptomics at subspot resolution with BayesSpace. Nat Biotechnol. 2021;39(11):1375–84.
Long Y, Ang KS, Li M, Chong KLK, Sethi R, Zhong C, Xu H, Ong Z, Sachaphibulkij K, Chen A. Spatially informed clustering, integration, and deconvolution of spatial transcriptomics with GraphST. Nat Commun. 2023;14(1):1155.
Dong K, Zhang S. Deciphering spatial domains from spatially resolved transcriptomics with an adaptive graph attention autoencoder. Nat Commun. 2022;13(1):1739.
Yuan Z, Li Y, Shi M, Yang F, Gao J, Yao J, Zhang MQ. SOTIP is a versatile method for microenvironment modeling with spatial omics data. Nat Commun. 2022;13(1):7330.
Becht E, McInnes L, Healy J, Dutertre CA, Kwok IW, Ng LG, Ginhoux F, Newell EW. Dimensionality reduction for visualizing singlecell data using UMAP. Nat Biotechnol. 2019;37(1):38–44.
Pardo B, Spangler A, Weber LM, Page SC, Hicks SC, Jaffe AE, Martinowich K, Maynard KR, ColladoTorres L. spatialLIBD: an R/Bioconductor package to visualize spatiallyresolved transcriptomics data. BMC Genomics. 2022;23(1):434.
Wolf FA, Angerer P, Theis FJ. SCANPY: largescale singlecell gene expression data analysis. Genome Biol. 2018;19:1–5.
Zhou D, Huang J, Schölkopf B. Learning with hypergraphs: clustering, classification, and embedding. Adv Neural Inf Process Syst 2006, 19.
White S, Smyth P. A spectral clustering approach to finding communities in graphs. In: Proceedings of the 2005 SIAM international conference on data mining: 2005: SIAM; 2005: 274–285.
Von Luxburg U. A tutorial on spectral clustering. Stat Comput. 2007;17:395–416.
Ma X, Liu W, Li S, Tao D, Zhou Y. Hypergraph $ p $Laplacian regularization for remotely sensed image recognition. IEEE Trans Geosci Remote Sens. 2018;57(3):1585–95.
Kipf TN, Welling M. Semisupervised classification with graph convolutional networks. arXiv Preprint arXiv:160902907 2016.
Kipf TN, Welling M. Variational graph autoencoders. arXiv Preprint arXiv:161107308 2016.
Xie J, Girshick R, Farhadi A. Unsupervised deep embedding for clustering analysis. In: International conference on machine learning: 2016: PMLR; 2016: 478–487.
Van der Maaten L, Hinton G. Visualizing data using tSNE. J Mach Learn Res 2008, 9(11).
Hubert L, Arabie P. Comparing partitions. J Classif. 1985;2:193–218.
Strehl A, Ghosh J. Cluster ensembles—a knowledge reuse framework for combining multiple partitions. J Mach Learn Res. 2002;3(Dec):583–617.
Moran PA. A test for the serial independence of residuals. Biometrika. 1950;37(1/2):178–81.
Lin X, Gao L, Whitener N, Ahmed A, Wei Z. A modelbased constrained deep learning clustering approach for spatially resolved singlecell data. Genome Res. 2022;32(10):1906–17.
Traag VA, Waltman L, Van Eck NJ. From Louvain to Leiden: guaranteeing wellconnected communities. Sci Rep. 2019;9(1):5233.
Andersson A, Larsson L, Stenbeck L, Salmén F, Ehinger A, Wu S, AlEryani G, Roden D, Swarbrick A, Borg Å. Spatial deconvolution of HER2positive breast tumors reveals novel intercellular relationships. bioRxiv 2020:2020.2007. 2014.200600.
Maynard KR, ColladoTorres L, Weber LM, Uytingco C, Barry BK, Williams SR, Catallini JL, Tran MN, Besich Z, Tippani M. Transcriptomescale spatial gene expression in the human dorsolateral prefrontal cortex. Nat Neurosci. 2021;24(3):425–36.
Chen EY, Tan CM, Kou Y, Duan Q, Wang Z, Meirelles GV, Clark NR. Ma’ayan A: Enrichr: interactive and collaborative HTML5 gene list enrichment analysis tool. BMC Bioinformatics. 2013;14(1):1–14.
Kuleshov MV, Jones MR, Rouillard AD, Fernandez NF, Duan Q, Wang Z, Koplev S, Jenkins SL, Jagodnik KM, Lachmann A. Enrichr: a comprehensive gene set enrichment analysis web server 2016 update. Nucleic Acids Res. 2016;44(W1):W90–7.
Xie Z, Bailey A, Kuleshov MV, Clarke DJ, Evangelista JE, Jenkins SL, Lachmann A, Wojciechowicz ML, Kropiwnicki E, Jagodnik KM. Gene set knowledge discovery with Enrichr. Curr Protocols. 2021;1(3):e90.
Xu C, Jin X, Wei S, Wang P, Luo M, Xu Z, Yang W, Cai Y, Xiao L, Lin X. DeepST: identifying spatial domains in spatial transcriptomics by deep learning. Nucleic Acids Res. 2022;50(22):e131–131.
Acknowledgements
Not applicable.
Funding
This work was supported by the Ministry of Science and Technology Project of China[G2023027007L], Hubei University of Arts and Science under Startup Grant [2059232], and Hubei Superior and Distinctive Discipline Group of “New Energy Vehicle and Smart Transportation”.
Author information
Authors and Affiliations
Contributions
YM developed the algorithms, coimplemented experiments and helped to draft the manuscript. YZ coimplemented the experiment used in the paper and LL contributed to the writing of the manuscript. BH and YZ examined the revised manuscript and proposed the relevant revisions. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Ethics approval and consent to participate
Not applicable.
Consent for publication
Not applicable.
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Electronic supplementary material
Below is the link to the electronic supplementary material.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated in a credit line to the data.
About this article
Cite this article
Ma, Y., Liu, L., Zhao, Y. et al. HyperGCN: an effective deep representation learning framework for the integrative analysis of spatial transcriptomics data. BMC Genomics 25, 566 (2024). https://doi.org/10.1186/s1286402410469x
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s1286402410469x