Cell characterization model pre-training method, cell downstream task processing method, equipment, storage medium and program product
By using characteristic genes and gene pathways in cell characterization models, and adjusting the model to reduce noise and improve signal-to-noise ratio, the problem of high noise information in the prior art is solved, and more accurate cell characterization is achieved.
Patent Information
- Application Number
- CN202411742754.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-29
AI Technical Summary
In the prior art, the cell characterization information output by the pre-trained model is relatively noise, and the accuracy of cell characterization has not yet reached room for improvement.
By determining multiple characteristic genes and gene pathways in the cell sample set, the cell characterization model to be trained is used to determine the cell encoding information based on the first characteristic gene sequence and gene pathway, and the model is adjusted differently until the training end condition is met, and the pre-trained cell characterization model is obtained.
The noise content in the generated cell-encoded information is reduced, the signal-to-noise ratio is improved, the cell-encoded information is differentiated by the cell, the cell-encoded information is effectively optimized, and the accuracy of cell-encoded information is improved.
Smart Images

Figure CN119832987A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of biotechnology, and in particular to a cell characterization model pre-training method, a cell downstream task processing method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] In fields such as biology and medicine, the accuracy of cell characterization information is crucial to improving the performance of a variety of cell-related downstream tasks. In the practice of cell characterization, ribonucleic acid (RNA) can be extracted from cell or tissue samples, and then combined with omics sequencing technology to determine the expression level of specific genes, so as to characterize cells using gene expression. However, the expression data obtained by this method is highly dependent on the experimental method, and the data is noisy, which brings many challenges to subsequent analysis.
[0003] With the rise of artificial intelligence models, model-based and artificial intelligence-driven scientific research is becoming a hot topic. The feature vectors generated by the pre-trained model, with their excellent resolution and representation capabilities, provide more detailed distinction and description for cells. The pre-trained model provides high-quality cell feature vectors, which effectively improves the performance of various downstream tasks related to cells.
[0004] However, the inventors have found in practice that the cell representation information output by the pre-trained model in the related art has a high noise content, and the accuracy of cell representation still has room for improvement. Summary of the invention
[0005] Based on this, it is necessary to provide a cell characterization model pre-training method, a cell downstream task processing method, device, computer equipment, computer-readable storage medium and computer program product to address the above-mentioned technical problems.
[0006] In a first aspect, the present application provides a cell representation model pre-training method, comprising:
[0007] Determine a plurality of characteristic genes of a cell sample set, and obtain a first characteristic gene sequence corresponding to each of a plurality of sample cells in the cell sample set;
[0008] According to the matching of the plurality of characteristic genes, a plurality of gene pathways for realizing different biological functions are obtained; each of the gene pathways includes each characteristic gene involved in realizing the biological function corresponding to the gene pathway;
[0009] The cell representation model to be trained determines the cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways, and predicts the second characteristic gene sequence corresponding to each of the sample cells according to the cell coding information;
[0010] According to the difference between the second characteristic gene sequence and the first characteristic gene sequence corresponding to the sample cell, the cell representation model is adjusted until a training end condition is met to obtain a pre-trained cell representation model.
[0011] In one embodiment, the gene pathway is obtained by the following steps:
[0012] Inputting the plurality of characteristic genes into a plurality of pathway construction networks; the plurality of pathway construction networks respectively correspond to different pathway construction rules, and the different pathway construction rules characterize the realization process of the biological function based on different dimensions;
[0013] Each of the pathway construction networks determines, according to the corresponding pathway construction rules, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions, and outputs a corresponding undirected graph according to the plurality of characteristic genes that realize the same biological function;
[0014] According to each of the output undirected graphs, each gene pathway of the plurality of characteristic genes is obtained.
[0015] In one embodiment, the determining, by each of the pathway construction networks according to the corresponding pathway construction rules, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions comprises:
[0016] If the plurality of pathway construction networks include a first pathway construction network, the first pathway construction network determines, according to pathway construction rules associated with gene ontology, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions;
[0017] If the plurality of pathway construction networks include a second pathway construction network, the second pathway construction network determines, according to pathway construction rules related to cell biological processes, a plurality of characteristic genes among the plurality of characteristic genes that implement associated biological functions;
[0018] If the multiple pathway construction networks include a third pathway construction network, the third pathway construction network determines, according to immunity-related pathway construction rules, multiple characteristic genes among the multiple characteristic genes that realize associated biological functions;
[0019] If the multiple pathway construction networks include a fourth pathway construction network, the fourth pathway construction network determines multiple characteristic genes that realize associated biological functions among the multiple characteristic genes according to pathway construction rules related to cell transcription.
[0020] In one embodiment, the cell characterization model to be trained determines the cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways, including:
[0021] A first matrix is constructed according to first characteristic gene sequences corresponding to each of the plurality of sample cells and the gene expression level of each characteristic gene in each of the first characteristic gene sequences obtained in advance; each row in the first matrix corresponds to one of the sample cells, each column corresponds to one of the characteristic genes, and each matrix element represents the gene expression level of the characteristic gene of the sample cell;
[0022] Constructing a second matrix according to each of the gene pathways; each row in the second matrix corresponds to one of the characteristic genes, each column corresponds to one of the gene pathways, and each matrix element represents whether the characteristic gene is included in the gene pathway;
[0023] The cell representation model to be trained performs feature extraction on the product of the first matrix and the second matrix, and obtains the cell encoding information corresponding to each of the sample cells according to the feature extraction result.
[0024] In one embodiment, the second matrix includes multiple genes pathways in the same second matrix are constructed based on the same pathway construction rules, and genes pathways in different second matrices correspond to different pathway construction rules;
[0025] The step of extracting features from the product of the first matrix and the second matrix by the cell representation model to be trained comprises:
[0026] Obtaining the product of the first matrix and each of the second matrices from the cell representation model to be trained to obtain a plurality of third matrices;
[0027] The plurality of feature extraction modules in the cell representation model perform feature extraction on each of the third matrices according to the self-attention mechanism to obtain respective sub-feature extraction results of the plurality of feature extraction modules; the plurality of feature extraction modules are respectively used to perform feature extraction on the third matrices constructed based on different pathway construction rules;
[0028] A feature extraction result is obtained according to the fusion result of each of the sub-feature extraction results.
[0029] In one embodiment, the cell characterization model to be trained determines the cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways, including:
[0030] Masking some of the characteristic genes in each of the first characteristic gene sequences to obtain a corresponding characteristic gene mask sequence, and determining the cell coding information corresponding to each of the sample cells by the cell representation model to be trained according to each of the characteristic gene mask sequences and each of the gene pathways;
[0031] The predicting the second characteristic gene sequence corresponding to each of the sample cells according to the cell coding information includes:
[0032] A characteristic gene prediction is performed on the masked part in each characteristic gene mask sequence according to the cell encoding information, and a second characteristic gene sequence corresponding to each sample cell is obtained according to the prediction result.
[0033] In a second aspect, the present application also provides a method for processing downstream cell tasks, the method comprising:
[0034] Determine downstream tasks for target cells, obtain characteristic genes corresponding to the target cells, and determine characteristic gene sequences and multiple gene pathways corresponding to the target cells according to the characteristic genes corresponding to the target cells;
[0035] The target cell encoding information of the target cell is obtained by a pre-trained cell characterization model according to the characteristic gene sequence and multiple gene pathways corresponding to the target cell; the cell characterization model is trained based on any of the cell characterization model pre-training methods described above;
[0036] The downstream tasks for the target cells are processed based on the target cell encoding information.
[0037] In a third aspect, the present application also provides a cell characterization model pre-training device, comprising:
[0038] A first sequence acquisition module, used to determine a plurality of characteristic genes of a cell sample set, and to acquire first characteristic gene sequences corresponding to each of a plurality of sample cells in the cell sample set;
[0039] A gene pathway matching module, used to obtain multiple gene pathways for realizing different biological functions according to the matching of the multiple characteristic genes; each of the gene pathways includes various characteristic genes involved in realizing the biological function corresponding to the gene pathway;
[0040] a characterization module, configured to determine, by a cell characterization model to be trained, cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways, and predict a second characteristic gene sequence corresponding to each of the sample cells according to the cell coding information;
[0041] The model adjustment module is used to adjust the cell characterization model according to the difference between the second characteristic gene sequence and the first characteristic gene sequence corresponding to the sample cell until the training end condition is met to obtain a pre-trained cell characterization model.
[0042] In a fourth aspect, the present application further provides a cell downstream task processing device, the device comprising:
[0043] A task determination module is used to determine downstream tasks for target cells, obtain characteristic genes corresponding to the target cells, and determine characteristic gene sequences and multiple gene pathways corresponding to the target cells according to the characteristic genes corresponding to the target cells;
[0044] A target coding information acquisition module, used to obtain target cell coding information of the target cell according to the characteristic gene sequence and multiple gene pathways corresponding to the target cell by a pre-trained cell characterization model; the cell characterization model is trained based on any of the cell characterization model pre-training methods described above;
[0045] A task processing module is used to process the downstream task for the target cells based on the target cell encoding information.
[0046] In a fifth aspect, the present application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the cell characterization model pre-training method or the steps of the cell downstream task processing method described in any one of the above items.
[0047] In a sixth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned cell characterization model pre-training methods or the steps of the above-mentioned cell downstream task processing methods.
[0048] In a seventh aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned cell characterization model pre-training methods or the steps of the above-mentioned cell downstream task processing methods.
[0049] The above-mentioned cell characterization model pre-training method, cell downstream task processing method, device, computer equipment, computer-readable storage medium and computer program product can determine multiple characteristic genes of a cell sample set, and obtain the first characteristic gene sequence corresponding to each of the multiple sample cells in the cell sample set; then, multiple gene pathways for realizing different biological functions are obtained according to the matching of the multiple characteristic genes, wherein each gene pathway includes each characteristic gene involved in realizing the biological function corresponding to the gene pathway; then, the cell characterization model to be trained can determine the cell coding information corresponding to each sample cell according to each first characteristic gene sequence and each gene pathway, and predict the second characteristic gene sequence corresponding to each sample cell according to the cell coding information; according to the difference between the second characteristic gene sequence corresponding to the sample cell and the first characteristic gene sequence, the cell characterization model is adjusted until the training end condition is met to obtain the pre-trained cell characterization model. In this embodiment, multiple gene pathways for realizing different biological functions are constructed according to multiple characteristic genes, and each first characteristic gene sequence and each gene pathway is input into the cell characterization model to be trained. The cell characterization model determines the cell coding information corresponding to each sample cell according to the input information, and effectively combines the characteristic genes of the cell itself and the gene pathways related to the biological function. This can reduce the noise content in the generated cell coding information and improve the signal-to-noise ratio, increase the discrimination of the cell coding information for cells, effectively optimize the characterization effect of the cell coding information, and improve the accuracy of the cell characterization results. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A schematic diagram of a process of a cell characterization model pre-training method in one embodiment;
[0052] Figure 2 A schematic diagram of a process of another cell characterization model pre-training method in one embodiment;
[0053] Figure 3 A schematic diagram of a cell characterization model in one embodiment;
[0054] Figure 4 is a schematic diagram of a gene pathway in one embodiment;
[0055] Figure 5 A schematic diagram of a process of a cell downstream task processing method in one embodiment;
[0056] Figure 6 A schematic diagram of a process of another method for processing downstream cellular tasks in one embodiment;
[0057] Figure 7 A structural block diagram of a cell characterization model pre-training device in one embodiment;
[0058] Figure 8 It is a structural block diagram of a cell downstream task processing device in one embodiment;
[0059] Fig. 9 is an internal structure diagram of a computer device in one embodiment;
[0060] Fig.10 The figure is a diagram of the internal structure of another computer device in one embodiment. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] In order to enable those skilled in the art to better understand the present application, the relevant technologies are introduced below.
[0063] In fields such as biology and medicine, performance improvements in a variety of downstream cell-related tasks often rely on high-quality cell representation information.
[0064] When characterizing cells, the traditional method is to extract ribonucleic acid (RNA) from cells or tissue samples through biochemical methods, and then use technologies such as real-time fluorescence quantitative polymerase chain reaction (PCR), such as reverse transcription quantitative polymerase chain reaction (RT-qPCR), digital PCR or traditional PCR, such as transcriptomics sequencing technology (RNA sequencing, RNA-Seq) to measure the expression level of specific genes, thereby obtaining cell characterization information. Taking RT-qPCR technology as an example, RT-qPCR technology measures the expression of genes in real time by monitoring the fluorescence signal during the amplification of deoxyribonucleic acid (DNA). This method can provide absolute quantification of gene expression. In addition, by comparing the cycle threshold (Ct value) of the target gene and the reference gene (such as the housekeeping gene), the relative expression of the target gene can be calculated. By combining relevant analysis methods (such as the standard curve method, 2^-ΔΔCt method, etc.), it can help researchers analyze changes in gene expression and thus infer the function and biological significance of the gene. However, the above traditional methods of obtaining gene expression are often limited by experimental conditions and detection sensitivity, are highly dependent on the experimental methods used, have high data noise, and are inconvenient to use.
[0065] With the development of artificial intelligence technology, model-based and artificial intelligence-driven scientific research has become a hot topic at present. It has been widely used in multiple task processing such as cell type classification, gene perturbation prediction, drug sensitivity prediction, drug response prediction, and cell target discovery. For example, graph-based representation methods model cell or gene expression data as a graph structure by constructing a cell network, where nodes represent individual cells or genes and edges represent interactions between cells or genes. Algorithms such as Graph Neural Network (GNN) can learn low-dimensional representations of nodes from graphs. These representations can capture the complex relationships and network structures between cells and help understand the role of cells in biological processes. Among some related technologies, technologies such as Graph Convolution Network (GCN) and Graph Attention Network (GAT) have been used to analyze single-cell RNA sequencing data to identify cell subpopulations and infer cell state transitions. In addition, with the rise of artificial intelligence models, large models that have achieved remarkable results in the field of natural language processing have also been applied to cell data analysis. By pre-training large models, cell feature vectors that can distinguish and characterize cells more finely can be obtained.
[0066] However, the inventors have found in practice that the cell representation information output by the model in the related art has a high noise content and the quality of cell representation still needs to be improved.
[0067] Based on this, it is necessary to provide a cell characterization model pre-training method, a cell downstream task processing method, device, computer equipment, computer-readable storage medium and computer program product to address the above-mentioned technical problems.
[0068] In one embodiment, Figure 1 As shown, a cell characterization model pre-training method is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0069] S101, determining a plurality of characteristic genes of a cell sample set, and obtaining first characteristic gene sequences corresponding to a plurality of sample cells in the cell sample set.
[0070] In practical applications, a cell sample set consisting of cells of a target species may be obtained, wherein the cell sample set includes a plurality of sample cells, each of which may be a single cell, wherein the target species may be any species to be analyzed.
[0071] In one embodiment, a cell sample set may include a large amount of single-cell gene sequencing data of a target species, and the cell sample set includes multiple sample cells, each sample cell has corresponding sequencing data, and the sequencing data can characterize multiple genes possessed by the sample cell corresponding to the sequencing data. The representation characteristics of the data set are related to the cell line itself. Some related technologies use a single data set to train a cell characterization model. However, the data in a single data set often only have the gene expression levels of some genes, and genes that are not expressed will not appear. Therefore, the model migration ability trained on a single data set is poor. In this regard, in some examples of the present application, the number level corresponding to the sample cells in the cell sample set can be above the preset number level, for example, it can reach the tens of millions level. By using a large amount of cell data to perform subsequent pre-training on the cell characterization model, the generalization ability of the model can be increased, which helps to more effectively construct a single-cell characterization method suitable for various situations, and can make the single-cell characterization results more stable. At the same time, the noise contained in the cell characterization results is reduced, and the discrimination of different cell types is improved, which provides a reliable foundation for subsequent cell downstream tasks based on cell characterization, and helps to more efficiently process downstream tasks that require high generalization ability, such as perturbation tasks such as cell perturbation prediction.
[0072] In some exemplary embodiments, the cell sample set can be constructed by selecting non-repetitive cell data from a public data set. For each sample cell provided in the public data set, a sample cell with corresponding raw data can be selected, and the raw data includes the gene expression amount of the sample cell and related metadata. By selecting sample cells with raw data, the integrity of the cell sample set can be improved; then, the raw data corresponding to the sample cell is filled to unify the data dimensions of each sample cell in the cell sample set.
[0073] After obtaining the cell sample set, the characteristic genes in the cell sample set can be determined. Specifically, the gene expression levels of some genes in different cells are relatively stable, that is, the gene expression levels of the same gene in all cells or most cells are the same or similar, these genes are expressed in all cells, and the degree of expression is close to each other. This type of gene is also called a housekeeping gene. The housekeeping gene is not unique and cannot be used to characterize the characteristics of the cell sample; while other genes have significant differences in gene expression levels in different cells. In this step, characteristic genes can be determined. Characteristic genes can be understood as specific genes whose gene expression levels differ in different types of cells. Characterizing cells by determining the characteristic genes of the cell sample set helps to improve the effect of cell characterization and improve the distinction between different cells.
[0074] In one embodiment, multiple characteristic genes of a cell sample set can be determined by the following steps: determining the cell genes possessed by each sample cell in the cell sample set; determining highly variable genes among multiple sample cell genes based on the gene expression level of each cell gene in different sample cells; and obtaining multiple characteristic genes of the cell sample set based on the multiple highly variable genes.
[0075] Among them, the difference in gene expression of highly variable genes in different sample cells is greater than the threshold.
[0076] In a specific implementation, the original data of the cell sample set may contain a large number of genes. For example, in one embodiment, the cell sample set contains 60,664 genes. During the model training process, the genes will be converted into word embeddings (tokens), and the number of word embeddings pre-provided in the model is often much smaller than the number of massive genes. In addition, if a large number of genes are processed at the same time, more noise will be introduced into the cell characterization results, reducing the differentiation of the cell characterization results for different cells.
[0077] In this regard, in some embodiments, such as Figure 2 As shown, highly variable genes in the cell sample set can be screened. The cell specificity of highly variable genes often stems from the functional differences of genes. Highly variable genes are often related to the specific functions of cells, so they are also ideal gene targets. In some examples, the highly variable genes (HVG) algorithm can be used to select highly variable genes in the cell sample set. Then, multiple highly variable genes can be retained as feature genes, for example, a preset number of highly variable genes can be selected as feature genes. Through the screening of highly variable genes, genes with large expression changes in different cells will be retained, while housekeeping genes will be removed. Selecting these highly variable genes as representations helps to improve the effect of cell representation and improve the distinction between different cells.
[0078] After determining the multiple characteristic genes corresponding to the cell sample set, the original data of the sample cells can be filtered. For each sample cell, the characteristic genes can be screened out from the multiple genes corresponding to the sample cell, and then the characteristic gene sequence of the sample cell is constructed based on the multiple characteristic genes screened out. For the convenience of distinction, the characteristic gene sequence is also called the first characteristic gene sequence. The first characteristic gene sequence can include the gene identifiers (gene IDs) and gene expression levels of the multiple characteristic genes.
[0079] S102, obtaining multiple gene pathways for realizing different biological functions according to the matching of multiple characteristic genes; each gene pathway includes various characteristic genes involved in realizing the biological function corresponding to the gene pathway.
[0080] On the other hand, after obtaining multiple characteristic genes of the cell sample set, multiple gene pathways can be matched according to the multiple characteristic genes. For example, multiple characteristic genes can be matched with multiple gene pathways obtained in advance. For each gene pathway obtained in advance, if multiple characteristic genes contain each gene of the gene pathway, it can be determined that the gene pathway is successfully matched. Each gene pathway contains multiple characteristic genes, and at least some characteristic genes in different gene pathways are different. Multiple characteristic genes contained in the same gene pathway can be characteristic genes used to achieve related or identical biological functions. In other words, multiple characteristic genes that can achieve the same or similar biological functions can constitute a gene pathway.
[0081] In this step, by matching the characteristic gene combination with the pre-acquired multiple gene pathways, multiple characteristic gene sets can be obtained, each characteristic gene set corresponds to a matched gene pathway, and multiple characteristic genes in the same characteristic gene set synergistically realize the same or related biological functions. In some exemplary embodiments, the cell representation model is embedded with multiple pre-acquired gene pathways, and by inputting multiple characteristic genes into the cell representation model to be trained, multiple related gene pathways can be matched by the cell representation model.
[0082] S103, the cell representation model to be trained determines the cell coding information corresponding to each sample cell according to each first characteristic gene sequence and each gene pathway, and predicts the second characteristic gene sequence corresponding to each sample cell according to the cell coding information.
[0083] In practical applications, after obtaining the first characteristic gene sequences and multiple gene pathways corresponding to multiple sample cells, the cell characterization model can characterize the single cell according to the combination of the first characteristic gene sequences and gene pathways, thereby obtaining the cell encoding information (cell embedding) corresponding to the sample cells.
[0084] Since gene pathways describe the realization of biological functions, which include the coordination of multiple genes, gene pathways can be used to characterize the collaborative effects between different characteristic genes in sample cells. In addition, cell heterogeneity is often reflected through differences in gene pathway expression. Compared with the method of characterizing cells based only on gene sequences in related technologies, this embodiment further introduces gene pathways for cell characterization based on the first characteristic gene sequence, and can combine different pathway information. While reducing the noise content in traditional input data and improving the signal-to-noise ratio, it can differentiate the sample cells in combination with the biological functions of the sample cells, effectively improving the discrimination of the sample cells by the cell coding information, and assisting in improving the training effect of model pre-training.
[0085] After obtaining the cell coding information, the cell characterization model can re-predict the characteristic gene sequence of the sample cells according to the cell coding information to obtain the corresponding characteristic gene sequence. For the sake of distinction, the characteristic gene sequence output by the cell characterization model is also called the second characteristic gene sequence.
[0086] Specifically, the cell representation model may include an encoder and a decoder; the input information of the cell representation model includes a first characteristic gene sequence, and a plurality of gene pathways acquired in advance may be embedded in the cell representation model. After the input information is input into the cell representation model, the encoder may obtain multiple gene pathways related to the sample based on the input first characteristic gene sequence and the matching results between the characteristic genes in the first characteristic gene sequence and the pre-embedded multiple gene pathways, and then encode the first characteristic gene sequence and the matched multiple gene pathways to obtain the cell encoding information corresponding to each sample cell, and then the decoder decodes the cell encoding information and converts it into a second characteristic gene sequence through a fully connected network. In some exemplary embodiments, the cell representation model may be constructed based on the BERT (Bidirectional Encoder Representation from Transformers) model architecture, such as constructing a cell representation model based on the open source model Geneformer. Figure 3 The structure of a cell representation model is shown, which may include a self-attention layer, layer normalization, and a feed forward network.
[0087] S104, adjusting the cell representation model according to the difference between the second characteristic gene sequence and the first characteristic gene sequence corresponding to the sample cell until the training end condition is met to obtain a pre-trained cell representation model.
[0088] After obtaining the second characteristic gene sequence output by the model, the second characteristic gene sequence can be compared with the first characteristic gene sequence to obtain the difference between the two sequences, and the model loss value can be determined based on the difference. For example, the cross entropy is calculated based on the difference between the second characteristic gene sequence and the first characteristic gene sequence corresponding to the sample cell as the model loss value, and then the model parameters of the cell characterization model are adjusted according to the model loss value to perform parameter optimization. Repeat the above steps until the training end conditions are met, and a pre-trained cell characterization model can be obtained. After the training is completed, a model file corresponding to the cell characterization model can be generated and saved, and the necessary information is saved in the model file.
[0089] In the above-mentioned cell characterization model pre-training method, multiple characteristic genes of a cell sample set can be determined, and the first characteristic gene sequences corresponding to each of the multiple sample cells in the cell sample set can be obtained; then, multiple gene pathways for realizing different biological functions are obtained based on the matching of the multiple characteristic genes, wherein each gene pathway includes each characteristic gene involved in realizing the biological function corresponding to the gene pathway; then, the cell characterization model to be trained can determine the cell coding information corresponding to each sample cell based on each first characteristic gene sequence and each gene pathway, and predict the second characteristic gene sequence corresponding to each sample cell based on the cell coding information; according to the difference between the second characteristic gene sequence corresponding to the sample cell and the first characteristic gene sequence, the cell characterization model is adjusted until the training end condition is met to obtain the pre-trained cell characterization model. In this embodiment, multiple gene pathways for realizing different biological functions are constructed according to multiple characteristic genes, and each first characteristic gene sequence and each gene pathway is input into the cell characterization model to be trained. The cell characterization model determines the cell coding information corresponding to each sample cell according to the input information, and effectively combines the characteristic genes of the cell itself and the gene pathways related to the biological function. This can reduce the noise content in the generated cell coding information and improve the signal-to-noise ratio, increase the discrimination of the cell coding information for cells, effectively optimize the characterization effect of the cell coding information, and improve the accuracy of the cell characterization results.
[0090] In an exemplary embodiment, multiple gene pathways may be obtained in advance through the following steps:
[0091] S201, inputting a plurality of characteristic genes into a plurality of pathway construction networks; the plurality of pathway construction networks respectively correspond to different pathway construction rules, and the different pathway construction rules characterize the realization process of the biological function based on different dimensions.
[0092] In a specific implementation, a gene pathway can be constructed based on a single dimension, or multiple different gene pathways can be constructed based on multiple dimensions. The construction of the gene pathway can be implemented through a pathway construction network. In some exemplary embodiments, the pathway construction network can be a graph attention network (GAN).
[0093] In this embodiment, multiple pathway construction networks can be pre-trained or specified, and the multiple pathway construction networks correspond to different pathway construction rules, respectively. The multiple pathway construction rules can characterize the realization process of biological functions from different dimensions. For example, the pathway construction rules can be set from the dimensions of cell components, molecular functions and biological processes, or from the dimensions of cell signal transduction to metabolic pathways, or from the dimensions of cell immunity or cell transcription. In specific implementation, the pathway construction rules can be set according to actual conditions and the corresponding pathway construction network can be obtained.
[0094] S201, each pathway construction network determines multiple characteristic genes that realize related biological functions among multiple characteristic genes according to corresponding pathway construction rules, and outputs a corresponding undirected graph according to the multiple characteristic genes that realize the same biological function.
[0095] After obtaining multiple pathway construction networks, for each pathway construction network, multiple characteristic genes can be input into the pathway construction network, and the pathway construction network determines multiple characteristic genes for realizing the same or related biological functions from the multiple characteristic genes according to the corresponding pathway construction rules, and then constructs and outputs the corresponding undirected graph accordingly.
[0096] The undirected graph uses characteristic genes as nodes, and the edges in the undirected graph depict the connections between the nodes as genes. In some examples, the weights of the edges in the undirected graph can be trainable variables for constructing pathway networks. Figure 4 As shown, four undirected graphs are constructed by constructing networks of five characteristic genes (g1, g2, g3, g4, and g5) through four pathways. These four undirected graphs represent the relationship between the five characteristic genes from different dimensions. It can be understood that Figure 4 The undirected graph shown is only an example, and the undirected graph does not necessarily include all characteristic genes. For example, when a characteristic gene is not used to achieve a certain biological function, the characteristic gene may not appear in the undirected graph.
[0097] S203, obtaining gene pathways of multiple characteristic genes according to the output undirected graphs.
[0098] After obtaining the undirected graph output by the multiple pathways to build the network, multiple gene pathways can be obtained according to the multiple undirected graphs. Specifically, for an undirected graph, the gene pathway can be determined according to the characteristic genes corresponding to the nodes appearing in the undirected graph and the connections between the nodes.
[0099] In this embodiment, on the one hand, the gene pathways between characteristic genes are generated by the trained pathway construction network, which helps to integrate the gene pathway knowledge into the cell characterization process later, and quickly generate gene pathways based on the pathway construction rules learned by the pathway construction network. On the other hand, by using multiple pathway construction rules to generate different gene pathways, the realization process of biological functions can be described from multiple dimensions, the diversity of gene pathway information can be improved, and it is helpful to better use multiple gene pathways to characterize cells.
[0100] In one embodiment, in step S201, each pathway construction network determines multiple characteristic genes that realize associated biological functions among multiple characteristic genes according to corresponding pathway construction rules, which may include:
[0101] If the multiple pathway construction networks include a first pathway construction network, the first pathway construction network determines the multiple characteristic genes that realize the associated biological functions among the multiple characteristic genes according to the pathway construction rules related to the gene ontology; if the multiple pathway construction networks include a second pathway construction network, the second pathway construction network determines the multiple characteristic genes that realize the associated biological functions among the multiple characteristic genes according to the pathway construction rules related to the cell biological process; if the multiple pathway construction networks include a third pathway construction network, the third pathway construction network determines the multiple characteristic genes that realize the associated biological functions among the multiple characteristic genes according to the pathway construction rules related to immunity; if the multiple pathway construction networks include a fourth pathway construction network, the fourth pathway construction network determines the multiple characteristic genes that realize the associated biological functions among the multiple characteristic genes according to the pathway construction rules related to cell transcription.
[0102] In this embodiment, four types of pathway construction networks can be obtained in advance, so that four types of gene pathways can be integrated into the cell representation model as knowledge. The four pathways are pathways related to gene ontology (Gene Ontology), pathways related to biomolecules (Reactome), pathways related to immunity (Immune), and pathways related to transcription factors (Transcription Factors). For the sake of distinction, the pathway construction network for constructing the Gene Ontology pathway is called the first pathway construction network, the pathway construction network for constructing the Reactome pathway is called the second pathway construction network, the pathway construction network for constructing the Immune pathway is called the third pathway construction network, and the pathway construction network for constructing the Transcription Factors pathway is called the fourth pathway construction network.
[0103] Furthermore, when multiple characteristic genes are input into the first pathway construction network, the first pathway construction network can construct pathways from three directions, namely, biological processes, molecular functions and cellular components, according to pathway construction rules related to gene ontology, and determine multiple characteristic genes among the multiple characteristic genes that realize associated biological functions.
[0104] When multiple characteristic genes are input into the second pathway construction network, the second pathway construction network can determine characteristic genes related to various biological processes such as cell signal transduction and metabolism from multiple characteristic genes according to pathway construction rules related to cell biological processes, and construct pathways that can characterize cell biological processes. By characterizing processes such as metabolism, cell cycle, and cell apoptosis, the heterogeneity of cells can be demonstrated.
[0105] When multiple characteristic genes are input into the third pathway construction network, the third pathway construction network can determine multiple characteristic genes that realize related biological functions among multiple characteristic genes according to the immune-related pathway construction rules. This network mainly involves constructing pathways related to the activation, proliferation, differentiation or effector functions of immune cells. The pathway information output by the third pathway construction network can effectively distinguish immune cells from other cells other than immune cells.
[0106] If multiple characteristic genes are input into the fourth pathway construction network, the fourth pathway construction network can determine multiple characteristic genes that realize related biological functions among the multiple characteristic genes according to the pathway construction rules related to cell transcription, thereby constructing gene pathways related to cell proliferation, differentiation and signal response functions. These gene pathways are also related to the specificity exhibited by the cells.
[0107] In this embodiment, various pathway knowledge related to gene pathways can be acquired through the first pathway construction network, the second pathway construction network, the third pathway construction network and the fourth pathway construction network, and the corresponding gene pathways can be quickly constructed.
[0108] In one embodiment, in step S103, the cell characterization model to be trained determines the cell encoding information corresponding to each sample cell according to each first characteristic gene sequence and each gene pathway, which may include the following steps:
[0109] S301, constructing a first matrix according to first characteristic gene sequences corresponding to each of a plurality of sample cells and the gene expression level of each characteristic gene in each first characteristic gene sequence obtained in advance; each row in the first matrix corresponds to a sample cell, each column corresponds to a characteristic gene, and each matrix element represents the gene expression level of the characteristic gene of the sample cell.
[0110] In practical applications, the gene expression level corresponding to the gene of each sample cell can be obtained. After obtaining the first characteristic gene sequence corresponding to each of the multiple sample cells, the first matrix can be constructed according to each first characteristic gene sequence and the gene expression level of each characteristic gene in the first characteristic gene sequence. Among them, the first matrix is composed of M rows and N columns, M corresponds to the total number of sample cells, each row corresponds to a sample cell, N corresponds to the total number of characteristic genes, and each column corresponds to a characteristic gene. Each matrix element in the matrix represents the gene expression level of a sample cell on the corresponding characteristic gene. For example, the matrix element (M1, N2) represents the specific gene expression level of sample cell M1 on characteristic gene N2.
[0111] S302, constructing a second matrix according to each gene pathway; each row in the second matrix corresponds to a characteristic gene, each column corresponds to a gene pathway, and each matrix element represents whether the characteristic gene is included in the gene pathway.
[0112] On the other hand, a second matrix can also be constructed based on each gene pathway. The second matrix consists of P rows and Q columns, where P corresponds to the total number of characteristic genes, each row corresponds to a characteristic gene, and Q corresponds to the total number of gene pathways, and each column corresponds to a gene pathway. Each matrix element in the matrix represents whether a certain characteristic gene is included in a certain gene pathway. For example, the matrix element (P1, Q2) represents whether the characteristic gene P1 is in the gene pathway Q2. In some examples, the value of the matrix element can be 0 or 1, where 0 means that it does not appear in the gene pathway and 1 means that it appears in the gene pathway. Accordingly, the second matrix can be a matrix composed entirely of 0 and 1.
[0113] S303, performing feature extraction on the product of the first matrix and the second matrix by the cell representation model to be trained, and obtaining cell encoding information corresponding to each sample cell according to the feature extraction result.
[0114] After obtaining the first matrix and the second matrix, the first matrix and the second matrix can be input into the cell characterization model to be trained, and the product of the first matrix and the second matrix can be obtained by the cell characterization model. It can be understood that by multiplying the first matrix and the second matrix, a matrix composed of sample cells and gene pathways can be obtained, that is, the sample cells can be characterized by gene pathways, and then the cell characterization model can perform feature extraction on the matrix product, and obtain the cell coding information corresponding to each sample cell according to the feature extraction results.
[0115] In this embodiment, sample cells characterized by gene pathways can be obtained according to the product of the first matrix and the second matrix, and multiple gene pathways can be effectively introduced for cell characterization, effectively increasing the discrimination of sample cells by cell coding information.
[0116] In one embodiment, the second matrix includes multiple gene pathways in the same second matrix, which are constructed based on the same pathway construction rules, and the gene pathways in different second matrices correspond to different pathway construction rules. For example, for gene pathways output by multiple pathway construction networks, the second matrix can be constructed based on multiple gene pathways output by the same pathway construction network, thereby obtaining multiple second matrices corresponding to different pathway construction networks.
[0117] Accordingly, in S303, the cell representation model to be trained performs feature extraction on the product of the first matrix and the second matrix, which may include the following steps:
[0118] The product of the first matrix and each second matrix is obtained by the cell representation model to obtain multiple third matrices; multiple feature extraction modules in the cell representation model perform feature extraction on each third matrix according to the self-attention mechanism to obtain sub-feature extraction results of each feature extraction module; multiple feature extraction modules are respectively used to extract features from the third matrices constructed based on different pathway construction rules; and feature extraction results are obtained based on the fusion results of each sub-feature extraction result.
[0119] In this embodiment, the multi-head attention mechanism can be combined to extract features from the multiplication result of the first matrix and the second matrix. Specifically, after obtaining multiple second matrices, the first matrix can be multiplied by the multiple second matrices to obtain multiple third matrices. For example, for the first matrix A and the second matrix B1 and the second matrix B2, the first matrix A and the second matrix B1 are multiplied to obtain the third matrix C1, and the first matrix A and the second matrix B2 are multiplied to obtain the third matrix C2; it can be understood that the third matrix C1 and the third matrix C2 are constructed based on different path construction rules.
[0120] The cell adjustment model may include multiple feature extraction modules, and the multiple feature extraction modules are used to extract features from the third matrix constructed based on different pathway construction rules. Then, multiple feature extraction modules can respectively extract features from the corresponding third matrix to obtain sub-feature extraction results. For example, four feature extraction modules can be set to respectively extract features from the third matrix corresponding to the Gene Ontology pathway, the third matrix corresponding to the Reactome pathway, the third matrix corresponding to the Immune pathway, and the third matrix corresponding to the Transcription Factors pathway to obtain four sub-feature extraction results.
[0121] Furthermore, multiple sub-feature extraction results can be fused to obtain feature extraction results that integrate multiple pathway information.
[0122] In this embodiment, multiple feature extraction modules can be used to perform feature extraction on the third matrix constructed based on different pathway construction rules in parallel, which enables the cell characterization model to learn different types of pathway knowledge, capture richer contextual information, and improve the global understanding of sample cells and gene pathways. By fusing multiple sub-feature extraction results to obtain the final feature extraction result, the local view limitations of single feature extraction can be avoided, so that the model can handle gene pathways of different cells more flexibly, thereby enhancing the adaptability and generalization performance of the model.
[0123] In one embodiment, in step S103, the cell characterization model to be trained determines the cell encoding information corresponding to each sample cell according to each first characteristic gene sequence and each gene pathway, which may include the following steps:
[0124] Masking is performed on some characteristic genes in each first characteristic gene sequence to obtain a corresponding characteristic gene mask sequence, and the cell representation model to be trained determines the cell coding information corresponding to each sample cell according to each characteristic gene mask sequence and each gene pathway.
[0125] In a specific implementation, some of the characteristic genes in each first characteristic gene sequence can be masked to obtain a characteristic gene mask sequence corresponding to each first characteristic gene sequence. In some embodiments, some of the characteristic genes in each first characteristic gene sequence can be randomly masked to improve the generalization ability of the cell representation model and enhance the robustness of the model. The order of each characteristic gene in the characteristic gene mask sequence is the same as the order of each characteristic gene in the first characteristic gene, but some characteristic genes are blocked, such as Figure 4 As shown, when randomly masked, both the gene identifier and gene expression level of the characteristic gene are blocked.
[0126] After obtaining the characteristic gene mask sequence, the cell representation model to be trained can determine the cell coding information corresponding to each sample cell according to each characteristic gene mask sequence and each gene pathway. The specific implementation method can regard the characteristic gene mask sequence as the first characteristic gene sequence mentioned above, and then refer to the method of determining the cell coding information according to each first characteristic gene sequence and gene pathway in one or more of the previous embodiments, which will not be repeated here.
[0127] Accordingly, in step S103, predicting the second characteristic gene sequence corresponding to each sample cell according to the cell coding information includes the following steps:
[0128] The masked part in each characteristic gene mask sequence is predicted according to the cell coding information, and the second characteristic gene sequence corresponding to each sample cell is obtained according to the prediction result.
[0129] The cell characterization model can determine the cell coding information corresponding to each sample cell according to the characteristic gene mask sequence and each gene pathway. The specific determination method can refer to the above embodiment and will not be described here. Then, the cell characterization model predicts the masked characteristic gene according to the cell coding information and the context information of the masked part in the characteristic gene mask sequence, thereby predicting the masked characteristic gene according to the prediction result and obtaining the second characteristic gene sequence.
[0130] In this embodiment, by masking the first feature gene sequence and predicting the masked part according to the cell coding information to obtain the second feature gene sequence, the cell representation model can more fully utilize the contextual information in the feature gene mask sequence to predict the masked feature genes, thereby learning a more accurate cell representation.
[0131] In one embodiment, Figure 5 As shown, the present application also provides a method for processing downstream cell tasks. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0132] S501, determine the downstream tasks for the target cells, obtain the characteristic genes corresponding to the target cells, and determine the characteristic gene sequences and multiple gene pathways corresponding to the target cells according to the characteristic genes corresponding to the target cells.
[0133] In this step, after receiving the downstream task for the target cell, the initial characteristic gene sequence corresponding to the target cell can be obtained. In practical applications, for downstream tasks, after obtaining the cell data of the target cell, the characteristic genes of the target cell can be extracted first, and the data can be aligned. Specifically, the data of the target cell is first aligned with the data in the cell sample set. The alignment process includes determining the characteristic gene of the target cell. The characteristic gene is the characteristic gene determined when processing the cell sample set. In other words, for each gene of the target cell, if the gene matches any characteristic gene of the cell sample set, it will be retained. If the gene does not match any characteristic gene of the cell sample set, the gene will be eliminated, and then the initial characteristic gene sequence corresponding to the target cell is obtained based on the retained gene.
[0134] After determining the characteristic genes of the target cells, such as Figure 6 As shown, the characteristic gene sequence corresponding to the target cell can be obtained according to the characteristic gene corresponding to the target cell, and matched with the multiple gene pathways obtained in advance to determine the multiple gene pathways composed of the characteristic genes of the target cell. The determination method of the characteristic gene sequence of the target cell and the multiple gene pathways can be the same as the acquisition method in the aforementioned embodiment. The specific implementation method can be referred to the above, and will not be repeated here.
[0135] S502, obtaining target cell encoding information of the target cell according to the characteristic gene sequence and multiple gene pathways corresponding to the target cell by the trained cell representation model.
[0136] The cell representation model is trained based on the cell representation model pre-training method of any of the above embodiments.
[0137] In this step, the pre-trained cell characterization model can generate target cell coding information corresponding to the target cell according to the characteristic gene sequence and multiple gene pathways corresponding to the target cell. In some embodiments, since the model output of the original pre-trained cell characterization model is the second characteristic gene sequence, but the task processing result required by the downstream task may not be limited to the characteristic gene sequence, the last linear layer used for linear mapping in the cell characterization model can be removed, and the target cell coding information determined by the cell characterization model can be directly output as the processing result, so that different cells can be effectively characterized by the target cell coding information output by the cell characterization model. Of course, in some other embodiments, considering the adjustment of the model parameters, the pre-trained cell characterization model can redefine the new neural network layer for combination after loading to directly generate the downstream output.
[0138] S503, processing downstream tasks for target cells based on the target cell encoding information.
[0139] After obtaining the target cell coding information, the noise data contained in the target cell coding information is significantly reduced, and the effective information is more retained or completed, so that the target cell coding information can effectively characterize a single cell, and then the target cell coding information can be used to process downstream tasks targeting the target cell.
[0140] In some exemplary embodiments, the cell representation model can be adjusted in terms of its model structure. For example, when the cell representation model includes a transformer layer, a fully connected layer or an embedding layer can be added after the transformer layer ends, and the target cell encoding information can be transformed through the fully connected layer or the embedding layer to meet the specific output requirements of downstream tasks, such as obtaining characteristic gene sequences and cell classification results. For drug response and cell perturbation prediction tasks, a cell representation representing the initial state of single cell changes can be constructed by combining inputs, and then predictions can be made through the definition of downstream models.
[0141] In the above-mentioned cell downstream task processing method, the downstream tasks for the target cells can be determined, the characteristic genes corresponding to the target cells can be obtained, and the characteristic gene sequences and multiple gene pathways corresponding to the target cells can be determined based on the characteristic genes corresponding to the target cells; then the pre-trained cell characterization model can obtain the target cell coding information of the target cells based on the characteristic gene sequences and multiple gene pathways corresponding to the target cells, wherein the cell characterization model is trained based on the previous cell characterization model pre-training method, and then the downstream tasks for the target cells can be processed based on the target cell coding information. In this embodiment, the pre-trained cell characterization model can obtain the target cell coding information that can accurately characterize and distinguish the target cells based on the characteristic gene sequences and multiple gene pathways corresponding to the target cells, and by applying the target cell coding information to the cell downstream tasks, the task processing results of the downstream tasks can be effectively optimized.
[0142] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0143] Based on the same inventive concept, the embodiment of the present application also provides a cell characterization model pre-training device for implementing the cell characterization model pre-training method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more cell characterization model pre-training device embodiments provided below can refer to the limitations of the cell characterization model pre-training method above, and will not be repeated here.
[0144] In an exemplary embodiment, Figure 7 As shown, a cell representation model pre-training device is provided, comprising:
[0145] A first sequence acquisition module 701 is used to determine a plurality of characteristic genes of a cell sample set, and to acquire first characteristic gene sequences corresponding to each of a plurality of sample cells in the cell sample set;
[0146] A gene pathway matching module 702 is used to obtain multiple gene pathways for realizing different biological functions according to the matching of the multiple characteristic genes; each of the gene pathways includes various characteristic genes involved in realizing the biological function corresponding to the gene pathway;
[0147] The characterization module 703 is used to determine the cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways by using the cell characterization model to be trained, and predict the second characteristic gene sequence corresponding to each of the sample cells according to the cell coding information;
[0148] The model adjustment module 704 is used to adjust the cell representation model according to the difference between the second characteristic gene sequence and the first characteristic gene sequence corresponding to the sample cell, until the training end condition is met to obtain a pre-trained cell representation model.
[0149] In one embodiment, the device further comprises a gene pathway acquisition module, wherein the gene pathway acquisition module is used to:
[0150] Inputting the plurality of characteristic genes into a plurality of pathway construction networks; the plurality of pathway construction networks respectively correspond to different pathway construction rules, and the different pathway construction rules characterize the realization process of the biological function based on different dimensions;
[0151] Each of the pathway construction networks determines, according to the corresponding pathway construction rules, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions, and outputs a corresponding undirected graph according to the plurality of characteristic genes that realize the same biological function;
[0152] According to each of the output undirected graphs, each gene pathway of the plurality of characteristic genes is obtained.
[0153] In one embodiment, the gene pathway acquisition module is used to:
[0154] If the plurality of pathway construction networks include a first pathway construction network, the first pathway construction network determines, according to pathway construction rules associated with gene ontology, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions;
[0155] If the plurality of pathway construction networks include a second pathway construction network, the second pathway construction network determines, according to pathway construction rules related to cell biological processes, a plurality of characteristic genes among the plurality of characteristic genes that implement associated biological functions;
[0156] If the multiple pathway construction networks include a third pathway construction network, the third pathway construction network determines, according to immunity-related pathway construction rules, multiple characteristic genes among the multiple characteristic genes that realize associated biological functions;
[0157] If the multiple pathway construction networks include a fourth pathway construction network, the fourth pathway construction network determines multiple characteristic genes that realize associated biological functions among the multiple characteristic genes according to pathway construction rules related to cell transcription.
[0158] In one embodiment, the characterization module 703 is used to:
[0159] A first matrix is constructed according to first characteristic gene sequences corresponding to each of the plurality of sample cells and the gene expression level of each characteristic gene in each of the first characteristic gene sequences obtained in advance; each row in the first matrix corresponds to one of the sample cells, each column corresponds to one of the characteristic genes, and each matrix element represents the gene expression level of the characteristic gene of the sample cell;
[0160] Constructing a second matrix according to each of the gene pathways; each row in the second matrix corresponds to one of the characteristic genes, each column corresponds to one of the gene pathways, and each matrix element represents whether the characteristic gene is included in the gene pathway;
[0161] The cell representation model to be trained performs feature extraction on the product of the first matrix and the second matrix, and obtains the cell encoding information corresponding to each of the sample cells according to the feature extraction result.
[0162] In one embodiment, the second matrix includes multiple genes pathways in the same second matrix are constructed based on the same pathway construction rule, and genes pathways in different second matrices correspond to different pathway construction rules;
[0163] The characterization module 703 is used to:
[0164] Obtaining the product of the first matrix and each of the second matrices from the cell characterization model to obtain a plurality of third matrices;
[0165] The plurality of feature extraction modules in the cell representation model perform feature extraction on each of the third matrices according to the self-attention mechanism to obtain respective sub-feature extraction results of the plurality of feature extraction modules; the plurality of feature extraction modules are respectively used to perform feature extraction on the third matrices constructed based on different pathway construction rules;
[0166] A feature extraction result is obtained according to the fusion result of each of the sub-feature extraction results.
[0167] In one embodiment, the characterized module 703 is used to:
[0168] Masking some of the characteristic genes in each of the first characteristic gene sequences to obtain a corresponding characteristic gene mask sequence, and determining the cell coding information corresponding to each of the sample cells by the cell representation model to be trained according to each of the characteristic gene mask sequences and each of the gene pathways;
[0169] A characteristic gene prediction is performed on the masked part in each characteristic gene mask sequence according to the cell encoding information, and a second characteristic gene sequence corresponding to each sample cell is obtained according to the prediction result.
[0170] Based on the same inventive concept, the embodiment of the present application also provides a cell downstream task processing device for implementing the cell downstream task processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more cell downstream task processing device embodiments provided below can refer to the limitations of the cell downstream task processing method above, and will not be repeated here.
[0171] In an exemplary embodiment, Figure 8 As shown, a cell downstream task processing device is provided, comprising:
[0172] The task determination module 801 is used to determine the downstream tasks for the target cells, obtain the characteristic genes corresponding to the target cells, and determine the characteristic gene sequences and multiple gene pathways corresponding to the target cells according to the characteristic genes corresponding to the target cells;
[0173] A target coding information acquisition module 802 is used to obtain target cell coding information of the target cell according to the characteristic gene sequence and multiple gene pathways corresponding to the target cell by a pre-trained cell characterization model; the cell characterization model is trained based on any of the cell characterization model pre-training methods described above;
[0174] The task processing module 803 is used to process the downstream task for the target cells based on the target cell encoding information.
[0175] Each module in the above-mentioned cell characterization model pre-training device and the cell downstream task processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0176] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store cell data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cell characterization model pre-training method or a cell downstream task processing method is implemented.
[0177] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a cell characterization model pre-training method or a cell downstream task processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0178] Those skilled in the art will understand that Fig. 9 and Fig.10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0179] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0180] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0181] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0182] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0183] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0185] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A cell representation model pre-training method, characterized in that: The method comprises: Determine a plurality of characteristic genes of a cell sample set, and obtain a first characteristic gene sequence corresponding to each of a plurality of sample cells in the cell sample set; According to the matching of the plurality of characteristic genes, a plurality of gene pathways for realizing different biological functions are obtained; each of the gene pathways includes each characteristic gene involved in realizing the biological function corresponding to the gene pathway; The cell representation model to be trained determines the cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways, and predicts the second characteristic gene sequence corresponding to each of the sample cells according to the cell coding information; According to the difference between the second characteristic gene sequence and the first characteristic gene sequence corresponding to the sample cell, the cell representation model is adjusted until a training end condition is met to obtain a pre-trained cell representation model.
2. The method according to claim 1, characterized in that The gene pathway is obtained by the following steps: Inputting the plurality of characteristic genes into a plurality of pathway construction networks; the plurality of pathway construction networks respectively correspond to different pathway construction rules, and the different pathway construction rules characterize the realization process of the biological function based on different dimensions; Each of the pathway construction networks determines, according to the corresponding pathway construction rules, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions, and outputs a corresponding undirected graph according to the plurality of characteristic genes that realize the same biological function; According to each of the output undirected graphs, each gene pathway of the plurality of characteristic genes is obtained.
3. The method according to claim 2, characterized in that Determining, by each of the pathway construction networks according to the corresponding pathway construction rules, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions comprises: If the plurality of pathway construction networks include a first pathway construction network, the first pathway construction network determines, according to pathway construction rules associated with gene ontology, a plurality of characteristic genes among the plurality of characteristic genes that realize associated biological functions; If the plurality of pathway construction networks include a second pathway construction network, the second pathway construction network determines, according to pathway construction rules related to cell biological processes, a plurality of characteristic genes among the plurality of characteristic genes that implement associated biological functions; If the multiple pathway construction networks include a third pathway construction network, the third pathway construction network determines, according to immunity-related pathway construction rules, multiple characteristic genes among the multiple characteristic genes that realize associated biological functions; If the multiple pathway construction networks include a fourth pathway construction network, the fourth pathway construction network determines multiple characteristic genes that realize associated biological functions among the multiple characteristic genes according to pathway construction rules related to cell transcription.
4. The method according to claim 1, characterized in that: The cell characterization model to be trained determines the cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways, including: A first matrix is constructed according to first characteristic gene sequences corresponding to each of the plurality of sample cells and the gene expression level of each characteristic gene in each of the first characteristic gene sequences obtained in advance; each row in the first matrix corresponds to one of the sample cells, each column corresponds to one of the characteristic genes, and each matrix element represents the gene expression level of the characteristic gene of the sample cell; Constructing a second matrix according to each of the gene pathways; each row in the second matrix corresponds to one of the characteristic genes, each column corresponds to one of the gene pathways, and each matrix element represents whether the characteristic gene is included in the gene pathway; The cell representation model to be trained performs feature extraction on the product of the first matrix and the second matrix, and obtains the cell encoding information corresponding to each of the sample cells according to the feature extraction result.
5. The method according to claim 4, characterized in that The second matrix includes a plurality of genes pathways in the same second matrix, which are constructed based on the same pathway construction rules, and genes pathways in different second matrices correspond to different pathway construction rules; The step of extracting features from the product of the first matrix and the second matrix by the cell representation model to be trained comprises: Obtaining the product of the first matrix and each of the second matrices from the cell representation model to be trained to obtain a plurality of third matrices; The plurality of feature extraction modules in the cell representation model perform feature extraction on each of the third matrices according to the self-attention mechanism to obtain respective sub-feature extraction results of the plurality of feature extraction modules; the plurality of feature extraction modules are respectively used to perform feature extraction on the third matrices constructed based on different pathway construction rules; A feature extraction result is obtained according to the fusion result of each of the sub-feature extraction results.
6. The method according to any one of claims 1 to 5, characterized in that The cell characterization model to be trained determines the cell coding information corresponding to each of the sample cells according to each of the first characteristic gene sequences and each of the gene pathways, including: Masking some of the characteristic genes in each of the first characteristic gene sequences to obtain a corresponding characteristic gene mask sequence, and determining the cell coding information corresponding to each of the sample cells by the cell representation model to be trained according to each of the characteristic gene mask sequences and each of the gene pathways; The predicting the second characteristic gene sequence corresponding to each of the sample cells according to the cell coding information includes: A characteristic gene prediction is performed on the masked part in each characteristic gene mask sequence according to the cell encoding information, and a second characteristic gene sequence corresponding to each sample cell is obtained according to the prediction result.
7. A method for processing downstream tasks of cells, characterized in that: The method comprises: Determine downstream tasks for target cells, obtain characteristic genes corresponding to the target cells, and determine characteristic gene sequences and multiple gene pathways corresponding to the target cells according to the characteristic genes corresponding to the target cells; The target cell encoding information of the target cell is obtained by a pre-trained cell characterization model according to the characteristic gene sequence and multiple gene pathways corresponding to the target cell; the cell characterization model is trained based on the cell characterization model pre-training method according to any one of claims 1 to 6; The downstream tasks for the target cells are processed based on the target cell encoding information.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the cell characterization model pre-training method described in any one of claims 1 to 6 or the steps of the cell downstream task processing method described in claim 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the cell characterization model pre-training method described in any one of claims 1 to 6 or the steps of the cell downstream task processing method described in claim 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the cell characterization model pre-training method described in any one of claims 1 to 6 or the steps of the cell downstream task processing method described in claim 7 are implemented.
Citation Information
Patent Citations
Ring RNA-disease association prediction method and device based on weighted graph attention and heterogeneous graph neural network, and medium
CN115798730A
Single-cell RNA (Ribonucleic Acid) sequence gene regulation and control inference method based on deep learning
CN116825204A
Deep learning cancer risk prediction method and system based on methylation sequence
CN117727371A
Cell type identification method, device and equipment based on single cell RNA sequencing data
CN117746995A
Systems and methods for generating a genotypic causal model of a disease state
US20230253122A1
Cited By
Full-length gene sequence modeling method and system based on neural network
CN121306244A