Method for multiscale spatial transcriptomic domain identification based on block wavelet maps
By employing a multi-scale spatial transcriptome domain identification method based on block wavelet graphs, and utilizing an adaptive block segmentation strategy and graph attention autoencoder, the problem of insufficient cross-scale biological signal capture in existing technologies is solved, achieving efficient and accurate spatial domain identification, which is suitable for the analysis of ultra-large-scale µST data.
Patent Information
- Application Number
- CN202610423203.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-01
- Publication Date
- 2026-07-07
AI Technical Summary
Existing spatial transcriptome domain identification technologies suffer from high computational complexity, high hardware barriers, and difficulty in capturing cross-scale biological signals when faced with large-scale data at microscopic resolution. This results in insufficient fine structure identification capabilities and an inability to fully reconstruct the complex spatial architecture of tissues.
A multi-scale spatial transcriptome domain identification method based on block wavelet graphs is adopted. Through an adaptive block strategy and graph attention autoencoder, combined with a dual-domain loss function and attention fusion mechanism, multi-scale feature extraction and cluster analysis are performed to achieve accurate capture of cross-scale biological signals and efficient spatial domain identification.
It breaks through hardware limitations and achieves efficient and accurate spatial domain identification of ultra-large-scale µST data. It can simultaneously capture global organizational patterns and local molecular variations, and output spatial domain identification results consistent with biological reality.
Smart Images

Figure CN122347994A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and specifically to a multi-scale spatial transcriptome domain identification method based on block wavelet maps. Background Technology
[0002] Space biology is rapidly entering the era of microscale resolution spatial transcriptomics (µST), a technology capable of mapping the entire transcriptome at subcellular resolution with spatial accuracy below 1 µm, providing unprecedented technical support for understanding tissue complexity. Next-generation spatial transcriptomics platforms such as Visium HD, Xenium, GeoMx, and Stereo-seq, through advanced molecular barcoding technologies and imaging-based capture strategies, have overcome the limitations of traditional physical resolution, making it possible to precisely characterize tissue spatial structures at the molecular level.
[0003] In various platforms, the smallest spatially sampleable unit is uniformly referred to as a "spot." While the exponential increase in sampling density brings rich biological information, it also leads to a dramatic increase in data size and significantly enhanced sparsity, posing a serious challenge to subsequent data analysis. Spatial transcriptome domain identification is one of the core tasks of spatial transcriptome data analysis. Its goal is to accurately delineate tissue regions with similar gene expression patterns and spatial distribution characteristics, providing crucial evidence for revealing tissue heterogeneity, intercellular interactions, and disease-related molecular mechanisms.
[0004] Currently, existing spatial transcriptome domain identification technologies mainly include graph-based clustering methods (such as Louvain and stLearn), probabilistic modeling methods (such as BayesSpace and BASS), and deep learning methods (such as STAGATE and GraphST). These methods have promoted the development of spatial domain identification technology to a certain extent, but they all face unavoidable bottlenecks when dealing with massive amounts of microscopic resolution spatial transcriptome data. For example, graph-based methods rely on simplified adjacency structures, have poor scalability, and cannot adapt to ultra-large-scale datasets with millions of loci; probabilistic modeling methods have extremely high computational complexity and memory consumption, making them difficult to apply to whole-tissue analysis; deep learning methods often require loading the entire graph for training and inference, resulting in high hardware requirements, and single-scale feature encoding cannot fully capture cross-scale biological heterogeneity, leading to insufficient fine structure identification capabilities.
[0005] Multi-scale feature extraction is a key technical requirement for analyzing the spatial structure of complex tissues. The spatial heterogeneity of biological tissues is manifested at multiple scales, including both global tissue partitioning features and local fine substructures and molecular transition regions. However, traditional single-scale modeling methods often focus on capturing high-variance global spatial patterns, making it difficult to effectively separate weak biological signals from technical noise. This results in the obscuring of fine tissue substructures and subtle molecular transition regions, failing to fully reconstruct the complex spatial architecture of tissues.
[0006] Therefore, to solve the above problems, a multi-scale spatial transcriptome domain identification method based on block wavelet maps is needed, which can accurately capture cross-scale biological signals, overcome hardware limitations, and achieve efficient and accurate spatial domain identification of ultra-large-scale µST data. Summary of the Invention
[0007] In view of this, the purpose of this invention is to overcome the shortcomings of the prior art and provide a multi-scale spatial transcriptome domain identification method based on block wavelet maps, which can accurately capture cross-scale biological signals, break through hardware limitations, and achieve efficient and accurate spatial domain identification of ultra-large-scale µST data.
[0008] The multi-scale spatial transcriptome domain identification method based on block wavelet maps of the present invention includes:
[0009] Obtain raw genetic data from the spatial transcriptome;
[0010] The raw gene data is preprocessed to obtain the processed gene data;
[0011] Multi-scale feature extraction is performed on the processed gene data to obtain feature data information;
[0012] The block-level model is trained using feature data information to obtain a trained block-level model;
[0013] The block-level model outputs block-based inference results, which are then globally reorganized and clustered to obtain spatial domain partitioning results.
[0014] Furthermore, the original gene data includes an original gene expression count matrix and spatial coordinate information;
[0015] Preprocessing of raw genetic data includes:
[0016] The original gene expression count matrix was normalized site-by-site and logarithmically transformed, and the top genes were selected by sorting according to spatial variability. Highly variable genes; if the number of genes in the dataset is less than If so, all genes will be retained;
[0017] In this process, spot-by-spot normalization is performed on each row of the expression count matrix as an independent processing unit. The default Scanpy strategy of counting by millions of transcripts is used to scale the original expression counts of all genes in each spot, so that the total normalized expression level of each spot is uniform to the order of millions. The logarithmic transformation is a normalized log1p transformation, which first normalizes the total expression level of each spot, and then takes log(1+x) on the normalized value.
[0018] Constructing a spatial map:
[0019] Based on spatial coordinates, calculate the Euclidean distance between points and construct an undirected... Nearest neighbor graph, adjacency matrix ,satisfy:
[0020] ;
[0021] Generate a trimmed image:
[0022] The gene expression counting matrix is dimensionality reduced, and then preliminary clustering is performed to remove edges that cross the cluster boundaries. Then, outlier detection is performed to remove long-distance spurious connections with Euclidean lengths exceeding a preset standard, and finally a pruned graph is obtained.
[0023] Furthermore, multi-scale feature extraction is performed on the processed gene data, specifically including:
[0024] Wavelet decomposition:
[0025] Gene expression vectors at each site Treat it as a one-dimensional discrete signal and initialize it. Through iterative decomposition using low-pass and high-pass filters, the formula is:
[0026] ;
[0027] ;
[0028] in, These are approximate coefficients. For detail coefficients, subscript This represents the levels of wavelet decomposition, with each level producing an approximation coefficient and a detail coefficient. The length of the input signal at the current level. For convolution offset, It is the position index in the current level's output coefficient sequence; Indicates low-pass filtering; Indicates high-pass filtering; after After layer decomposition, the multi-scale coefficient set corresponding to each gene expression vector is: ( );
[0029] Constructing cross-scale feature matrices :
[0030] By concatenating the coefficients of each decomposition level, a feature vector for a single site can be obtained. After aggregating all sites:
[0031] ;
[0032] in, , The total number of coefficients across all scales;
[0033] Constructing the mask feature matrix :
[0034] Constructing a binary mask Preserving approximation coefficients and suppressing high-frequency detail components, through element-wise... Multiplication yields:
[0035] ;
[0036] Stack all form It is used to highlight the global structure and reduce noise interference.
[0037] Furthermore, the block-level model is trained using feature data information, specifically including:
[0038] Dataset partitioning:
[0039] Parameters are divided by patch The global tissue slices are divided according to spatial coordinates. Each spatially contiguous patch preserves the original site index to maintain data integrity, ensuring that each patch contains approximately [number missing]. One site;
[0040] Encoder design:
[0041] The first layer is the multi-head graph attention layer: it aggregates local neighborhood features, using the following formula:
[0042] ;
[0043] ;
[0044] in, For the input feature matrix, For the number of attention heads, For each attention head, trainable weights, To normalize the attention coefficient, and All are activation functions. For sites including themselves ; Indicates the site The feature vector output after the first layer of graph attention encoding; Indicates site The input feature vector, where It is a site neighborhood Any neighbor in; For the first A trainable attention weight vector for each attention head;
[0045] The second layer is a linear projection layer: it compares the spatial map with the first layer features of the trimmed map. and After concatenation and projection, the site embedding is obtained:
[0046] ;
[0047] in, The weight matrix is trainable. and They are matrices and The Middle The feature vector of a row, i.e., the position Specific output; For site The final site embedding feature vector is obtained by linear projection after fusing the first-layer features of the spatial map and the pruning map.
[0048] Decoder Design:
[0049] The mirror encoder architecture reconstructs wavelet coefficients using the following formula:
[0050] ;
[0051] ;
[0052] in, and All of these are trainable parameters; For site The feature vector output after passing through the multi-head graph attention layer; For the spatial map branch, the site The feature vector output after passing through the multi-head graph attention layer; In the pruning diagram branch, the site The feature vector output after passing through the multi-head graph attention layer; For site The final output feature vector obtained after passing through the linear projection layer;
[0053] Finally, the wavelet coefficient matrix is reconstructed. ;
[0054] Inverse wavelet transform for gene expression reconstruction:
[0055] right With mask feature matrix Applying inverse wavelet transform, the single-level reconstruction formula is as follows:
[0056] ;
[0057] in, and These are reconstruction low-pass filtering and reconstruction high-pass filtering, respectively. The iteration proceeds from level J down to level 1 to obtain the reconstruction matrix. and ;
[0058] Attention fusion:
[0059] By integrating the dual reconstruction results through an attention mechanism, the attention coefficient is learned. And weighted fusion:
[0060] , ;
[0061] ;
[0062] in, Let be a trainable parameter vector, and ⊙ be an element. multiplication;
[0063] Dual-domain loss function optimization:
[0064] Jointly optimize wavelet domain and gene expression domain reconstruction errors The formula is:
[0065] ;
[0066] in, and These are the original wavelet coefficients and the reconstructed wavelet coefficients, respectively. and These are the original gene expression vector and the reconstructed gene expression vector, respectively. This represents the total number of sites in the spatial transcriptome data; To reconstruct weights in the wavelet domain, the order of patches is randomly shuffled during training, and the training is iterated for a preset number of rounds.
[0067] Furthermore, the trained block-level model outputs block-based inference results, specifically including:
[0068] The data from each spatially continuous patch is input into the trained graph attention autoencoder, and a forward propagation is performed to generate low-dimensional feature embeddings.
[0069] Furthermore, the results of the segmented reasoning are globally reorganized, specifically including:
[0070] Iterate through all patches and embed the patches into the matrix based on the original site index recorded for each patch. Each row in the matrix is replaced with a global embedding matrix. The corresponding row positions are used to obtain the global low-dimensional feature matrix.
[0071] Furthermore, cluster analysis is performed to obtain the spatial domain partitioning results, specifically including:
[0072] Using the global low-dimensional feature matrix as input for clustering, cluster labels are obtained through clustering.
[0073] The clustering label corresponding to each site is converted into a color value according to a preset color mapping scheme. Combined with the input original spatial coordinates, the color point of each site is drawn on a two-dimensional plane, thereby generating a color-coded spatial domain distribution map of tissue slices. In this map, different color regions represent different spatial transcriptome domains.
[0074] The beneficial effects of this invention are as follows: This invention discloses a multi-scale spatial transcriptome domain identification method based on block wavelet graphs. It overcomes memory limitations through an adaptive block-based strategy, simultaneously capturing global organizational patterns and local molecular variations using one-dimensional discrete wavelet transform. It utilizes a graph attention autoencoder to fuse dual-graph structural information, along with a dual-domain loss and attention fusion mechanism, to achieve accurate learning of multi-scale features. Through spatial graph pruning to suppress noise interference, and finally through block inference, global recombination, and clustering, it outputs spatial domain identification results consistent with biological realities. This invention balances computational efficiency and recognition accuracy, and can efficiently analyze the spatial structure of ultra-large-scale µST data, providing technical support for space biology research. Attached Figure Description
[0075] The present invention will be further described below with reference to the accompanying drawings and embodiments:
[0076] Figure 1 This is a schematic diagram of the multi-scale spatial transcriptome domain identification method of the present invention;
[0077] Figure 2 This is a schematic diagram of the multi-scale feature extraction and block-level training of the present invention. Detailed Implementation
[0078] The present invention will be further described below with reference to the accompanying drawings, as shown in the figures:
[0079] This embodiment discloses a multi-scale spatial transcriptome domain identification method based on block wavelet maps, including the following steps:
[0080] S1. Obtain raw gene data of the spatial transcriptome;
[0081] S2. Preprocess the raw gene data to obtain processed gene data;
[0082] S3. Perform multi-scale feature extraction on the processed gene data to obtain feature data information;
[0083] S4. Use the feature data information to train the block-level model to obtain the trained block-level model;
[0084] S5. Output the block inference results through the trained block-level model, perform global reorganization on the block inference results, and then perform cluster analysis to obtain the spatial domain partitioning results.
[0085] In this embodiment, step S1 involves importing microscopic resolution spatial transcriptome-related data; the original gene data includes an original gene expression count matrix and spatial coordinate information; wherein, the original gene expression count matrix... , For the number of spatial locations, The number of genes is represented by the spatial coordinate information, which is the physical location of the Spot on a real biological tissue slice (two-dimensional horizontal and vertical coordinates). The smallest spatially sampleable unit is uniformly called a Spot, and the Spot is used as the sequencing capture point.
[0086] In this embodiment, in step S2, gene expression data are standardized and highly variable genes are screened; a k-nearest neighbor spatial graph is constructed based on spatial coordinates, and redundant connections are pruned through preliminary clustering and outlier detection.
[0087] Preprocessing of raw genetic data includes:
[0088] The original gene expression count matrix was normalized and logarithmically transformed site-by-site using the Scanpy tool, and the top genes were selected based on spatial variability. Highly variable genes; if the number of genes in the dataset is less than If so, all genes will be retained;
[0089] In this process, spot-by-spot normalization is performed on each row of the expression count matrix as an independent processing unit. The default Scanpy strategy of counting by millions of transcripts is used to scale the original expression counts of all genes in each spot, so that the total normalized expression level of each spot is uniform to the order of millions. The logarithmic transformation is a normalized log1p transformation, which first normalizes the total expression level of each spot, and then takes log(1+x) on the normalized value.
[0090] In the same tissue slice, the amount of RNA captured and the number of sequencing reads at different sites are different, which will lead to an overall higher expression value of the spot with high sequencing depth. This deviation is not related to the actual expression level of the gene, and can be offset by normalization.
[0091] Logarithmic transformation is a statistical processing method for the inherent distribution characteristics of gene expression data. It solves the problems of data distribution and numerical differences, adapts to the training requirements of subsequent machine learning models, and avoids the calculation problem of taking the logarithm of 0 values by using log1p(x+1), compressing the numerical range and making model training more stable.
[0092] Constructing a spatial map :
[0093] Based on spatial coordinates, calculate the Euclidean distance between points and construct an undirected... Nearest neighbor graph, adjacency matrix ,satisfy:
[0094] ;
[0095] By constructing a k-nearest neighbor graph ( This transforms physical proximity into the existence of edge connections in graph theory. In this way, the model can utilize graph neural networks to handle these spatial relationships. Specifically, for Visium HD / Xenium / Stereo-seq / simulated data, k=8; for standard 10x Visium... =6.
[0096] This diagram assumes that spatially adjacent spots tend to have similar gene expression or form the same tissue structure. By connecting each spot with its k nearest neighbors, the model is able to capture the local microenvironment of the cell neighborhood.
[0097] Constructing undirected After the nearest neighbor graph is generated, edge pruning (removing pseudo-nearest edges that cross cluster boundaries or are too long) will be performed based on the PCA embedding and Louvain clustering results.
[0098] In the encoder part of the model, it was used simultaneously and With two adjacency matrices, the model can distinguish between true biological boundaries and isolated points caused by technical noise by comparing or fusing information from the nearest neighbor graph and the pruning graph.
[0099] Generate trimming diagram :
[0100] Gene expression counting matrix analyzed by PCA Dimensionality reduction is performed, followed by preliminary clustering using the Louvain algorithm to obtain preliminary labels for each point. traversal edge ,like If an edge is not found in the set, it is removed from the edge set. Then, the Euclidean distance of the remaining edges is calculated, and an Isolation Forest is used to detect outliers, removing long-distance spurious connections whose Euclidean length exceeds a preset standard. The final pruned graph is then obtained. The preset standard can be the global mean plus one standard deviation. The refined pruned graph is shown below. , Trimming diagram It is a spatial map A subset and a biologically refined version together constitute a dual-graph input.
[0101] Pruned maps and spatial maps provide crucial spatial structure information for multi-scale feature extraction, thereby enabling recognition from raw data to the final spatial domain.
[0102] In this embodiment, in step S3, the site gene expression vector is regarded as a one-dimensional signal and decomposed into global approximation coefficients and local detail coefficients through discrete wavelet transform to construct a cross-scale feature matrix and a mask feature matrix.
[0103] Multi-scale feature extraction is performed on the processed gene data, specifically including:
[0104] Wavelet decomposition (one-dimensional discrete wavelet transform):
[0105] Gene expression vectors at each site Treat it as a one-dimensional discrete signal and initialize it. Through iterative decomposition using low-pass and high-pass filters, the formula is:
[0106] ;
[0107] ;
[0108] in, These are approximate coefficients (capturing low-frequency global organization patterns). For detail coefficients (capturing high-frequency local molecular variations), subscript This represents the levels of wavelet decomposition, with each level producing an approximation coefficient (low frequency) and a detail coefficient (high frequency). The length of the input signal at the current level. For convolution offset, It is the position index in the current level's output coefficient sequence; Indicates low-pass filtering; Indicates high-pass filtering; after After layer decomposition, the multi-scale coefficient set corresponding to each gene expression vector is: ( );
[0109] Constructing cross-scale feature matrices :
[0110] By concatenating the coefficients of each decomposition level, a feature vector for a single site can be obtained. After aggregating all sites:
[0111] ;
[0112] in, , The total number of coefficients across all scales;
[0113] Constructing the mask feature matrix :
[0114] Constructing a binary mask Preserving approximation coefficients and suppressing high-frequency detail components, through element-wise... Multiplication yields:
[0115] ;
[0116] Stack all form It is used to highlight the global structure and reduce noise interference.
[0117] In this embodiment, in step S4, the data is divided into spatial patches according to parameters, a graph attention autoencoder is constructed, the model is trained by combining a dual-domain loss function, and multi-source reconstruction features are fused through an attention mechanism.
[0118] Training a block-level model using feature data information specifically includes:
[0119] Dataset partitioning:
[0120] Parameters are divided by patch The global tissue slices are divided according to spatial coordinates. Each spatially contiguous patch preserves the original site index to maintain data integrity, ensuring that each patch contains approximately [number missing]. 1 site; among which, , Indicates the number of spatial locations;
[0121] The architecture and training of graph attention autoencoders specifically include:
[0122] Encoder design:
[0123] The first layer is the multi-head graph attention layer: it aggregates local neighborhood features, using the following formula:
[0124] ;
[0125] ;
[0126] in, For the input feature matrix, For the number of attention heads, For each attention head, trainable weights, To normalize the attention coefficient, and All are activation functions. For sites including themselves ; Indicates the site The feature vector output after the first layer of graph attention encoding; Indicates site The input feature vector, where It is a site neighborhood Any neighbor in; For the first A trainable attention weight vector for each attention head;
[0127] The second layer is a linear projection layer: it compares the spatial map with the first layer features of the trimmed map. and After concatenation and projection, the site embedding is obtained:
[0128] ;
[0129] in, The weight matrix is trainable. and They are matrices and The Middle The feature vector of a row, i.e., the position Specific output; For site The final site embedding feature vector is obtained by linear projection after fusing the first-layer features of the spatial map and the pruning map.
[0130] Decoder Design:
[0131] The mirror encoder architecture reconstructs wavelet coefficients using the following formula:
[0132] ;
[0133] ;
[0134] in, and All of these are trainable parameters; For site The feature vector output after the multi-head graph attention layer is the site embedding of the encoder output. Intermediate features after performing mirrored graph attention neighborhood aggregation.
[0135] For the spatial map branch, the site The feature vector output after the multi-head graph attention layer corresponds to the spatial graph. .
[0136] In the pruning diagram branch, the site The feature vector output after the multi-head image attention layer corresponds to the trimmed image. .
[0137] For site The final output feature vector obtained after the linear projection layer is the final representation of wavelet coefficients, which integrates the dual-branch decoding features.
[0138] Finally, the wavelet coefficient matrix is reconstructed. ;
[0139] Inverse wavelet transform for gene expression reconstruction:
[0140] right With mask feature matrix Applying inverse wavelet transform, the single-level reconstruction formula is as follows:
[0141] ;
[0142] in, and These are reconstruction low-pass filtering and reconstruction high-pass filtering, respectively. The iteration proceeds from level J down to level 1 to obtain the reconstruction matrix. (Preserving high-frequency details) and (Highlighting the low-frequency global structure); It should be noted that j and J correspond to wavelet transform and inverse wavelet transform, respectively, and are numerically equal.
[0143] Attention fusion:
[0144] By integrating the dual reconstruction results through an attention mechanism, the attention coefficient is learned. And weighted fusion:
[0145] , ;
[0146] ;
[0147] in, Let be a trainable parameter vector, and ⊙ be an element. multiplication;
[0148] Dual-domain loss function optimization:
[0149] Jointly optimize wavelet domain and gene expression domain reconstruction errors The formula is:
[0150] ;
[0151] in, and These are the original wavelet coefficients and the reconstructed wavelet coefficients, respectively. and These are the original gene expression vector and the reconstructed gene expression vector, respectively. For sites in spatial transcriptome data (or The total number of sequencing sites (or cells) in the input data. Reconstructing weights in the wavelet domain The value can be 20, and the order of the patches is randomly shuffled during training, with iterative training for a preset number of rounds.
[0152] By constructing a cross-scale feature matrix and mask feature matrix The spatial graph jointly generated is used as the initial input features of the graph attention autoencoder. With trimming diagram By employing a block-based training strategy, parallel encoding, decoding, reconstruction, and inverse wavelet transform of dual graphs are performed independently on each spatially continuous patch. Furthermore, a dual-domain loss function is used to jointly optimize the reconstruction error in the wavelet domain and the gene expression domain.
[0153] In this embodiment, in step S5, each patch is independently reasoned, the global low-dimensional features are reorganized, a clustering algorithm is used to complete spatial domain identification, and the clustering resolution is adjusted by matching the annotation data as needed.
[0154] The trained block-level model outputs block-based inference results, specifically including:
[0155] The trained model performs independent inference for each patch, that is, the data of each spatially continuous patch is input into the trained graph attention autoencoder, a forward propagation is performed, and a low-dimensional feature embedding is generated.
[0156] When partitioning the dataset, the original global index is preserved for each site. After inference is completed, the block inference results are globally reorganized, specifically including:
[0157] Iterate through all patches and embed the patches into the matrix based on the original site index recorded for each patch. Each row in the matrix is replaced with a global embedding matrix. The corresponding row positions are used to obtain the global low-dimensional feature matrix.
[0158] Cluster analysis was performed to obtain the spatial domain partitioning results, specifically including:
[0159] Using the global low-dimensional feature matrix as input for clustering, cluster labels are obtained through clustering. Clustering algorithms can include Mclust (suitable for manually annotated datasets, where the number of clusters matches the number of annotated domains), Louvain, or Leiden (suitable for unannotated data, where latent structures are mined by adjusting resolution). Furthermore, the clustering accuracy can be evaluated using the Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), and Homogeneity Score (HS) to ensure consistency between spatial domain identification results and tissue morphology and molecular characteristics.
[0160] The clustering label corresponding to each site is converted into a color value according to a preset color mapping scheme. Combined with the input original spatial coordinates, the color point of each site is plotted on a two-dimensional plane to generate a color-coded spatial domain distribution map of tissue slices. In this map, different color regions represent different spatial transcriptomic domains (such as tumor areas, cortical layers, etc.), which can clearly show the boundaries and distribution of each domain, facilitating researchers to perform biological interpretation and subsequent analysis.
[0161] This invention targets ultra-large-scale micro-resolution spatial transcriptome (µST) data. It overcomes the memory wall dilemma through an adaptive block-based strategy, simultaneously capturing global organizational patterns and local molecular variations using one-dimensional discrete wavelet transform. A graph attention autoencoder fuses dual-graph structural information, coupled with a dual-domain loss and attention fusion mechanism to achieve accurate learning of multi-scale features. Spatial graph pruning suppresses noise interference, and finally, through block-based inference, global recombination, and differential clustering, it outputs spatial domain recognition results consistent with biological realities. This method balances computational efficiency and recognition accuracy, efficiently resolving the spatial structure of ultra-large-scale µST data, and providing reliable technical support for space biology research.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A multi-scale spatial transcriptome domain identification method based on block wavelet maps, characterized in that: include: Obtain raw genetic data from the spatial transcriptome; The raw gene data is preprocessed to obtain the processed gene data; Multi-scale feature extraction is performed on the processed gene data to obtain feature data information; The block-level model is trained using feature data information to obtain a trained block-level model; The block-level model outputs block-based inference results, which are then globally reorganized and clustered to obtain spatial domain partitioning results.
2. The multi-scale spatial transcriptome domain identification method based on block wavelet maps according to claim 1, characterized in that: The original gene data includes the original gene expression count matrix and spatial coordinate information; Preprocessing of raw genetic data includes: The original gene expression count matrix was normalized site-by-site and logarithmically transformed, and the top genes were selected by sorting according to spatial variability. Highly variable genes; if the number of genes in the dataset is less than If so, all genes will be retained; In this process, spot-by-spot normalization is performed on each row of the expression count matrix as an independent processing unit. The default Scanpy strategy of counting by millions of transcripts is used to scale the original expression counts of all genes in each spot, so that the total normalized expression level of each spot is uniform to the order of millions. The logarithmic transformation is a normalized log1p transformation, which first normalizes the total expression level of each spot, and then takes log(1+x) on the normalized value. Constructing a spatial map: Based on spatial coordinates, calculate the Euclidean distance between points and construct an undirected... Nearest neighbor graph, adjacency matrix ,satisfy: ; Generate a trimmed image: The gene expression counting matrix is dimensionality reduced, and then preliminary clustering is performed to remove edges that cross the cluster boundaries. Then, outlier detection is performed to remove long-distance spurious connections with Euclidean lengths exceeding a preset standard, and finally a pruned graph is obtained.
3. The multi-scale spatial transcriptome domain identification method based on block wavelet maps according to claim 1, characterized in that: Multi-scale feature extraction is performed on the processed gene data, specifically including: Wavelet decomposition: Gene expression vectors at each site Treat it as a one-dimensional discrete signal and initialize it. Through iterative decomposition using low-pass and high-pass filters, the formula is: ; ; in, These are approximate coefficients. For detail coefficients, subscript This represents the levels of wavelet decomposition, with each level producing an approximation coefficient and a detail coefficient. The length of the input signal at the current level. For convolution offset, It is the position index in the current level's output coefficient sequence; Indicates low-pass filtering; Indicates high-pass filtering; after After layer decomposition, the multi-scale coefficient set corresponding to each gene expression vector is: ( ); Constructing cross-scale feature matrices : By concatenating the coefficients of each decomposition level, a feature vector for a single site can be obtained. After aggregating all sites: ; in, , The total number of coefficients across all scales; Constructing the mask feature matrix : Constructing a binary mask Preserving approximation coefficients and suppressing high-frequency detail components, through element-wise... Multiplication yields: ; Stack all form It is used to highlight the global structure and reduce noise interference.
4. The multi-scale spatial transcriptome domain identification method based on block wavelet maps according to claim 1, characterized in that: Training a block-level model using feature data information specifically includes: Dataset partitioning: Parameters are divided by patch The global tissue slices are divided according to spatial coordinates. Each spatially contiguous patch preserves the original site index to maintain data integrity, ensuring that each patch contains approximately [number missing]. One site; Encoder design: The first layer is the multi-head graph attention layer: it aggregates local neighborhood features, using the following formula: ; ; in, For the input feature matrix, For the number of attention heads, For each attention head, trainable weights, To normalize the attention coefficient, and All are activation functions. For sites including themselves ; Indicates the site The feature vector output after the first layer of graph attention encoding; Indicates site The input feature vector, where It is a site neighborhood Any neighbor in; For the first A trainable attention weight vector for each attention head; The second layer is a linear projection layer: it compares the spatial map with the first layer features of the trimmed map. and After concatenation and projection, the site embedding is obtained: ; in, The weight matrix is trainable. and They are matrices and The Middle The feature vector of a row, i.e., the position Specific output; For site The final site embedding feature vector is obtained by linear projection after fusing the first-layer features of the spatial map and the pruning map. Decoder Design: The mirror encoder architecture reconstructs wavelet coefficients using the following formula: ; ; in, and All of these are trainable parameters; For site The feature vector output after passing through the multi-head graph attention layer; For the spatial map branch, the site The feature vector output after passing through the multi-head graph attention layer; In the pruning diagram branch, the site The feature vector output after passing through the multi-head graph attention layer; For site The final output feature vector obtained after passing through the linear projection layer; Finally, the wavelet coefficient matrix is reconstructed. ; Inverse wavelet transform for gene expression reconstruction: right With mask feature matrix Applying inverse wavelet transform, the single-level reconstruction formula is as follows: ; in, and These are reconstruction low-pass filtering and reconstruction high-pass filtering, respectively. The iteration proceeds from level J down to level 1 to obtain the reconstruction matrix. and ; Attention fusion: By integrating the dual reconstruction results through an attention mechanism, the attention coefficient is learned. And weighted fusion: , ; ; in, Let be a trainable parameter vector, and ⊙ be an element. multiplication; Dual-domain loss function optimization: Jointly optimize wavelet domain and gene expression domain reconstruction errors The formula is: ; in, and These are the original wavelet coefficients and the reconstructed wavelet coefficients, respectively. and These are the original gene expression vector and the reconstructed gene expression vector, respectively. This represents the total number of sites in the spatial transcriptome data; To reconstruct weights in the wavelet domain, the order of patches is randomly shuffled during training, and the training is iterated for a preset number of rounds.
5. The multi-scale spatial transcriptome domain identification method based on block wavelet maps according to claim 1, characterized in that: The trained block-level model outputs block-based inference results, specifically including: The data from each spatially continuous patch is input into the trained graph attention autoencoder, and a forward propagation is performed to generate low-dimensional feature embeddings.
6. The multi-scale spatial transcriptome domain identification method based on block wavelet maps according to claim 1, characterized in that: The results of the block reasoning are globally reorganized, specifically including: Iterate through all patches and embed the patches into the matrix based on the original site index recorded for each patch. Each row in the matrix is replaced with a global embedding matrix. The corresponding row positions are used to obtain the global low-dimensional feature matrix.
7. The multi-scale spatial transcriptome domain identification method based on block wavelet maps according to claim 1, characterized in that: Cluster analysis was performed to obtain the spatial domain partitioning results, specifically including: Using the global low-dimensional feature matrix as input for clustering, cluster labels are obtained through clustering. The clustering label corresponding to each site is converted into a color value according to a preset color mapping scheme. Combined with the input original spatial coordinates, the color point of each site is drawn on a two-dimensional plane, thereby generating a color-coded spatial domain distribution map of tissue slices. In this map, different color regions represent different spatial transcriptome domains.
