Cell annotation method and apparatus, electronic device, and computer program product
By using a hierarchical cell annotation model and extracting global and local features, the problem of strong dependence on reference datasets and insufficient annotation accuracy in single-cell RNA sequencing technology is solved, achieving efficient and accurate cell type annotation that can meet the needs of different datasets.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2026-03-12
AI Technical Summary
Existing single-cell RNA sequencing technologies are highly dependent on reference datasets when annotating cell types, resulting in insufficient accuracy and stability. They also fail to fully consider cell hierarchical relationships, leading to low annotation accuracy when dealing with complex cell hierarchical structures.
A hierarchical cell annotation model is adopted. Through global and local feature extraction, the cell's hierarchy and global cell type are determined. Combined with local cell classification, the hierarchical relationship between cells is considered. A high-accuracy parameter-free annotation model and a lightweight model structure are used, and large-scale training set data is used to improve the model's generalization ability.
It improves the accuracy and stability of cell type annotation in single-cell RNA sequencing data, reduces computational complexity and resource requirements, and enhances the model's adaptability and processing speed on different datasets.
Smart Images

Figure CN2024116646_12032026_PF_FP_ABST
Abstract
Description
Cell annotation method and device, electronic device, computer program product TECHNICAL FIELD
[0001] The present application relates to the technical field of biological sequencing or other related fields, in particular to a cell annotation method and device, electronic device, computer program product. BACKGROUND
[0002] Single-cell RNA sequencing (scRNA-seq) is a technology that can resolve the transcriptome at single-cell resolution, thereby revealing cell heterogeneity and dynamic changes. With the wide application of scRNA-seq data, how to effectively annotate a large number of single cells becomes an important challenge.
[0003] In the related art, in the process of annotating single cells, the following defects exist: 1) strong dependence on reference data set: for example, CellTypist (using a pre-trained machine learning model and a large-scale reference data set to annotate cell types) and SingleR (using known cell types in the reference data set to calculate the correlation of the target cell in multiple-to-one, and selecting the most similar cell type for annotation) rely on high-quality reference data sets, but when the target data set is significantly different from the reference data set, the accuracy of the annotation result will be significantly reduced. 2) annotation accuracy and stability need to be improved: although existing technologies improve annotation accuracy through various methods, there are still misannotation and instability, especially when dealing with data sets with high heterogeneity and complex cell types, the reliability of the annotation result is low. 3) Insufficient consideration of cell hierarchical relationship: existing technologies are mainly based on similarity calculation and reference data set, and do not fully consider the hierarchical relationship between cell types, which leads to low annotation accuracy when dealing with complex cell hierarchical structure.
[0004] In view of the above problems, no effective solution has been proposed so far.
[0005] SUMMARY
[0006] The embodiments of the present application provide a cell annotation method and device, electronic device, computer program product, which at least solve the technical problem of low accuracy in the related art when annotating single cells.
[0007] According to an aspect of some embodiments of the present application, a cell annotation method is provided, comprising: inputting a gene expression matrix of a target cell into a hierarchical cell annotation model, and extracting M levels of cell features, wherein the cell features comprise global features and local features, the global features are used to determine a global cell type and a hierarchy to which the cell belongs, the local features are used to determine a local cell classification of each hierarchy, and M is an integer greater than 1; and outputting an annotation result of the target cell in a hierarchical cell classification system based on the cell features.
[0008] Optionally, before inputting the gene expression matrix of the target cell into the hierarchical cell annotation model, the method further comprises: extracting a single-cell RNA sequencing data set of the target cell, filtering cells with a number of genes less than a first quantity threshold in the single-cell RNA sequencing data set, and filtering genes expressed by less than a second quantity threshold of cells, to obtain an initial gene expression matrix; and performing normalization processing on the initial gene expression matrix to obtain a preprocessed gene expression matrix of the target cell.
[0009] Optionally, the hierarchical cell annotation model comprises an encoder module, N global feature extraction layers, and N local feature extraction layers, wherein N is a positive integer greater than 1.
[0010] Optionally, the hierarchical cell annotation model is pre-trained, and when training the hierarchical cell annotation model, the method comprises: inputting a single-cell gene expression matrix in a gene database into an initial hierarchical classification network model, performing feature extraction and cell type classification by the initial hierarchical classification network model, and training the initial hierarchical classification network model; inputting a test data set into the trained initial hierarchical classification network model, extracting a plurality of levels of cell features by the initial hierarchical classification network model, and outputting an annotation result of each cell in a hierarchical cell classification system based on the cell features; and when the accuracy of the annotation result exceeds a preset accuracy threshold, confirming that the model training is complete, and obtaining the hierarchical cell annotation model.
[0011] Optionally, the step of feature extraction by the initial hierarchical classification network model comprises: inputting the single-cell gene expression matrix into an encoder module in the initial hierarchical classification network model to generate initial cell features; inputting the single-cell gene expression matrix into an i-th global feature extraction layer in the initial hierarchical classification network model in sequence to obtain hierarchical features extracted by each layer, i being a positive integer less than or equal to N; concatenating the hierarchical features output by the i-th global feature extraction layer with the initial cell features and inputting the concatenated features into an i+1-th global feature layer until the hierarchical features output by the N-th layer are concatenated with the initial cell features to obtain global features of the cell; and inputting the single-cell gene expression matrix into an i-th local feature extraction layer in the initial hierarchical classification network model in sequence to classify the cell by each local feature extraction layer to obtain local features.
[0012] Optionally, after the feature extraction and cell type classification by the initial hierarchical classification network model, the method further comprises: determining a hierarchical level and a global cell type to which the cell belongs based on the global features of the cell, and determining a local cell classification corresponding to each layer based on the local features extracted by each layer; performing accumulation processing on cross-entropy of each local cell classification to obtain a local classification result; calculating a model loss value based on the hierarchical level to which the cell belongs, the global cell type, and the local classification result; and iteratively updating the initial hierarchical classification network model based on the model loss value.
[0013] Optionally, the step of outputting an annotation result of the target cell in the hierarchical cell classification system based on the cell features comprises: determining a hierarchical level and a global cell type to which the target cell belongs in the hierarchical cell classification system based on the global features; determining a local cell classification of the target cell in each hierarchical level in the hierarchical cell classification system based on the local features; and outputting a cell type annotation result of the target cell by combining the global cell type and the local cell classification of each hierarchical level.
[0014] According to another aspect of the embodiment of the present application, a cell annotation device is further provided, comprising: a cell feature extraction unit configured to input a gene expression matrix of a target cell into a hierarchical cell annotation model to extract cell features of M hierarchical levels, wherein the cell features comprise global features and local features, the global features are used to determine a hierarchical level and a global cell type to which the cell belongs, and the local features are used to determine a local cell classification of each hierarchical level, and M is an integer greater than 1; and a cell annotation unit configured to output an annotation result of the target cell in a hierarchical cell classification system based on the cell features.
[0015] Optionally, the cell annotation device further comprises: a data filtering unit, configured to extract a single-cell RNA sequencing data set of a target cell, filter cells with a number of genes less than a first quantity threshold in the single-cell RNA sequencing data set, and filter genes expressed by less than a second quantity threshold of cells, to obtain an initial gene expression matrix before inputting the gene expression matrix of the target cell into the hierarchical cell annotation model; and a normalization unit, configured to perform normalization processing on the initial gene expression matrix to obtain a preprocessed gene expression matrix of the target cell.
[0016] Optionally, the hierarchical cell annotation model comprises: an encoder module, N global feature extraction layers, and N local feature extraction layers, where N is a positive integer greater than 1.
[0017] Optionally, the hierarchical cell annotation model is pre-trained, and the cell annotation device comprises the following when training the hierarchical cell annotation model: a model input unit, configured to input a single-cell gene expression matrix in a gene database into an initial hierarchical classification network model, perform feature extraction and cell type classification by the initial hierarchical classification network model, and train the initial hierarchical classification network model; a model training unit, configured to input a test data set into the trained initial hierarchical classification network model, extract cell features at multiple levels by the initial hierarchical classification network model, and output an annotation result of each cell in a hierarchical cell classification system based on the cell features; and a model confirmation unit, configured to confirm that the model training is complete and obtain the hierarchical cell annotation model when an accuracy of the annotation result exceeds a preset accuracy threshold.
[0018] Optionally, the model input unit comprises: a matrix input module, configured to input a single-cell gene expression matrix into an encoder module in an initial hierarchical classification network model to generate initial cell features; a feature extraction module, configured to input the single-cell gene expression matrix into an i-th global feature extraction layer in the initial hierarchical classification network model in sequence to obtain hierarchical features extracted at each layer, where i is a positive integer less than or equal to N; a feature splicing module, configured to splice the hierarchical features output by the i-th global feature extraction layer with the initial cell features and input into an i+1-th global feature layer until the hierarchical features output by the N-th layer are spliced with the initial cell features to obtain global features of the cell; and a classification module, configured to input the single-cell gene expression matrix into an i-th local feature extraction layer in the initial hierarchical classification network model in sequence, and classify the cell by each local feature extraction layer to obtain local features.
[0019] Optionally, the cell annotation apparatus further comprises: a first cell classification unit configured to determine a hierarchy to which the cell belongs and a global cell type of the cell based on the global feature of the cell after the feature extraction and the cell type classification by the initial hierarchical classification network model, and determine a local cell classification of each hierarchy based on the local feature extracted for each hierarchy; a second cell classification unit configured to accumulate cross-entropy of each local cell classification to obtain a local classification result; a loss value calculation unit configured to calculate a model loss value based on the hierarchy to which the cell belongs, the global cell type and the local classification result; and a model constraint module configured to iteratively update the initial hierarchical classification network model based on the model loss value.
[0020] Optionally, the cell annotation unit comprises: a determination module configured to determine a hierarchy to which the target cell belongs and a global cell type of the target cell based on the global feature; a cell positioning module configured to determine a local cell classification of the target cell in each hierarchy of the hierarchical cell classification system based on the local feature; and a type determination module configured to output a cell type annotation result of the target cell by combining the global cell type and the local cell classification of each hierarchy.
[0021] According to another aspect of the embodiments of the present application, an electronic device is also provided, which comprises one or more processors and a memory, the memory being configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the cell annotation method according to any one of the preceding embodiments.
[0022] According to another aspect of the embodiments of the present application, a computer program product is also provided, which comprises a computer program configured to implement the steps of the cell annotation method according to any one of the preceding embodiments when executed by a processor.
[0023] In the embodiments of the present application, the gene expression matrix of the target cell is input into the hierarchical cell annotation model, and M hierarchical cell features are extracted, and based on the cell features, an annotation result of the target cell in the hierarchical cell classification system is output, wherein the cell features comprise global features and local features, the global features are used to determine a hierarchy to which the cell belongs and a global cell type, and the local features are used to determine a local cell classification of each hierarchy. In this embodiment, the hierarchical cell annotation model is used to automatically extract features of single cells, the global features are used to determine a hierarchy to which the cell belongs and a global cell type, and the local features are used to determine a local cell classification of each hierarchy, the hierarchical relationship between cells is fully considered, the model can efficiently and accurately complete the cell type annotation task, and an accurate cell type annotation result is obtained, thereby solving the technical problem of low accuracy in cell type annotation of single cells in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0024] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0025] Fig. 1 is a flow chart of an optional cell annotation method according to an embodiment of the present application;
[0026] Fig. 2 is a schematic diagram of an optional hierarchical cell annotation model according to an embodiment of the present application;
[0027] Fig. 3 is a schematic diagram of another optional standardized hierarchical cell annotation tool based on single-cell transcriptome data according to an embodiment of the present application;
[0028] Fig. 4 is a schematic diagram of an optional cell annotation device according to an embodiment of the present application;
[0029] Fig. 5 is a hardware structure block diagram of an electronic device (or mobile device) for a cell annotation method according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the personnel in the art better understand the application scheme, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] In order to facilitate those skilled in the art to understand the present application, the following explains some terms or names involved in the embodiments of the present application:
[0033] Single-cell RNA sequencing, abbreviated as scRNA-seq, is a high-throughput technology for studying gene expression in individual cells. Through scRNA-seq, the transcriptome of individual cells can be analyzed, revealing differences between different cell types and cellular heterogeneity within a population of individual cells.
[0034] Transcriptome data, measuring ribonucleic acid molecules, studying cellular gene regulatory networks and the influence of the extracellular microenvironment on cell expression and function.
[0035] It should be noted that in the present disclosure, the customer information is collected, analyzed, and the corresponding operation portal is provided for the user to select to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.
[0036] The following embodiments of the present application can be applied to various cell annotation tools / systems / applications / devices. The present application can solve various problems existing in the prior art of single-cell RNA sequencing data cell type annotation technology. First, the prior art does not fully consider the hierarchical relationship between cells, resulting in low annotation accuracy when dealing with complex cell hierarchical structure. To this end, the present application improves the accuracy of annotation by introducing cell hierarchical relationship. Second, the prior art has strong dependence on reference data set, and when there is a large difference between target data and reference data, the annotation result is inaccurate. To this end, the present application adopts a high-accuracy parameter-free annotation model, avoiding the dependence on reference data set. Third, the prior art adopts a complex model structure, resulting in high computational complexity, long processing time, and large demand for computing resources. The present application significantly reduces the computational complexity and resource demand by designing a lightweight model structure, improving the processing speed. Fourth, the prior art has low annotation accuracy and stability when dealing with high-heterogeneity and complex cell type data sets. The present application uses large-scale training set data to ensure the generalization ability of the model on various single-cell RNA sequencing data, enhancing the accuracy and stability of annotation. Fifth, the prior art model training and running cost is high, and the calculation speed is slow, which is difficult to meet the demand of large-scale data fast processing. The present application improves the calculation speed and efficiency and reduces the cost by optimizing the model structure and algorithm design, which can more efficiently process large-scale single-cell RNA sequencing data. Ensuring the generalization ability of the model on various single-cell RNA sequencing data enables it to efficiently and accurately complete the cell type annotation task.
[0037] The present application will be described in detail below in conjunction with various embodiments.
[0038] Embodiment one
[0039] According to an embodiment of the present application, a cell annotation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0040] FIG. 1 is a flowchart of an optional cell annotation method according to an embodiment of the present application. As shown in FIG. 1, the method comprises the following steps:
[0041] In step S101, a gene expression matrix of a target cell is input into a hierarchical cell annotation model to extract M levels of cell features, wherein the cell features include global features and local features, the global features are used to determine the global cell type and the level to which the cell belongs, the local features are used to determine the local cell classification of each level, and M is an integer greater than 1.
[0042] In this embodiment, the gene expression matrix of a cell refers to the expression level of all genes in the cell under a specific condition. This matrix can be a two-dimensional array, with each row representing a gene and each column representing a sample. Each element in the matrix represents the expression level of the corresponding gene in the corresponding sample.
[0043] For example, when obtaining the gene expression matrix of a cell, the coordinates of ribonucleic acid molecules generated by spatial transcriptomics can be obtained first, a cell nucleus image is input into a cell nucleus segmentation model to obtain a cell nucleus segmentation result, and each ribonucleic acid molecule is assigned to the cell with the shortest distance to it according to the cell nucleus segmentation result and the coordinates of the ribonucleic acid molecules to form an expression matrix of a single cell. Then, the cell type annotation of the cell can be performed according to the expression matrix of the single cell to obtain the cell type.
[0044] It should be noted that in this embodiment, a hierarchical classification system for known cells is pre-constructed, which contains multiple levels, and the cell types and cell gene data expressed by each level are different.
[0045] Before the gene expression matrix of the target cell is input into the hierarchical cell annotation model, the gene expression matrix is obtained by preprocessing, and the preprocessing step comprises: extracting a single cell RNA sequencing data set of the target cell, filtering cells with a number of genes less than a first number threshold in the single cell RNA sequencing data set, and filtering genes expressed by less than a second number threshold of cells to obtain an initial gene expression matrix; and performing normalization processing on the initial gene expression matrix to obtain the preprocessed gene expression matrix of the target cell.
[0046] The threshold number of filtered cells and filtered genes can be self-defined, for example, the single-cell RNA sequencing data from the cellxgene database source is preprocessed, mainly to filter low-quality cells and genes (for example, filter cells with less than 200 genes, and genes expressed in less than 3 cells), then normalize the single-cell gene expression matrix, and collect cell-level and sample-level information.
[0047] Further, in the preprocessing, an adaptive preprocessing algorithm can be developed to automatically adjust parameters according to the characteristics of different data sets, improving the effect and efficiency of data preprocessing.
[0048] In step S102, based on the cell features, the annotation result of the target cell in the hierarchical cell classification system is output.
[0049] Through the above steps, the gene expression matrix of the target cell can be input into the hierarchical cell annotation model, and M hierarchical cell features can be extracted. Based on the cell features, the annotation result of the target cell in the hierarchical cell classification system is output, wherein the cell features include global features and local features. The global features are used to determine the global cell type and the cell belongs to the level, and the local features are used to determine the local cell classification of each level. In this embodiment, the hierarchical cell annotation model is used to automatically extract the features of single cells. The global features can determine the global cell type and the cell belongs to the level, and the local features can determine the local cell classification of each level. The hierarchical relationship between cells is fully considered, so that the model can efficiently and accurately complete the cell type annotation task and obtain accurate cell type annotation results, thereby solving the technical problem of low accuracy in cell type annotation of single cells in related technologies.
[0050] The present embodiment can be applied to a standardized hierarchical cell annotation tool / system / software for single-cell transcriptome data, and provides a standardized toolkit, which realizes a unified interface and data preprocessing process of a plurality of generative pre-training transformer models in single-cell RNA sequencing data analysis, and significantly improves the compatibility, analysis efficiency and interpretability of the results of the model.
[0051] The present embodiment can use the hierarchical cell annotation model to standardize the annotation of single-cell RNA sequencing data, and then use the de-standardized annotation data for downstream biological information analysis, such as differential expression gene analysis, feature gene identification, gene regulation network, intercellular communication analysis, etc. The model annotation result has gain for downstream analysis.
[0052] It should be noted that the hierarchical cell annotation model mentioned in the embodiment is pre-trained, and when training the hierarchical cell annotation model, the following steps are included: inputting the single-cell gene expression matrix in the gene database into an initial hierarchical classification network model, performing feature extraction and cell type classification by the initial hierarchical classification network model, and training the initial hierarchical classification network model; inputting a test data set into the trained initial hierarchical classification network model, extracting a plurality of hierarchical cell features from the initial hierarchical classification network model, and outputting an annotation result of each cell in the hierarchical cell classification system based on the cell features; in the case where the accuracy of the annotation result exceeds a preset accuracy threshold, confirming that the model training is completed, and obtaining the hierarchical cell annotation model.
[0053] It should be noted that in the process of training the model, the non-parametric annotation model is trained in the embodiment, for example, single-cell RNA sequencing data sets of 10 known tissues (bone marrow, breast, colon, intestine, kidney, liver, lymph node, pancreas, placenta, and spleen) and 5 mouse tissues (kidney, liver, pancreas, spleen, and intestine) are selected and merged according to species-tissue. The merged data is cleaned, and cell types with less than 100 cells are filtered, and cells with less than 5000 cells are up-sampled to 5000, and then the non-parametric model is trained, and finally the non-parametric training model of 10 human tissues and 5 mouse tissues is obtained.
[0054] Through the non-parametric annotation model, the present application avoids the dependence on reference data sets, thereby improving the generalization ability of the model on different data sets.
[0055] It should be noted that the hierarchical cell annotation model mentioned in the embodiment includes an encoder module, N global feature extraction layers, and N local feature extraction layers, where N is a positive integer greater than 1.
[0056] Optionally, the step of performing feature extraction by the initial hierarchical classification network model includes: inputting the single-cell gene expression matrix into the encoder module in the initial hierarchical classification network model to generate initial cell features; inputting the single-cell gene expression matrix into the i-th global feature extraction layer in the initial hierarchical classification network model in sequence to obtain hierarchical features extracted by each layer, where i is a positive integer less than or equal to N; concatenating the hierarchical features output by the i-th global feature extraction layer with the initial cell features and inputting the concatenated features into the i+1-th global feature layer, until the hierarchical features output by the N-th layer are concatenated with the initial cell features to obtain global features of the cell; and inputting the single-cell gene expression matrix into the i-th local feature extraction layer in the initial hierarchical classification network model in sequence, classifying the cell by each local feature extraction layer, and obtaining local features.
[0057] Figure 2 is a schematic diagram of an optional hierarchical cell annotation model according to an embodiment of the present application. As shown in Figure 2, based on a hierarchical neural network, a feature representation of cell types is learned from single-cell RNA expression data. The workflow of the entire model is as follows: first, the input single-cell RNA gene expression matrix express x enters the Encoder module. Then, the model sequentially passes through a series of global feature extraction layers (Global1, Global2,..., Globan) and local feature extraction layers (Local1, Local2,..., Localn), and gradually extracts hierarchical features G1, G2,..., Gn and classification features C1, C2,..., Cn of each layer. For each global feature extraction layer of the layer, the hierarchical feature Gn of the layer is spliced with the initial cell feature generated by the Encoder as the input feature of the n+1 layer. During the model training process, the classification features C1, C2,..., Cn will be used to learn the classification of cells in the layer. When the model proceeds to the last layer, the hierarchical feature Gn of the last layer will be spliced with the initial cell feature generated by the Encoder as the global feature Gh of the cell. The global feature Gh will be used to learn which level (level cls) the cell belongs to and which global classification (celltype cls) the cell belongs to.
[0058] In the output part shown in Figure 2, all are fully connected layers, which are used to classify the extracted features respectively.
[0059] The present embodiment introduces a dynamic cell hierarchical annotation model, which can automatically adjust the cell hierarchical relationship according to the change of data, and improve the adaptability of the model on different data sets.
[0060] Optionally, after the feature extraction and cell type classification by the initial hierarchical classification network model, it further includes: determining the hierarchical level and the global cell type to which the cell belongs based on the global feature of the cell, determining the corresponding local cell classification based on the local feature extracted by each layer; accumulating the cross-entropy of each layer of local cell classification to obtain a local classification result; calculating a model loss value based on the hierarchical level, the global cell type and the local classification result of the cell; and iteratively updating the initial hierarchical classification network model based on the model loss value.
[0061] The calculation of the loss function is to add the cross entropy of the level classification (level cls), the global cell type classification (celltype cls), and the local classification of each layer (local 1, local 2,...lcoal n), and to constrain the loss of the level classification and the local classification by a weight parameter β. Here, the weight parameter β is preset, and the greater β is, the more the model tends to learn the hierarchical structure of the cell type; the smaller β is, the more the model tends to learn the classification features of the cell type. For example, the value of β is set to 1 or other preset values by default during the test process, which is not limited here. Alternatively, the value of β can be dynamically adjusted, for example, after each round of training, the value of β is dynamically adjusted according to the loss of the hierarchical classification and the cell classification (including the local classification and the global cell classification). When the hierarchical loss is larger than the cell classification loss, the value of β is increased; when the hierarchical loss is smaller than the cell classification loss, the value of β is decreased. In this embodiment, the calculation formula of the loss function is Loss=global_loss+β*(cls_loss+local_loss). The initial hierarchical classification network model is iteratively updated based on the model loss value.
[0062] It should be noted that the Encoder module mentioned in this embodiment uses a fully connected neural network as an encoder to compress the input high-dimensional gene expression features into N-dimensional low-dimensional representations. The network structure is fully connected layer->ReLU->BatchNorm->Dropout. The network structure of the Global module and the Local module is consistent with the network structure of the Encoder.
[0063] In this embodiment, by fully considering the hierarchical relationship between cells, using a high-accuracy parameter-free annotation model and a lightweight model structure, and using large-scale training set data, the accuracy and efficiency of cell type annotation of single-cell RNA sequencing data are significantly improved.
[0064] Optionally, based on the cell features, the step of outputting the annotation result of the target cell in the hierarchical cell classification system comprises: determining the cell level and the global cell type of the target cell in the hierarchical cell classification system based on the global features; determining the local cell classification of the target cell in each level of the hierarchical cell classification system based on the local features; and combining the global cell type and the local cell classification of each level to output the cell type annotation result of the target cell.
[0065] When outputting the cell type annotation result of the target cell, a standardized hierarchical annotation tool can be used to output the annotation result containing the final cell type.
[0066] After obtaining the hierarchical cell annotation model, the single-cell RNA sequencing data can be standardized and annotated by running the standardized hierarchical annotation tool of the hierarchical cell annotation model, and then the de-standardized annotation data is used for downstream biological information analysis, such as differential gene analysis, feature gene identification, gene regulation network, intercellular communication analysis, etc. The model annotation result has gain for downstream analysis.
[0067] Through the above embodiments, the standardized hierarchical annotation tool of the hierarchical cell annotation model can be provided, and the unified interface and data preprocessing process of various generative pre-training transformer models in single-cell RNA sequencing data analysis are realized, which significantly improves the compatibility, analysis efficiency and result interpretability of the model.
[0068] The application will be described below in combination with another alternative embodiment.
[0069] Fig. 3 is a schematic diagram of another alternative standardized hierarchical cell annotation tool based on single-cell transcriptome data according to an embodiment of the application. As shown in Fig. 3, the tool includes a model training module and a model prediction module.
[0070] The model training module will be described first with single-cell RNA data set as test data:
[0071] (1) The original data is preprocessed to obtain transcriptome data, and cells with less than 200 genes and genes expressed in less than 3 cells are filtered. The single-cell gene expression matrix is normalized, and the information of cell hierarchy and sample hierarchy is standardized to obtain single-cell transcriptome data that can be trained and used.
[0072] (2) As shown in Fig. 3, in the training process, a plurality of single-cell transcriptome data of cells and cell type labels that have been annotated are provided. The preprocessed single-cell transcriptome data and cell type labels are input into the hierarchical multi-label classification network to automatically extract a plurality of hierarchical cell features, including global features and local features. Based on these global features and local features, the cell hierarchy and cell type to which the cell belongs are found, and the annotation result of each cell in the hierarchical cell classification system is given.
[0073] (3) After training, as shown in Fig. 3, the model prediction stage is entered, and new single-cell transcriptome data is input into the trained model. The model is used for prediction to obtain the cell hierarchy and cell type to which the cell belongs.
[0074] The embodiments of the application can not only be applied to cell type annotation of single-cell RNA sequencing data, but also be applied to classification and annotation tasks of other high-throughput biological data, such as proteomics, metabolomics and microbiomics, etc. fields, further expanding its application range and technical influence.
[0075] The embodiment of the present application solves the problem of low accuracy in processing complex cell hierarchical structure in the prior art, making the annotation result more accurate and reliable. In addition, the lightweight model structure and optimized algorithm design greatly reduce the computational complexity and resource demand, improve the processing speed, and make large-scale data processing more efficient. The training and running cost of the model is significantly reduced, which can efficiently run in a resource-limited environment.
[0076] The following will be described in detail in conjunction with another embodiment.
[0077] Embodiment two
[0078] The cell annotation device provided in the embodiment comprises a plurality of implementation units, each implementation unit corresponding to each implementation step in the above embodiment one, and the specific implementation steps and embodiments of each implementation unit are described in the above embodiment one and will not be repeated here.
[0079] FIG. 4 is a schematic diagram of an optional cell annotation device according to an embodiment of the present application. As shown in FIG. 4, the cell annotation device comprises a cell feature extraction unit 41 and a cell annotation unit 42.
[0080] The cell feature extraction unit 41 is configured to input the gene expression matrix of the target cell into the hierarchical cell annotation model and extract M levels of cell features, wherein the cell features comprise global features and local features, the global features are used to determine the hierarchical level and the global cell type to which the cell belongs, and the local features are used to determine the local cell classification of each hierarchical level, and M is an integer greater than 1.
[0081] The cell annotation unit 42 is configured to output the annotation result of the target cell in the hierarchical cell classification system based on the cell features.
[0082] The cell annotation device can input the gene expression matrix of the target cell into the hierarchical cell annotation model through the cell feature extraction unit 41 to extract M levels of cell features, and output the annotation result of the target cell in the hierarchical cell classification system based on the cell features through the cell annotation unit 42, wherein the cell features comprise global features and local features, the global features are used to determine the hierarchical level and the global cell type to which the cell belongs, and the local features are used to determine the local cell classification of each hierarchical level. In this embodiment, the hierarchical cell annotation model is used to automatically extract the features of single cells, which can obtain the hierarchical level and the global cell type to which the cell belongs through global features, and obtain the local cell classification of each hierarchical level through local features. The hierarchical relationship between cells is fully considered, so that the model can efficiently and accurately complete the cell type annotation task and obtain accurate cell type annotation results, thereby solving the technical problem of low accuracy in cell type annotation of single cells in related technologies.
[0083] Optionally, the cell annotation device further comprises: a data filtering unit, configured to extract a single-cell RNA sequencing data set of the target cell, filter cells with a number of genes less than a first quantity threshold in the single-cell RNA sequencing data set, and filter genes expressed by less than a second quantity threshold of cells, to obtain an initial gene expression matrix before inputting the gene expression matrix of the target cell into the hierarchical cell annotation model; and a normalization unit, configured to perform normalization processing on the initial gene expression matrix to obtain a preprocessed gene expression matrix of the target cell.
[0084] Optionally, the hierarchical cell annotation model comprises: an encoder module, N global feature extraction layers, and N local feature extraction layers, where N is a positive integer greater than 1.
[0085] Optionally, the hierarchical cell annotation model is pre-trained, and the cell annotation device comprises the following when training the hierarchical cell annotation model: a model input unit, configured to input a single-cell gene expression matrix in a gene database into an initial hierarchical classification network model, perform feature extraction and cell type classification by the initial hierarchical classification network model, and train the initial hierarchical classification network model; a model training unit, configured to input a test data set into the trained initial hierarchical classification network model, extract cell features at multiple levels by the initial hierarchical classification network model, and output an annotation result of each cell in a hierarchical cell classification system based on the cell features; and a model confirmation unit, configured to confirm that the model training is complete and obtain the hierarchical cell annotation model when an accuracy of the annotation result exceeds a preset accuracy threshold.
[0086] Optionally, the model input unit comprises: a matrix input module, configured to input the single-cell gene expression matrix into the encoder module in the initial hierarchical classification network model to generate initial cell features; a feature extraction module, configured to input the single-cell gene expression matrix into the i-th global feature extraction layer in the initial hierarchical classification network model in sequence to obtain hierarchical features extracted at each level, where i is a positive integer less than or equal to N; a feature splicing module, configured to splice the hierarchical features output by the i-th global feature extraction layer with the initial cell features and input into the i+1-th global feature layer until the hierarchical features output by the N-th layer are spliced with the initial cell features to obtain global features of the cell; and a classification module, configured to input the single-cell gene expression matrix into the i-th local feature extraction layer in the initial hierarchical classification network model in sequence, classify the cell by each local feature extraction layer, and obtain local features.
[0087] Optionally, the cell annotation apparatus further comprises: a first cell classification unit configured to determine a global cell type and a hierarchy to which a cell belongs based on the global features of the cell after feature extraction and cell type classification by the initial hierarchical classification network model, and determine a local cell classification corresponding to each hierarchy based on the local features extracted for each hierarchy; a second cell classification unit configured to accumulate cross-entropy of each local cell classification to obtain a local classification result; a loss value calculation unit configured to calculate a model loss value based on the global cell type, the hierarchy to which the cell belongs, and the local classification result; and a model constraint module configured to iteratively update the initial hierarchical classification network model based on the model loss value.
[0088] Optionally, the cell annotation unit comprises: a determination module configured to determine a global cell type and a hierarchy to which a target cell belongs in a hierarchical cell classification system based on the global features; a cell positioning module configured to determine a local cell classification of the target cell in each hierarchy in the hierarchical cell classification system based on the local features; and a type determination module configured to output a cell type annotation result of the target cell by combining the global cell type and the local cell classification of each hierarchy.
[0089] The cell annotation apparatus can further comprise a processor and a memory, and the cell feature extraction unit 41 and the cell annotation unit 42 are stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.
[0090] The processor comprises a core, and the core retrieves the corresponding program units from the memory. The core can be one or more, and the cell annotation based on single-cell RNA sequencing data can be realized by adjusting the core parameters.
[0091] The memory can comprise a non-permanent memory in a computer readable medium, a random access memory (RAM), and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.
[0092] According to another aspect of the embodiments of the present application, an electronic device is also provided, which comprises one or more processors and a memory, and the memory is configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the cell annotation method of any of the above.
[0093] According to another aspect of the embodiments of the present application, a computer program product is also provided, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the cell annotation method of any of the above.
[0094] The application further provides a computer program product comprising a computer program, which, when executed by a processor, implements the steps of the cell annotation method in the embodiments of the application, and the steps comprise: inputting a gene expression matrix of a target cell into a hierarchical cell annotation model, and extracting M levels of cell features, wherein the cell features comprise global features and local features, the global features are used to determine a global cell type and a hierarchy to which the cell belongs, the local features are used to determine a local cell classification of each hierarchy, and M is an integer greater than 1; and outputting an annotation result of the target cell in a hierarchical cell classification system based on the cell features.
[0095] FIG. 5 is a hardware structure block diagram of an electronic device (or a mobile device) for a cell annotation method according to an embodiment of the application. As shown in FIG. 5, the electronic device can include one or more processors 502 (the processor 502 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 504 for storing data. In addition, the electronic device can further include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. Those skilled in the art can understand that the structure shown in FIG. 5 is only schematic, and does not limit the structure of the above-mentioned electronic device. For example, the electronic device can further include more or fewer components than those shown in FIG. 5, or have a different configuration from that shown in FIG. 5.
[0096] The above-mentioned serial numbers of the embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0097] In the above-mentioned embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0098] In the several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the device embodiment described above is only schematic. For example, the division of the units can be a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.
[0099] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0100] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0101] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various program code storage media.
[0102] The above is only the preferred embodiment of the present application, it should be noted that for those skilled in the art, without departing from the principles of the present application, can make a number of improvements and refinements, these improvements and refinements should also be considered as the protection scope of the present application.
Claims
1. A cell annotation method, comprising: inputting a gene expression matrix of a target cell into a hierarchical cell annotation model to extract M levels of cell features, wherein the cell features comprise global features and local features, the global features are used to determine a global cell type and a hierarchy to which the cell belongs, the local features are used to determine a local cell classification of each hierarchy, and M is an integer greater than 1; outputting an annotation result of the target cell in a hierarchical cell classification system based on the cell features.
2. The cell annotation method of claim 1, wherein, Before inputting the gene expression matrix of the target cell into the hierarchical cell annotation model, further comprising: extracting a single-cell RNA sequencing data set of the target cell, filtering cells with a number of genes less than a first quantity threshold in the single-cell RNA sequencing data set, and filtering genes expressed by less than a second quantity threshold of cells to obtain an initial gene expression matrix; normalizing the initial gene expression matrix to obtain a preprocessed gene expression matrix of the target cell.
3. The cell annotation method of claim 1, wherein, The hierarchical cell annotation model comprises an encoder module, N global feature extraction layers, and N local feature extraction layers, wherein N is a positive integer greater than 1.
4. The cell annotation method of claim 1, wherein, The hierarchical cell annotation model is pre-trained, and when training the hierarchical cell annotation model, comprising: inputting a single-cell gene expression matrix in a gene database into an initial hierarchical classification network model to extract features and classify cell types by the initial hierarchical classification network model, and training the initial hierarchical classification network model; inputting a test data set into the trained initial hierarchical classification network model to extract cell features of multiple hierarchies by the initial hierarchical classification network model, and outputting an annotation result of each cell in a hierarchical cell classification system based on the cell features; in a case where an accuracy of the annotation result exceeds a preset accuracy threshold, confirming that the model training is completed to obtain the hierarchical cell annotation model.
5. The cell annotation method of claim 4, wherein, The step of extracting features by the initial hierarchical classification network model comprises: inputting the single-cell gene expression matrix into an encoder module in the initial hierarchical classification network model to generate initial cell features; inputting the single-cell gene expression matrix into an i-th global feature extraction layer in the initial hierarchical classification network model in sequence to obtain hierarchical features extracted by each layer, wherein i is a positive integer less than or equal to N; concatenating the hierarchical features output by the i-th global feature extraction layer with the initial cell features and inputting into an i+1-th global feature layer until the hierarchical features output by the N-th layer are concatenated with the initial cell features to obtain global features of the cell; inputting the single-cell gene expression matrix into an i-th local feature extraction layer in the initial hierarchical classification network model in sequence to classify cells by each local feature extraction layer to obtain local features.
6. The cell annotation method of claim 5, wherein, After extracting features and classifying cell types by the initial hierarchical classification network model, further comprising: determining a global cell type and a hierarchy to which the cell belongs based on the global features of the cell, and determining a corresponding local cell classification based on the local features extracted by each layer. cross-entropy of the local cell classification of each layer is accumulated to obtain a local classification result; a model loss value is calculated based on the hierarchical classification of the cell, the global cell type, and the local classification result; the initial hierarchical classification network model is iteratively updated based on the model loss value.
7. The cell annotation method of claim 1, wherein, The annotation result at least includes a cell type. The step of outputting the annotation result of the target cell in the hierarchical cell classification system based on the cell features includes: determining the hierarchical classification of the target cell in the hierarchical cell classification system based on the global features and the global cell type; determining the local cell classification of the target cell in each hierarchical classification in the hierarchical cell classification system based on the local features; combining the global cell type and the local cell classification of each hierarchical classification, and outputting the cell type annotation result of the target cell.
8. A cell annotation device, comprising: a cell feature extraction unit configured to input a gene expression matrix of a target cell into a hierarchical cell annotation model to extract M hierarchical cell features, wherein the cell features include global features and local features, the global features are used to determine the hierarchical classification of the cell and the global cell type, the local features are used to determine the local cell classification of each hierarchical classification, and M is an integer greater than 1; a cell annotation unit configured to output an annotation result of the target cell in a hierarchical cell classification system based on the cell features. When the one or more programs are executed by the one or more processors, the one or more processors implement the cell annotation method of any one of claims 1-7.
9. An electronic device, comprising one or more processors and memory storing one or more programs, wherein, 10. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the cell annotation method of any one of claims 1-7.
Citation Information
Patent Citations
Cell data annotation method, device, equipment and medium
CN115116549A
Construction method and device of scRNA-Seq cell type annotation database and electronic equipment
CN115579069A
ScRNA-seq cell type annotation method based on graph neural network and feature fusion
CN115881232A
Gene expression representation learning method and device based on single-cell RNA sequencing data
CN116434834A
Single-cell multi-omics cell type annotation method based on pre-training
CN119132426A