Deconvolution method for spatial transcriptome data based on autoencoder and contrastive learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]为解决上述技术问题,本发明提供了基于自编码器和对比学习的空间转录组数据反卷积方法,解决了现有技术降低了细胞类型比例预测精度的问题
[0031]有益效果:本发明在训练模型时在对抗学习的基础上引入对比学习,对比学习通过基于空间邻近关系区分正负样本对,增强了模型捕捉和利用空间关系的能力,能够增强隐藏层嵌入中心位点与空间位点真实距离的相似性,从而有效地引入空间信息,显著提高对空间点间关系的捕捉能力,进而提高了训练之后的模型的细胞类型比例的预测精度。
Smart Images

Figure CN122575492A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spatial transcriptome analysis technology, specifically to a method for deconvolution of spatial transcriptome data based on autoencoders and contrastive learning. Background Technology
[0002] Spatial transcriptome data reveals the spatial distribution of gene expression in tissues. Analysis of spatial transcriptome data can determine cell types and their proportions. Current techniques employ deconvolution methods to analyze spatial transcriptome data and obtain cell type proportions. Deconvolution methods include deep learning-based deconvolution, such as DeepST, CellDART, and GraphST. DeepST is a deep learning framework, CellDART is a domain-adversarial classification model used for cell type classification in spatial transcriptomes, and GraphST aims to infer cell locations within spatial transcriptome data. However, these deep learning-based deconvolution methods have limitations in utilizing the spatial information of spatial transcriptome data, leading to reduced accuracy in predicting cell type proportions.
[0003] Therefore, existing technologies still need to be improved and enhanced. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a spatial transcriptome data deconvolution method based on autoencoders and contrastive learning, which solves the problem of reduced accuracy in cell type ratio prediction in existing technologies.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a spatial transcriptome data deconvolution method based on autoencoders and contrastive learning, wherein:
[0007] Acquire real spatial transcriptome data, and generate simulated spatial transcriptome data based on the real spatial transcriptome data;
[0008] A deconvolution model is applied to the simulated spatial transcriptome data to obtain cell type prediction ratio labels. Based on the cell type prediction ratio labels and the cell type true ratio labels corresponding to the simulated spatial transcriptome data, a prediction loss is obtained.
[0009] Based on the simulated spatial transcriptome data, positive and negative sample pairs are constructed, and the deconvolution model is subjected to comparative learning based on the positive and negative sample pairs to obtain the comparative loss.
[0010] Based on the simulated spatial transcriptome data and the real spatial transcriptome data, adversarial learning is performed on the deconvolution model to obtain adversarial loss.
[0011] The deconvolution model is trained based on the prediction loss, the adversarial loss, and the contrastive loss.
[0012] In one implementation, generating simulated spatial transcriptome data based on the real spatial transcriptome data includes:
[0013] Single-cell transcriptome data is acquired, and the single-cell transcriptome data is aggregated and assigned spatial coordinates to obtain simulated data;
[0014] The real spatial transcriptome data and the simulated data are integrated by normalization to obtain p-values, and differentially expressed genes with p-values less than or equal to a set value are screened out in the simulated data to obtain preprocessed simulated data.
[0015] The preprocessed simulated data and the real spatial transcriptome data are aligned to obtain simulated spatial transcriptome data.
[0016] In one implementation, constructing positive and negative sample pairs based on the simulated spatial transcriptome data includes:
[0017] The central locus and several other loci besides the central locus were determined in the simulated spatial transcriptome data.
[0018] Other sites whose distance from the central site is within a set range are designated as negative sample sites.
[0019] Other sites whose distance from the center site is greater than the maximum value within the set range are designated as positive sample sites, and the negative sample sites and the positive sample sites are designated as positive-negative sample pairs.
[0020] In one implementation, the contrast loss is the sum of the positive loss and the negative loss.
[0021] In one implementation, the deconvolution model includes an encoder and a prediction module connected in sequence. The prediction module is used to predict the proportion of cell types based on the features extracted by the encoder. The prediction module includes a first linear transformation layer, a ReLU dropout layer, a second linear transformation layer, and a normalization layer connected in sequence. The first linear transformation layer is used to input the features into the prediction module.
[0022] In one implementation, the adversarial loss is the maximum mean difference loss function, and the prediction loss is the binary cross-entropy loss.
[0023] In one implementation, the cell types include astrocytes, neurons, oligodendrocytes, vascular cells, immune cells, and ependymal cells.
[0024] Secondly, embodiments of the present invention also provide a spatial transcriptome data deconvolution device based on autoencoders and contrastive learning, wherein the device comprises the following components:
[0025] The prediction loss calculation module is used to acquire real spatial transcriptome data, generate simulated spatial transcriptome data based on the real spatial transcriptome data, apply a deconvolution model to the simulated spatial transcriptome data to obtain cell type prediction ratio labels, and obtain prediction loss based on the cell type prediction ratio labels and the cell type real ratio labels corresponding to the simulated spatial transcriptome data.
[0026] The contrastive loss calculation module is used to construct positive and negative sample pairs based on the simulated spatial transcriptome data, and to perform contrastive learning on the deconvolution model based on the positive and negative sample pairs to obtain the contrastive loss;
[0027] The adversarial loss calculation module is used to perform adversarial learning on the deconvolution model based on the simulated spatial transcriptome data and the real spatial transcriptome data to obtain the adversarial loss.
[0028] The training module is used to train the deconvolution model based on the prediction loss, the adversarial loss, and the contrastive loss.
[0029] Thirdly, embodiments of the present invention also provide a terminal device, wherein the terminal device includes a memory, a processor, and a spatial transcriptome data deconvolution program based on autoencoder and contrastive learning stored in the memory and executable on the processor. When the processor executes the spatial transcriptome data deconvolution program based on autoencoder and contrastive learning, it implements the steps of the spatial transcriptome data deconvolution method based on autoencoder and contrastive learning described above.
[0030] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a spatial transcriptome data deconvolution program based on an autoencoder and contrastive learning. When the spatial transcriptome data deconvolution program based on an autoencoder and contrastive learning is executed by a processor, it implements the steps of the aforementioned spatial transcriptome data deconvolution method based on an autoencoder and contrastive learning.
[0031] Beneficial effects: This invention introduces contrastive learning on the basis of adversarial learning when training the model. Contrastive learning enhances the model's ability to capture and utilize spatial relationships by distinguishing positive and negative sample pairs based on spatial proximity. It can enhance the similarity between the embedding center site of the hidden layer and the true distance of the spatial site, thereby effectively introducing spatial information, significantly improving the ability to capture the relationship between spatial points, and thus improving the prediction accuracy of the cell type ratio of the trained model. Attached Figure Description
[0032] Figure 1 This is an overall flowchart of the present invention;
[0033] Figure 2 This is a diagram of the ST-deconv structure in an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of contrastive learning ring sampling in an embodiment of the present invention;
[0035] Figure 4 This is a schematic diagram of the performance of ST-deconv in an embodiment of the present invention;
[0036] Figure 5 This is a comparative diagram of spatial transcriptome data deconvolution methods in embodiments of the present invention;
[0037] Figure 6 The RecGOBD model framework in this embodiment of the invention.
[0038] Figure 7 The structural diagram of the spatial transcriptome data deconvolution device based on autoencoder and contrastive learning provided by the present invention;
[0039] Figure 8 This is a block diagram illustrating the internal structure of a terminal device provided in an embodiment of the present invention. Detailed Implementation
[0040] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments and accompanying drawings. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0041] Studies have found that spatial transcriptome data reveals the spatial distribution of gene expression in tissues. Analysis of spatial transcriptome data can determine cell types and their proportions. Current techniques employ deconvolution methods to analyze spatial transcriptome data and obtain cell type proportions. Deconvolution methods include deep learning-based deconvolution, such as DeepST, CellDART, and GraphST. DeepST is a deep learning framework, CellDART is a domain-adversarial classification model used for cell type classification in spatial transcriptomes, and GraphST aims to infer cell locations within spatial transcriptome data. However, these deep learning-based deconvolution methods have limitations in utilizing the spatial information of spatial transcriptome data, leading to reduced accuracy in predicting cell type proportions.
[0042] To address the aforementioned technical problems, this invention provides a spatial transcriptome data deconvolution method based on autoencoders and contrastive learning, which solves the problem of reduced accuracy in cell type ratio prediction in existing technologies.
[0043] The spatial transcriptome data deconvolution method based on autoencoders and contrastive learning in this embodiment can be applied to terminal devices, which can be terminal products with data processing capabilities, such as computers. In this embodiment, as... Figure 1 As shown, the spatial transcriptome data deconvolution method based on autoencoders and contrastive learning specifically includes the following steps:
[0044] S100: Obtain real spatial transcriptome data, generate simulated spatial transcriptome data based on the real spatial transcriptome data; apply a deconvolution model to the simulated spatial transcriptome data to obtain cell type prediction ratio labels, and obtain prediction loss based on the cell type prediction ratio labels and the cell type real ratio labels corresponding to the simulated spatial transcriptome data.
[0045] S200, Based on the simulated spatial transcriptome data, construct positive and negative sample pairs, and perform comparative learning on the deconvolution model based on the positive and negative sample pairs to obtain the comparative loss;
[0046] S300, Based on the simulated spatial transcriptome data and the real spatial transcriptome data, adversarial learning is performed on the deconvolution model to obtain adversarial loss;
[0047] S400, the deconvolution model is trained based on the prediction loss, the adversarial loss, and the contrastive loss.
[0048] The deconvolution model for steps S100, S200, S300, and S400 is as follows: Figure 2 The deconvolution model of spatial transcriptome data shown is based on spatial information and domain adversarial networks (ST-deconv).
[0049] Predicting loss Figure 2 L1 loss in the simulation of spatial transcriptome data input to Figure 2 In Figure b, the encoder outputs the predicted low-dimensional hidden layer expression (the low-dimensional hidden layer expression is the feature of the simulated spatial transcriptome data). This feature is then input into the prediction module, which outputs the predicted cell type proportion label (i.e., the predicted cell type proportion label). The predicted cell type proportion label is compared with the actual cell type proportion label corresponding to the simulated spatial transcriptome data to obtain the prediction loss L1 loss.
[0050] Adversarial loss refers to Domain-Adversarial Networks (DANs). Figure 2 The BCE loss is calculated by the neighborhood classifier (domain classifier) in graph c. In this embodiment, the adversarial loss is the maximum mean difference loss function (the maximum mean difference loss function is...). Figure 2 (MMDloss in Figure b). Simulated spatial transcriptome data and real spatial transcriptome data are input into... Figure 2 In graph b, the encoder outputs the predicted low-dimensional hidden layer representation, which is then input into the... Figure 2 The neighborhood classifier, domainclassify, shown in Figure c, outputs a predicted proportional label. The maximum mean difference between this predicted proportional label and the true label of the simulated spatial transcriptome data and the true label of the real spatial transcriptome data is calculated to obtain the MMDloss.
[0051] Comparative loss is Figure 2 The CLloss in the code takes positive and negative sample pairs as input. Figure 2 In Figure b, the encoder outputs the predicted low-dimensional hidden layer representation, and the contrastive loss (CLloss) is calculated based on the predicted low-dimensional hidden layer representation.
[0052] The prediction loss L1loss, the contrastive loss CLloss, and the adversarial loss MMDloss are added together to obtain the total loss. The deconvolution model ST-deconv is then backpropagated based on the total loss to complete the training of the deconvolution model ST-deconv.
[0053] After training is complete, when it is necessary to predict the proportion of cell types in a specific human or animal body, spatial transcriptome data and single-cell transcriptome data of that human or animal body are collected, and the spatial transcriptome data and single-cell transcriptome data are then applied. Figure 2 The preprocessing method shown in Figure a combines spatial transcriptome data and single-cell transcriptome data, performs t-tests and alignment processing to obtain simulated spatial transcriptome data, and then inputs the simulated spatial transcriptome data into... Figure 2 The encoder shown in diagram d (the encoder in diagram d and the encoder in diagram b are the same encoder) outputs the result of the encoder and then inputs it into the prediction module. The prediction module outputs the cell type ratio of the human or animal body, which is the proportion of each type of cell.
[0054] Example 1: This example provides a training method as follows:
[0055] In this embodiment, the generation of simulated spatial transcriptome data based on the real spatial transcriptome data during the training process includes: acquiring single-cell transcriptome data; performing aggregation processing and assigning spatial coordinates to the single-cell transcriptome data to obtain simulated data; integrating the real spatial transcriptome data and the simulated data through normalization to obtain p-values, and screening out differentially expressed genes in the simulated data whose p-values are less than or equal to a set value to obtain preprocessed simulated data (that is, the p-values of differentially expressed genes in the preprocessed simulated data are less than or equal to the set value); aligning the preprocessed simulated data and the real spatial transcriptome data to obtain simulated spatial transcriptome data (that is, the aligned simulated data becomes simulated spatial transcriptome data).
[0056] In other words, single-cell transcriptome data are randomly selected as samples, aggregated, and then assigned spatial coordinates to obtain simulated data. This assignment process involves assigning spatial coordinates to the single-cell transcriptome data to compensate for the lack of spatial location information. These spatial coordinates are generated using k-means. The simulated data and real spatial transcriptome data are then integrated using normalization, and differentially expressed genes are extracted using the union of gene lists. Finally, a t-test is used to screen for key genes with p-values less than 0.005 (0.005 being the set value), resulting in simulated spatial transcriptome data with similar gene expression characteristics at spatial loci. This simulated spatial transcriptome data provides a foundation for domain adversarial learning, effectively enhancing the model's applicability in various biological contexts and supporting more accurate spatial transcriptome deconvolution and cell type classification.
[0057] In this embodiment, the encoder structure is as follows: Figure 2 As shown in Figure b, it includes a linear transformation layer (linear), a ReLU dropout layer, another linear transformation layer (linear), a ReLU dropout layer, and an output layer for obtaining the hidden layer vector, all connected in sequence.
[0058] This encoder effectively represents gene expression information in spatial transcriptome data by combining gene expression data at each spatial location with its corresponding two-dimensional spatial coordinates to generate a high-dimensional embedding vector. Through layer-by-layer dimensionality reduction, the encoder removes redundant features while preserving key information (i.e., the hidden layer expression output by the encoder, which contains a low-dimensional expression of more comprehensive input data information), providing a simplified and efficient representation for subsequent learning processes.
[0059] In this embodiment, constructing positive and negative sample pairs based on the simulated spatial transcriptome data includes: determining the central locus and several other loci besides the central locus included in the simulated spatial transcriptome data; designating the other loci whose distance from the central locus is within a set range as negative sample loci; designating the other loci whose distance from the central locus is greater than the maximum value within the set range as positive sample loci, and designating the negative sample loci and the positive sample loci as positive and negative sample pairs.
[0060] like Figure 3 As shown, mouse olfactory bulb (MOB) data is used to define a range based on the size of the central locus, and the radius of the positive sample locus is established accordingly. Data within a range of 2 to 3 loci from the central locus are excluded from the sampling process, while the range of 3 to 5 loci is defined as the range of negative sample loci. In other words, the drop zone within a range of 2 to 3 loci from the central locus is excluded from the sampling process; that is, the drop zone is neither a positive nor a negative sample. The above-mentioned range is 3 to 5 loci from the central locus, with a maximum value of 5 loci within the range.
[0061] This embodiment calculates the positive loss (+) and negative loss (-) of contrastive learning using positive and negative sample pairs. The final contrastive loss CLloss = loss (+) + loss (-).
[0062] Figure 4 This is the ST-deconv performance of mouse olfactory bulb (MOB) simulated spatial transcriptome data generated by CARD. Five-fold cross-validation was performed based on spatial transcriptome data with different levels of spatial correlation to assess model stability. The rightmost (i.e., Figure 4 The box plot of the DataID Group visually illustrates the impact of spatial information correlation on the average RMSE value.
[0063] Based on a contrastive learning strategy, the spatial information representation of the embedding is optimized. Contrastive learning constructs positive and negative sample pairs to shorten the embedding distance between adjacent points in space while widening the embedding distance between non-adjacent points, thereby better capturing the relationships between spatial points. The concentric circle sampling strategy in this embodiment dynamically defines positive and negative sample pairs, further enhancing the model's sensitivity to spatial contextual information.
[0064] In this embodiment, through adversarial training, the domain adversarial network aligns the simulated data with the real spatial transcriptome data distribution, reducing the embedding differences between the simulated and real data. This embodiment also introduces the maximum mean difference (MMD) loss function to quantify and optimize the similarity between different data distributions. Combined with domain adversarial techniques, the model's generalization ability in real-world deconvolution tasks is significantly improved.
[0065] In this embodiment, during model training, the prediction module performs dimensionality reduction on the encoder output data through a linear transformation and introduces non-linear characteristics using the Leaky ReLU activation function, thereby enhancing its ability to express complex features. Subsequently, Dropout is used to mitigate the risk of overfitting and improve the model's robustness. In the final output stage, the embedding representation undergoes feature transformation through another linear layer, and a softmax function is used to generate the probability distribution of cell types, thus predicting the proportion of cell types. Furthermore, to optimize the performance of the prediction module, the model employs the Adam optimizer to jointly train the parameters of the encoder and prediction modules, effectively improving the model's prediction accuracy.
[0066] The following experiments verify the effectiveness of this invention:
[0067] Simulated spatial transcriptome data was preprocessed and combined with single-cell transcriptome data to simulate spatial transcriptome data. K-means was used to add coordinate information to the spatial transcriptome data to obtain a training set. This training set was then fed into the model, and comparative learning was used to extract the relationships between spatial points. A domain adversarial network was used to improve the generalization ability with real data, training a highly generalizable feature extraction model. Subsequently, a prediction model was trained using cell type ratio labels of spatial transcriptome sites from the simulated spatial transcriptome data to achieve accurate prediction of cell type ratios. Under the condition of dividing the CARD simulated data into training and test sets in an 8:2 ratio, as shown... Figure 5 As shown, experimental results compared to other methods confirm that ST-deconv (the present invention) has better deconvolution performance.
[0068] Figure 6 The results are based on analysis of real and CARD simulated spatial transcriptome data, among which... Figure 6 Figure a in the text shows the distribution of cell types after deconvolution in the MOB spatial transcriptome data, reflecting the hierarchical structure and sample-specific patterns. Figure 6 Figure b in the figure shows the spatial distribution of selected cell types (EPL.IN, GC, M.TC, OSNs, PGC) in the MOB data, highlighting the spatial relationships derived from deconvolution; Figure 6Figure c in the figure shows the assessment of deconvolution accuracy in MOB spatial transcriptome data using the Adjusted Rand Index (ARI) and Purity metrics, with sample layer labels as a reference. Figure 6 The d-plot in the image illustrates the cell type differentiation in the CARD simulation data: showing the percentage distribution of a specific cell type for the DataID 04 data; Figure 6 The e-plot in the image provides a detailed comparison of GC and PGC cell types, i.e., a focused schematic diagram comparing GC and PGC cell types in real MOB data to demonstrate their distinguishing characteristics. Figure 6 The 'e' plot in the MOB dataset is a cell type correlation plot, which shows the spatial correlation between various cell types in the MOB dataset. Figure 6 The g-plot in the figure shows significant hierarchical differentiation in CARD-simulated MOB spatial transcriptome data; Figure 6 The h-plot in the figure shows the spatial distribution of specific cell types (astrocytes, neurons, oligodendrocytes, vascular cells, immune cells, and ependymal cells) in the CARD simulated MOB data, reflecting the spatial relationships derived from deconvolution. Figure 6 The i-th graph in the figure shows the reference sample layer labels and the deconvolution performance of DataID 04 evaluated using ARI and Purity metrics; Figure 6 The j-plot in the image is a sample plot corresponding to the simulated data of DataID 04, highlighting the correlation between cell types.
[0069] like Figure 6 As shown in Figure d, this is a point map of the deconvolution of the simulated data DataID 04 using CARD. Figure 6 As shown in Figure b, on real spatial transcriptome data using cell type ratio labels without spatial transcriptome loci, the deconvolutioned locus map exhibits a similar hierarchical structure to real spatial transcriptome specimen photographs. Figure 6 As shown in Figures c and i, the ARI and Purity indices after clustering the results of deconvolution also show a good trend.
[0070] In summary, this invention effectively characterizes gene expression in spatial transcriptome data through an encoder structure, extracts its embedding information, uses a contrastive learning strategy to capture the interrelationships between embedded spatial locations, and finally improves the generalization ability with real data through a domain adversarial network, thus constructing a highly generalizable feature extraction model.
[0071] This embodiment also provides a spatial transcriptome data deconvolution device based on autoencoders and contrastive learning, such as... Figure 7 As shown, the device comprises the following components:
[0072] The prediction loss calculation module 01 is used to acquire real spatial transcriptome data, generate simulated spatial transcriptome data based on the real spatial transcriptome data, apply a deconvolution model to the simulated spatial transcriptome data to obtain cell type prediction ratio labels, and obtain prediction loss based on the cell type prediction ratio labels and the cell type real ratio labels corresponding to the simulated spatial transcriptome data.
[0073] The contrast loss calculation module 02 is used to construct positive and negative sample pairs based on the simulated spatial transcriptome data, and to perform contrast learning on the deconvolution model based on the positive and negative sample pairs to obtain the contrast loss;
[0074] The adversarial loss calculation module 03 is used to perform adversarial learning on the deconvolution model based on the simulated spatial transcriptome data and the real spatial transcriptome data to obtain the adversarial loss.
[0075] Training module 04 is used to train the deconvolution model based on the prediction loss, the adversarial loss, and the contrastive loss.
[0076] Based on the above embodiments, the present invention also provides a terminal device, the principle block diagram of which can be as follows: Figure 8 As shown, the terminal device includes a processor, memory, network interface, and display screen connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a spatial transcriptome data deconvolution method based on autoencoders and contrastive learning. The display screen can be a liquid crystal display (LCD) or an e-ink display.
[0077] Those skilled in the art will understand that Figure 8 The schematic diagram shown is only a partial structural diagram related to the present invention and does not constitute a limitation on the terminal device to which the present invention is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0078] In one embodiment, a terminal device is provided, comprising a memory, a processor, and a spatial transcriptome data deconvolution program based on autoencoder and contrastive learning stored in the memory and executable on the processor. When the processor executes the spatial transcriptome data deconvolution program based on autoencoder and contrastive learning, it implements the following operation instructions:
[0079] Acquire real spatial transcriptome data, generate simulated spatial transcriptome data based on the real spatial transcriptome data; apply a deconvolution model to the simulated spatial transcriptome data to obtain cell type prediction ratio labels, and obtain prediction loss based on the cell type prediction ratio labels and the cell type real ratio labels corresponding to the simulated spatial transcriptome data;
[0080] Based on the simulated spatial transcriptome data, positive and negative sample pairs are constructed, and the deconvolution model is subjected to comparative learning based on the positive and negative sample pairs to obtain the comparative loss.
[0081] Based on the simulated spatial transcriptome data and the real spatial transcriptome data, adversarial learning is performed on the deconvolution model to obtain adversarial loss.
[0082] The deconvolution model is trained based on the prediction loss, the adversarial loss, and the contrastive loss.
[0083] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A spatial transcriptome data deconvolution method based on autoencoders and contrastive learning, characterized in that, include: Acquire real spatial transcriptome data, and generate simulated spatial transcriptome data based on the real spatial transcriptome data; A deconvolution model is applied to the simulated spatial transcriptome data to obtain cell type prediction ratio labels. Based on the cell type prediction ratio labels and the cell type true ratio labels corresponding to the simulated spatial transcriptome data, a prediction loss is obtained. Based on the simulated spatial transcriptome data, positive and negative sample pairs are constructed, and the deconvolution model is subjected to comparative learning based on the positive and negative sample pairs to obtain the comparative loss. Based on the simulated spatial transcriptome data and the real spatial transcriptome data, adversarial learning is performed on the deconvolution model to obtain adversarial loss. The deconvolution model is trained based on the prediction loss, the adversarial loss, and the contrastive loss.
2. The spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in claim 1, characterized in that, Based on the real spatial transcriptome data, simulated spatial transcriptome data is generated, including: Single-cell transcriptome data is acquired, and the single-cell transcriptome data is aggregated and assigned spatial coordinates to obtain simulated data; The real spatial transcriptome data and the simulated data are integrated by normalization to obtain p-values, and differentially expressed genes with p-values less than or equal to a set value are screened out in the simulated data to obtain preprocessed simulated data. The preprocessed simulated data and the real spatial transcriptome data are aligned to obtain simulated spatial transcriptome data.
3. The spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in claim 1, characterized in that, Based on the simulated spatial transcriptome data, positive and negative sample pairs are constructed, including: The central locus and several other loci besides the central locus were determined in the simulated spatial transcriptome data. Other sites whose distance from the central site is within a set range are designated as negative sample sites. Other sites whose distance from the center site is greater than the maximum value within the set range are designated as positive sample sites, and the negative sample sites and the positive sample sites are designated as positive-negative sample pairs.
4. The spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in claim 1, characterized in that, The comparative loss is the sum of the positive loss and the negative loss.
5. The spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in any one of claims 1-4, characterized in that, The deconvolutional model includes an encoder and a prediction module connected in sequence. The prediction module is used to predict the proportion of cell types based on the features extracted by the encoder. The prediction module includes a first linear transformation layer, a ReLU dropout layer, a second linear transformation layer, and a normalization layer connected in sequence. The first linear transformation layer is used to input the features into the prediction module.
6. The spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in claim 1, characterized in that, The adversarial loss is the maximum mean difference loss function, and the prediction loss is the binary cross-entropy loss.
7. The spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in claim 1, characterized in that, Cell types include astrocytes, neurons, oligodendrocytes, vascular cells, immune cells, and ependymal cells.
8. A spatial transcriptome data deconvolution device based on autoencoders and contrastive learning, characterized in that, The device comprises the following components: The prediction loss calculation module is used to acquire real spatial transcriptome data, generate simulated spatial transcriptome data based on the real spatial transcriptome data, apply a deconvolution model to the simulated spatial transcriptome data to obtain cell type prediction ratio labels, and obtain prediction loss based on the cell type prediction ratio labels and the cell type real ratio labels corresponding to the simulated spatial transcriptome data. The contrastive loss calculation module is used to construct positive and negative sample pairs based on the simulated spatial transcriptome data, and to perform contrastive learning on the deconvolution model based on the positive and negative sample pairs to obtain the contrastive loss; The adversarial loss calculation module is used to perform adversarial learning on the deconvolution model based on the simulated spatial transcriptome data and the real spatial transcriptome data to obtain the adversarial loss. The training module is used to train the deconvolution model based on the prediction loss, the adversarial loss, and the contrastive loss.
9. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a spatial transcriptome data deconvolution program based on autoencoder and contrastive learning stored in the memory and executable on the processor. When the processor executes the spatial transcriptome data deconvolution program based on autoencoder and contrastive learning, it implements the steps of the spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a spatial transcriptome data deconvolution program based on autoencoder and contrastive learning, which, when executed by a processor, implements the steps of the spatial transcriptome data deconvolution method based on autoencoder and contrastive learning as described in any one of claims 1-7.