A transcriptome annotation method and system based on a large language model
By fusing single-cell spatial coordinates and gene expression values into pseudo-image modal data, and combining the cross-modal alignment and functional semantic space construction of a large language model, the problems of rough spatial topology modeling, low cross-modal alignment accuracy, and limited annotation of non-model species in single-cell spatial transcriptome annotation are solved, achieving higher-precision annotation and cross-species functional mapping.
Patent Information
- Application Number
- CN202510817866.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Existing technologies in single-cell spatial transcriptome annotation have problems such as rough spatial topology modeling, low cross-modal alignment accuracy, limited annotation of non-model species, and rigid semantic mapping, making it difficult to effectively capture the dynamic characteristics of complex tissue microenvironments and achieve cross-species functional mapping.
The single-cell spatial coordinates and gene expression values are fused into pseudo-image modal data, spatial topological features are extracted, and combined with the medical database through cross-modal alignment to construct a functional semantic space. The semantic similarity is calculated using a large language model for annotation to achieve cross-species functional inference.
It improves the microenvironmental analysis accuracy of single-cell spatial transcriptome annotation, reduces noise interference, improves annotation accuracy, breaks through model species dependence, and realizes cross-species functional semantic equivalence inference.
Smart Images

Figure CN120356514B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a transcriptome annotation method and system based on a large language model, and belongs to the interdisciplinary field of bioinformatics and computational biology. Background Art
[0002] Currently, existing methods such as heat maps or scatter plots only statically associate single-cell spatial coordinates with gene expression values, and lack the ability to dynamically model spatial topological structures. For example, traditional technologies cannot grid discrete cell positions and convert them into image modal data, resulting in the neglect of key features such as spatial proximity and pore structure, which limits the accuracy of analyzing complex tissue microenvironments. The integration of medical databases such as known cell type marker gene libraries with single-cell spatial features often relies on simple linear regression or shallow neural networks, making it difficult to capture nonlinear associations between cross-modal data. Current gene annotation tools such as DAVID and GO enrichment analysis are mainly based on the functional inference of homologous genes in model species such as humans and mice, and their semantic similarity calculations only rely on Gene Ontology (GO) terms. The static hierarchical structure does not combine the semantic space modeling of the functional description text of all species proteins, which leads to functional bias or blind spots of "no homologous annotations" when annotating genes in non-model species. Traditional methods calculate similarity through gene sequence alignment or conserved domain matching, but cannot effectively utilize the semantic information of functional description texts, such as the natural language descriptions in UniProtKB. In addition, existing technologies such as BLAST lack a dynamic expansion mechanism when there are no reliable homologous annotations, resulting in low annotation coverage. Gene function annotations for non-model species mostly use manual alignment or low-throughput experimental verification, which is time-consuming and costly. Although existing algorithms support gene family clustering, they do not combine the semantic reasoning capabilities of large language models, making it difficult to achieve intelligent mapping of cross-species functional families.
[0003] Therefore, existing technologies face core problems in single-cell spatial transcriptome annotation, such as rough spatial topology modeling, low cross-modal alignment accuracy, limited annotation of non-model species, and rigid semantic mapping. Summary of the Invention
[0004] The present invention provides a transcriptome annotation method and system based on a large language model, the main purpose of which is to reduce the core problems faced in single-cell spatial transcriptome annotation, such as rough spatial topology modeling, low cross-modal alignment accuracy, limited annotation of non-model species, and rigid semantic mapping.
[0005] To achieve the above objectives, the present invention provides a transcriptome annotation method based on a large language model, comprising:
[0006] fusing single-cell spatial coordinates and gene expression values into pseudo-image modality data, and extracting spatial topological features of the pseudo-image modality data;
[0007] Performing cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector, and analyzing the cell type probability corresponding to the cross-modal embedding vector;
[0008] Collect functional description texts of proteins from all species in UniProtKB, construct a functional semantic space of the functional description texts, project non-model species into the functional semantic space, and obtain gene expression embeddings in the functional semantic space;
[0009] Calculating semantic similarity between the gene expression embedding and homologous genes of a reference species, and converting the gene expression embedding into a semantic mapping relationship using a large language model based on the semantic similarity;
[0010] The cell type probability and the semantic mapping relationship are used to determine the transcriptome annotation result.
[0011] Optionally, fusing the single cell spatial coordinates and gene expression values into pseudo image modality data includes:
[0012] Obtaining the coordinate space corresponding to the single cell spatial coordinates;
[0013] Gridding the coordinate space to obtain a gridded space;
[0014] Querying the grid corresponding to the single cell spatial coordinates in the gridded space to discretize the single cell spatial coordinates into pixel points;
[0015] Filling the gene expression value into the pixel point to obtain a pixel value;
[0016] Pseudo image modality data is determined based on the pixel points and the pixel values.
[0017] Optionally, extracting the spatial topological features of the pseudo image modality data includes:
[0018] Converting a grid space formed by pixels in the pseudo image modality data into a cube complex;
[0019] constructing a filter model of the cube complex using pixel values;
[0020] Determining a filter value for the pixel based on the filter model;
[0021] Based on the filter value, sorting the pixels from low to high to obtain a sub-complex;
[0022] Calculating the homology group of the subcomplex under different filter values, the homology group including connectivity, number of holes, and number of cavities;
[0023] Recording the generation filter value when the topological feature is generated and the extinction filter value when the topological feature is extinct;
[0024] Constructing a persistence graph of the topological feature with the generation filter value as the horizontal coordinate and the extinction filter value as the vertical coordinate;
[0025] The persistence map is used as a spatial topological feature of the pseudo image modality data.
[0026] Optionally, performing cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector includes:
[0027] Converting the spatial topological feature into a first eigenvector;
[0028] converting the cell type information in the medical database into a second feature vector;
[0029] Using the first feature vector and the second feature vector as a query vector and a key-value pair vector respectively;
[0030] Calculating a dot product between the query vector and the key vector in the key-value pair vector to obtain an attention score;
[0031] Normalizing the attention score to a weight value through an activation function;
[0032] Performing weighted summation on the median vector of the key-value pair vector using the weight value to obtain a weighted feature vector;
[0033] A nonlinear transformation is performed on the weighted feature vector to obtain an aligned cross-modal embedding vector.
[0034] Optionally, analyzing the cell type probability corresponding to the cross-modal embedding vector includes:
[0035] Collect cross-modal embedding vector samples over a historical period;
[0036] Using a classifier to identify a cell type probability sample corresponding to the cross-modal embedding vector sample;
[0037] Taking the cell type probability sample as the output vector, and taking the single cell spatial coordinate sample corresponding to the cross-modal embedding vector sample and the cross-modal embedding vector sample as the input vector;
[0038] defining a radial basis function of the input vector, a Gaussian process regression model between the output vector and the input vector;
[0039] When optimizing the parameters of the radial basis function using a preset marginal likelihood function, performing parameter fitting on the Gaussian process regression model based on the output vector and the input vector to obtain a fitted regression model;
[0040] The fitted regression model is used to output the cell type probability corresponding to the cross-modal embedding vector.
[0041] Optionally, constructing the functional semantic space of the functional description text includes:
[0042] Using a natural language processing model to perform text embedding on the function description text to obtain a semantic vector;
[0043] Modeling gene-function relationships in UniProtKB as a knowledge graph;
[0044] The knowledge graph includes gene nodes, function nodes and gene-function relationship edges;
[0045] After using the semantic vector as the initial vector of the functional node in the knowledge graph, the knowledge graph is subjected to graph embedding learning through a graph convolutional network to obtain a functional semantic space.
[0046] Optionally, projecting the non-model species into the functional semantic space to obtain gene expression embedding in the functional semantic space includes:
[0047] The gene expression values of the non-model species are projected into the functional semantic space through an autoencoder to obtain the gene expression embedding of the functional semantic space.
[0048] Optionally, calculating the semantic similarity between the gene expression embedding and homologous genes of a reference species includes:
[0049] Obtaining a gene ontology between the gene expression embedding and the homologous gene;
[0050] querying the hierarchical structure of the gene ontology;
[0051] respectively querying the first functional node and the second functional node corresponding to the gene expression embedding and the homologous gene in the hierarchical structure;
[0052] Querying the lowest common ancestor of the first function node and the second function node in the hierarchical structure;
[0053] According to the hierarchical structure, the information content of the lowest common ancestor is calculated using the following formula:
[0054] ;
[0055] in, Indicates the amount of information, represents the frequency of the lowest common ancestor in the hierarchy;
[0056] The amount of information is used as semantic similarity.
[0057] Optionally, converting the gene expression embedding into a semantic mapping relationship using a large language model based on the semantic similarity includes:
[0058] When the semantic similarity is less than a preset similarity threshold, it is determined that the gene expression embedding has no reliable homology annotation in the reference species;
[0059] When it is determined that the gene expression embedding has no reliable homologous annotation in the reference species, the gene expression embedding is mapped to a preset gene-function family using a domain adaptation method and the large language model to obtain an updated target gene;
[0060] performing gene set expansion on the updated target genes to obtain an expanded gene set;
[0061] Semantic mapping relationships are extracted from the expanded gene set.
[0062] In order to solve the above problems, the present invention also provides a transcriptome annotation system based on a large language model, the system comprising:
[0063] a feature extraction module, configured to fuse the single cell spatial coordinates and gene expression values into pseudo image modal data and extract spatial topological features of the pseudo image modal data;
[0064] a probability analysis module, configured to perform cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector, and analyze the cell type probability corresponding to the cross-modal embedding vector;
[0065] The species projection module is used to collect functional description texts of proteins from all species in UniProtKB, construct a functional semantic space of the functional description texts, project non-model species into the functional semantic space, and obtain gene expression embeddings in the functional semantic space;
[0066] A gene conversion module is used to calculate the semantic similarity between the gene expression embedding and the homologous genes of the reference species, and based on the semantic similarity, use a large language model to convert the gene expression embedding into a semantic mapping relationship;
[0067] A result determination module is used to determine the transcriptome annotation result by using the cell type probability and the semantic mapping relationship.
[0068] Compared with the problems described in the background technology, the embodiment of the present invention fuses the single-cell spatial coordinates and gene expression values into pseudo-image modal data, generates pseudo-image modal data with gridded spatial coordinates, and combines subsequent persistent homology to extract topological features, thereby dynamically capturing spatial structure and improving the accuracy of microenvironment analysis. Furthermore, the embodiment of the present invention cross-modally aligns the spatial topological features with a preset medical database, and uses the attention mechanism to weightedly align the medical database and the spatial topological features, and subsequently models the cell type probability through Gaussian process regression, thereby reducing noise interference and improving annotation accuracy. Furthermore, the embodiment of the present invention breaks through the dependence on model species by constructing a functional semantic space of the functional description text and projecting non-model species into the functional semantic space, thereby realizing cross-species functional semantic equivalence inference. Furthermore, the embodiment of the present invention calculates the semantic similarity between the gene expression embedding and the homologous genes of the reference species to enhance the biological rationality of the functional similarity judgment. Therefore, the transcriptome annotation method and system based on the large language model provided by the embodiments of the present invention can reduce the core problems faced in single-cell spatial transcriptome annotation, such as rough spatial topology modeling, low cross-modal alignment accuracy, limited annotation of non-model species, and rigid semantic mapping. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of a process for a transcriptome annotation method based on a large language model according to an embodiment of the present invention;
[0070] Figure 2 A schematic diagram of modules for implementing the large language model-based transcriptome annotation system provided in one embodiment of the present invention.
[0071] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0072] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0073] The embodiment of the present application provides a transcriptome annotation method based on a large language model. The execution subject of the transcriptome annotation method based on a large language model includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the transcriptome annotation method based on a large language model can be executed by software or hardware installed on a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0074] Example 1:
[0075] Reference Figure 1 FIG. 1 is a flow chart of a transcriptome annotation method based on a large language model according to an embodiment of the present invention. In this embodiment, the transcriptome annotation method based on a large language model includes:
[0076] S1. Fusion of single-cell spatial coordinates and gene expression values into pseudo-image modal data, and extraction of spatial topological features of the pseudo-image modal data.
[0077] The embodiment of the present invention fuses single-cell spatial coordinates and gene expression values into pseudo-image modal data, generates pseudo-image modal data with gridded spatial coordinates, and combines subsequent persistent coherence to extract topological features, thereby dynamically capturing spatial structure and improving the accuracy of microenvironment analysis.
[0078] Among them, the single-cell spatial coordinates refer to the physical position coordinates of a single cell in a tissue or sample, which are usually obtained through spatial transcriptomics technology, etc. The gene expression value refers to the expression level of a gene in a specific cell, which is usually obtained through transcriptome sequencing and other technologies and can be used to reflect the activity level of the gene.
[0079] In one embodiment of the present invention, the fusion of single-cell spatial coordinates and gene expression values into pseudo-image modal data includes: obtaining a coordinate space corresponding to the single-cell spatial coordinates; gridding the coordinate space to obtain a gridded space; querying the grid corresponding to the single-cell spatial coordinates in the gridded space to discretize the single-cell spatial coordinates into pixel points; filling the gene expression values into the pixel points to obtain pixel values; and determining the pseudo-image modal data from the pixel points and the pixel values.
[0080] Optionally, the details of the above-mentioned fusion of single-cell spatial coordinates and gene expression values into pseudo-image modal data are as follows: collect the spatial coordinate data of single cells, determine their coordinate range and coordinate system; divide the coordinate space into regular grid units, and discretize the continuous spatial coordinates into grid coordinates; find the grid unit where each single-cell spatial coordinate is located, and represent the cell position information as pixel points in the grid; associate the gene expression value with the corresponding pixel point, and use the gene expression value as the pixel value of the pixel point; integrate all pixel points and their pixel values together to form an image-like data form, that is, pseudo-image modal data.
[0081] In one embodiment of the present invention, the extraction of spatial topological features of the pseudo image modal data includes: converting the grid space composed of pixels in the pseudo image modal data into a cube complex; constructing a filtering model of the cube complex using pixel values; determining the filtering value of the pixel points based on the filtering model; sorting the pixel points from low to high based on the filtering value to obtain a sub-complex; calculating the homology group of the sub-complex under different filtering values, the homology group including connectivity, number of holes and number of cavities; recording the generation filtering value when the topological feature is generated and the extinction filtering value when the topological feature is extinct; constructing a persistence graph of the topological feature with the generation filtering value as the horizontal coordinate and the extinction filtering value as the vertical coordinate; and using the persistence graph as the spatial topological feature of the pseudo image modal data.
[0082] Optionally, the details of the above-mentioned extraction of spatial topological features of the pseudo-image modal data are as follows: the grid space formed by the pixel points in the pseudo-image modal data is used as a cube complex, each pixel point corresponds to a vertex of a cube, and geometric structures such as edges, faces and cubes are formed between adjacent pixel points, thereby establishing a topological structure representation of the entire pseudo-image, defining a filtering function, which is usually a function related to the research target such as gene expression value, and sorting each pixel point in the cube complex according to the value of the filtering function to form a filtering process, for example, sorting from low to high according to the gene expression value, and gradually constructing a series of nested sub-complexes. As the filtering process proceeds , under different filter value thresholds, calculate the homology group of the corresponding subcomplex, including topological features such as connectivity (0-dimensional homology group), number of holes (1-dimensional homology group) and number of cavities (2-dimensional homology group). For example, when the filter value is small, there may be only a few pixels that meet the conditions, and the connectivity is low at this time. As the filter value increases, the number of pixels that meet the conditions increases, the connectivity gradually increases, and structures such as holes may gradually appear. Record the filter value of the generation and extinction of each topological feature, that is, its survival range, and draw it in the form of a point in a plane coordinate system to generate a persistence graph. The horizontal axis represents the filter value of the topological feature generation, and the vertical axis represents the filter value of the extinction. The coordinates of the point (b, d) indicate that the topological feature is generated at the filter value b and extinct at the filter value d. The persistence is ,Each point in the persistence graph represents a topological feature, ,and its location and density reflect the stability and distribution ,of different topological structures in the pseudo image.
[0083] S2. Perform cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector, and analyze the cell type probability corresponding to the cross-modal embedding vector.
[0084] The embodiment of the present invention performs cross-modal alignment between the spatial topological features and a preset medical database, utilizes the attention mechanism to weightedly align the medical database and the spatial topological features, and subsequently models the cell type probability through Gaussian process regression, thereby reducing noise interference and improving annotation accuracy.
[0085] The medical database refers to a database that stores medical-related data, such as a cell type marker gene library, which can be used to provide reference information for comparative analysis.
[0086] In one embodiment of the present invention, the cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector includes: converting the spatial topological features into a first eigenvector; converting the cell type information in the medical database into a second eigenvector; using the first eigenvector and the second eigenvector as a query vector and a key-value pair vector, respectively; calculating the dot product between the query vector and the key vector in the key-value pair vector to obtain an attention score; normalizing the attention score to a weight value through an activation function; using the weight value to perform a weighted summation on the median vector of the key-value pair vector to obtain a weighted eigenvector; and performing a nonlinear transformation on the weighted eigenvector to obtain an aligned cross-modal embedding vector.
[0087] Optionally, the details of the above-mentioned extraction of spatial topological features of the pseudo-image modal data are as follows: the spatial topological features (that is, the persistence graph) are vectorized to obtain a first feature vector, the persistence graph is modeled as a graph structure, the nodes represent the points in the persistence graph, and the weights of the edges can be defined based on the distance or similarity between the points. Then, a graph embedding algorithm is applied to learn the embedding vector of each node, and the embedding vectors of all nodes are aggregated to obtain the feature vector of the entire persistence graph; for cell type information, one-hot encoding can be used, or word embedding technology such as bag of words and TF-IDF can be used. or inputting the cell type description text into a natural language processing model (such as BERT) to generate a semantic vector; using the weight value to weight the sum of the value vectors in the key-value pair vector to obtain a weighted feature vector: multiplying the value vector in each key-value pair vector by the corresponding weight value, and then summing all the weighted value vectors to obtain a weighted feature vector; performing a nonlinear transformation on the weighted feature vector to obtain an aligned cross-modal embedding vector: using a nonlinear transformation model such as a multilayer perceptron (MLP) to perform a nonlinear transformation on the weighted feature vector.
[0088] In one embodiment of the present invention, the analysis of the cell type probability corresponding to the cross-modal embedding vector includes: collecting cross-modal embedding vector samples within a historical period; using a classifier to identify cell type probability samples corresponding to the cross-modal embedding vector samples; using the cell type probability samples as output vectors, and using the single-cell spatial coordinate samples corresponding to the cross-modal embedding vector samples and the cross-modal embedding vector samples as input vectors; defining a radial basis function of the input vector, a Gaussian process regression model between the output vector and the input vector; when optimizing the parameters of the radial basis function using a preset marginal likelihood function, performing parameter fitting on the Gaussian process regression model based on the output vector and the input vector to obtain a fitted regression model; and using the fitted regression model to output the cell type probability corresponding to the cross-modal embedding vector.
[0089] Optionally, the details of the cell type probability corresponding to the cross-modal embedding vector described in the above analysis are as follows: collect cross-modal embedding vector samples within a certain time range in the past. These samples will be used to train and establish a regression model to provide a data basis for subsequent cell type probability prediction. Use a classifier (such as a support vector machine, random forest, neural network, etc.) to classify the cross-modal embedding vector samples to obtain corresponding cell type probability samples. The classifier can predict the probability of each sample belonging to a different cell type by learning the mapping relationship between the cross-modal embedding vector and the cell type. The cell type probability sample is used as the output vector, and the single cell spatial coordinate sample and the cross-modal embedding vector sample are used as the input vector to construct the input and output pairs of the regression model to provide a data format for subsequent regression analysis and define the radial basis function of the input vector ( RBF), RBF is a commonly used kernel function used to measure the similarity between each input vector, and establish a Gaussian process regression model between the output vector (cell type probability) and the input vector (single cell spatial coordinates and cross-modal embedding vector). The Gaussian process regression model can model and predict the input-output relationship, and output the probability distribution of the predicted value. The marginal likelihood function is used to optimize the parameters of the radial basis function. The marginal likelihood function is a function that measures the degree of fit of the model to the data. By optimizing the marginal likelihood function, the optimal radial basis function parameters can be found. At the same time, the Gaussian process regression model is parameter fitted to obtain a fitted regression model, so that the model can better predict the cell type probability, and the fitted regression model is used to predict the new cross-modal embedding vector and output the corresponding cell type probability.
[0090] S3. Collect functional description texts of proteins from all species in UniProtKB, construct a functional semantic space for the functional description texts, project non-model species into the functional semantic space, and obtain gene expression embeddings in the functional semantic space.
[0091] The embodiment of the present invention breaks through the dependence on model species and realizes cross-species functional semantic equivalence inference by constructing a functional semantic space of the functional description text and projecting non-model species into the functional semantic space.
[0092] Among them, the UniProtKB refers to a database that provides protein sequence and function information, including functional descriptions of a large number of known proteins, gene-protein relationships and other information. The functional description text refers to a text description of the function of a gene or protein, such as Gene Ontology (GO) annotations, domain information, etc., which can be used to understand the biological function of a gene or protein.
[0093] In one embodiment of the present invention, constructing the functional semantic space of the functional description text includes: using a natural language processing model to perform text embedding on the functional description text to obtain a semantic vector; modeling the gene-function relationship in UniProtKB as a knowledge graph; wherein the knowledge graph includes gene nodes, function nodes and gene-function relationship edges; after using the semantic vector as the initial vector of the function node in the knowledge graph, the knowledge graph is subjected to graph embedding learning through a graph convolutional network to obtain a functional semantic space.
[0094] The functional semantic space is constructed based on the gene function description text, in which each dimension corresponds to a gene function.
[0095] Optionally, the details of the above-mentioned construction of the functional semantic space of the functional description text are as follows: a natural language processing model (such as BERT, Word2Vec, GloVe, etc.) is used to embed the functional description text to obtain a semantic vector, and the gene-function relationship in UniProtKB is modeled as a knowledge graph. The knowledge graph includes gene nodes, function nodes and gene-function relationship edges. Gene nodes represent different genes, function nodes represent different functions, and gene-function relationship edges represent the association between genes and functions. The semantic vector is used as the initial vector of the function node, and the graph convolutional network (GCN) is used to perform graph embedding learning on the knowledge graph. GCN updates the embedding vector of the node by aggregating the feature information of the node and its neighboring nodes, and finally obtains a functional semantic space, in which the distance between nodes reflects the similarity between gene functions. The embedding vectors of all function nodes obtained through the above-mentioned graph embedding learning process together constitute the functional semantic space. In this space, the vector representation of each function node not only contains the semantic information of the original functional description, but also integrates the structural information in the gene-function relationship graph, so that vector operations can be used in this space to analyze and compare the similarity between different gene functions.
[0096] Furthermore, in the embodiments of the present invention, the non-model species refer to species that have not been widely selected by the research community for in-depth research. These species usually lack the easy-to-study characteristics of model organisms, such as inability to grow in the laboratory, long life cycle, low reproduction rate or complex genetic background.
[0097] In one embodiment of the present invention, projecting the non-model species into the functional semantic space to obtain the gene expression embedding of the functional semantic space includes: projecting the gene expression value of the non-model species into the functional semantic space through an autoencoder to obtain the gene expression embedding of the functional semantic space.
[0098] Among them, the gene expression embedding is the representation of gene expression values in the functional semantic space, which inherits the characteristics of the functional semantic space. Each dimension in the functional semantic space is related to gene function, so the gene expression embedding also contains the connection between gene expression and function.
[0099] Optionally, the details of the above-mentioned projection of non-model species into the functional semantic space are as follows: The autoencoder is a neural network model consisting of an encoder and a decoder. The encoder maps gene expression values to low-dimensional embedding vectors in the functional semantic space, and the decoder restores the low-dimensional embedding vectors to original gene expression values. By training the autoencoder, the decoder can restore the input data as accurately as possible, thereby obtaining gene expression embedding. The gene expression embedding vector not only contains the expression pattern of the gene, but also indirectly reflects the functional characteristics of the gene through the mapping of the functional semantic space.
[0100] S4. Calculate the semantic similarity between the gene expression embedding and the homologous genes of the reference species, and based on the semantic similarity, use a large language model to convert the gene expression embedding into a semantic mapping relationship.
[0101] The embodiment of the present invention calculates the semantic similarity between the gene expression embedding and the homologous genes of the reference species to enhance the biological rationality of the functional similarity determination.
[0102] Among them, the homologous genes of the reference species refer to genes in the reference species that have similar sequences and functions to the genes corresponding to the gene expression embeddings. They are differentiated from common ancestral genes through the evolutionary process and therefore perform similar biological functions in different species. When calculating the semantic similarity between the gene expression embeddings and the homologous genes of the reference species, the homologous genes of the reference species provide known functional annotation information for the target genes corresponding to the gene expression embeddings.
[0103] In one embodiment of the present invention, calculating the semantic similarity between the gene expression embedding and the homologous gene of the reference species includes: obtaining the gene ontology between the gene expression embedding and the homologous gene; querying the hierarchical structure of the gene ontology; respectively querying the first functional node and the second functional node corresponding to the gene expression embedding and the homologous gene in the hierarchical structure; querying the lowest common ancestor of the first functional node and the second functional node in the hierarchical structure; and calculating the information content of the lowest common ancestor according to the hierarchical structure using the following formula:
[0104] ;
[0105] in, Indicates the amount of information, represents the frequency of the lowest common ancestor in the hierarchy;
[0106] The amount of information is used as semantic similarity.
[0107] Optionally, the details of the above calculation of the semantic similarity between the gene expression embedding and the homologous genes of the reference species are as follows: Gene Ontology (GO) is a dynamic, hierarchical knowledge base that provides a standard description of gene function. First, the hierarchical structure of GO is obtained, which is like a family tree. Each node on the tree represents a gene function, and the branches represent the hierarchical relationship between functions. At the same time, the annotation information of the gene expression embedding and the reference gene in GO, that is, their corresponding functional nodes, is also required. For a pair of functional nodes of the target gene and the reference gene, their lowest common ancestor (LCA, that is, the lowest common parent node of the two nodes) in the GO hierarchy is found. The more frequently a functional node appears in the gene annotation, the smaller its information content. Conversely, the less it appears, the greater its information content, that is, the greater the information content of the rarest lowest common ancestor. The information content of this LCA node is taken as the similarity between the first functional node and the second functional node. For example, if the gene expression The embedded functional node is "cellular respiration" and the functional node of the reference gene is "mitochondrial respiration". Their LCA may be "respiratory process", so the information amount is the information amount of the "respiratory process" node. For example: Assume that the gene expression embedding vector E obtained after gene A is processed by the autoencoder, and the homologous gene B of the reference species has been annotated to the functional node F2 in the gene ontology (GO). After analysis, the gene expression embedding vector E of gene A is associated with the functional node F1 "cellular respiration". The functional node corresponding to the homologous gene B is F2 "mitochondrial respiration". Among them, the gene expression embedding vector E of gene A is analyzed and associated with the functional node F1 "cellular respiration". The process of calculating the similarity between the gene expression embedding vector E and the embedding vector EF1 of the functional node F1 is as follows: that is, using methods such as cosine similarity to calculate the similarity between the gene expression embedding vector E and the embedding vector EF1 of the functional node F1. If the similarity is higher than a preset threshold, the gene expression embedding vector E is considered to be associated with the functional node F1.
[0108] Furthermore, the embodiment of the present invention converts the gene expression embedding into a semantic mapping relationship based on the semantic similarity using a large language model, thereby solving the "annotation blind spot" and improving the annotation coverage of non-model species.
[0109] In one embodiment of the present invention, based on the semantic similarity, the gene expression embedding is converted into a semantic mapping relationship using a large language model, including: when the semantic similarity is less than a preset similarity threshold, it is determined that the gene expression embedding has no reliable homologous annotation in the reference species; after it is determined that the gene expression embedding has no reliable homologous annotation in the reference species, the domain adaptation method and the large language model are used to map the gene expression embedding to a preset gene-function family to obtain an updated target gene; the gene set of the updated target gene is expanded to obtain an extended gene set; and the semantic mapping relationship is extracted from the extended gene set.
[0110] Optionally, the details of converting the gene expression embeddings into semantic mapping relationships using a large language model based on the semantic similarity are as follows: when the similarity is lower than a preset threshold of 0.7, for gene expression embeddings without reliable homologous annotations, a domain adaptation method is used to map them to a preset gene-function family. The domain adaptation method can use strategies such as adversarial training and feature alignment to make the feature distributions of the source domain (reference species) and the target domain (non-model species) close. At the same time, the large language model is used to provide richer semantic information for the gene expression embeddings. For example, the gene expression embeddings and the functional description text of the reference gene are input into the large language model together. Through the generation capability of the model, a possible functional description is generated for the gene expression embedding, or through the embedding layer of the model, the gene expression embedding is converted into the same functional semantic space as the reference gene. The gene set of the updated target gene is expanded. Functional similarity search, literature mining, etc. can be used to find other genes with similar functions or correlations to the genes corresponding to the gene expression embeddings, thereby expanding the coverage of the gene set and enhancing the comprehensiveness of the functional annotation. The semantic mapping relationship is extracted from the expanded gene set, that is, the semantic association between each gene and its corresponding function is determined.
[0111] S5. Determine a transcriptome annotation result using the cell type probability and the semantic mapping relationship.
[0112] It should be noted that the final annotation results include the labeling of cell types corresponding to the cell type probability and the updated semantic mapping relationship. In spatial transcriptome analysis, the cell type probability distribution provides probability values belonging to different cell types for each spatial location. After analysis and interpretation, these probability values can be converted into specific cell type annotations. The semantic mapping relationship can more accurately describe the function of genes, especially in cross-species annotation, providing a more reliable basis for the annotation of gene functions.
[0113] Compared with the problems described in the background technology, the embodiment of the present invention fuses the single-cell spatial coordinates and gene expression values into pseudo-image modal data, generates pseudo-image modal data with gridded spatial coordinates, and combines subsequent persistent homology to extract topological features, thereby dynamically capturing spatial structure and improving the accuracy of microenvironment analysis. Furthermore, the embodiment of the present invention cross-modally aligns the spatial topological features with a preset medical database, and uses the attention mechanism to weightedly align the medical database and the spatial topological features, and subsequently models the cell type probability through Gaussian process regression, thereby reducing noise interference and improving annotation accuracy. Furthermore, the embodiment of the present invention breaks through the dependence on model species by constructing a functional semantic space of the functional description text and projecting non-model species into the functional semantic space, thereby realizing cross-species functional semantic equivalence inference. Furthermore, the embodiment of the present invention calculates the semantic similarity between the gene expression embedding and the homologous genes of the reference species to enhance the biological rationality of the functional similarity judgment. Therefore, the transcriptome annotation method and system based on the large language model provided by the embodiments of the present invention can reduce the core problems faced in single-cell spatial transcriptome annotation, such as rough spatial topology modeling, low cross-modal alignment accuracy, limited annotation of non-model species, and rigid semantic mapping.
[0114] Example 2:
[0115] like Figure 2 , which is a functional module diagram of a transcriptome annotation system based on a large language model according to the present invention.
[0116] The large language model-based transcriptome annotation system 200 described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the large language model-based transcriptome annotation system can include a feature extraction module 201, a probability analysis module 202, a species projection module 203, a gene conversion module 204, and a result determination module 205. A module, also referred to as a unit, is a series of computer program segments that can be executed by an electronic device processor and perform a fixed function, and is stored in the electronic device's memory.
[0117] In the embodiment of the present invention, the functions of each module / unit are as follows:
[0118] The feature extraction module 201 is used to fuse the single cell spatial coordinates and the gene expression value into pseudo image modal data and extract the spatial topological features of the pseudo image modal data;
[0119] The probability analysis module 202 is configured to perform cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector, and analyze the cell type probability corresponding to the cross-modal embedding vector;
[0120] The species projection module 203 is used to collect functional description texts of proteins of all species in UniProtKB, construct a functional semantic space of the functional description texts, project non-model species into the functional semantic space, and obtain gene expression embeddings in the functional semantic space;
[0121] The gene conversion module 204 is used to calculate the semantic similarity between the gene expression embedding and the homologous gene of the reference species, and based on the semantic similarity, convert the gene expression embedding into a semantic mapping relationship using a large language model;
[0122] The result determination module 205 is configured to determine a transcriptome annotation result using the cell type probability and the semantic mapping relationship.
[0123] In detail, each module in the transcriptome annotation system 200 based on the large language model in the embodiment of the present invention adopts the same method as above when used. Figure 1 The same technical means are used as the transcriptome annotation method based on the large language model described in , and can produce the same technical effects, so they will not be repeated here.
[0124] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A transcriptome annotation method based on a large language model, characterized in that: The method comprises: fusing single-cell spatial coordinates and gene expression values into pseudo-image modality data, and extracting spatial topological features of the pseudo-image modality data; Performing cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector, and analyzing the cell type probability corresponding to the cross-modal embedding vector; Collect functional description texts of proteins from all species in UniProtKB, construct a functional semantic space of the functional description texts, project non-model species into the functional semantic space, and obtain gene expression embeddings in the functional semantic space; Calculating semantic similarity between the gene expression embedding and homologous genes of a reference species, and converting the gene expression embedding into a semantic mapping relationship using a large language model based on the semantic similarity; Determining a transcriptome annotation result using the cell type probability and the semantic mapping relationship; The extracting of spatial topological features of the pseudo image modality data includes: Converting a grid space formed by pixels in the pseudo image modality data into a cube complex; constructing a filter model of the cube complex using pixel values; Determining a filter value for the pixel based on the filter model; Based on the filter value, sorting the pixels from low to high to obtain a sub-complex; Calculating the homology group of the subcomplex under different filter values, the homology group including connectivity, number of holes, and number of cavities; Recording the generation filter value when the topological feature is generated and the extinction filter value when the topological feature is extinct; Constructing a persistence graph of the topological feature with the generation filter value as the horizontal coordinate and the extinction filter value as the vertical coordinate; using the persistence map as a spatial topological feature of the pseudo image modality data; The cross-modal alignment of the spatial topological features with a preset medical database to obtain an aligned cross-modal embedding vector includes: Converting the spatial topological feature into a first eigenvector; converting the cell type information in the medical database into a second feature vector; Using the first feature vector and the second feature vector as a query vector and a key-value pair vector respectively; Calculating a dot product between the query vector and the key vector in the key-value pair vector to obtain an attention score; Normalizing the attention score to a weight value through an activation function; Performing weighted summation on the median vector of the key-value pair vector using the weight value to obtain a weighted feature vector; A nonlinear transformation is performed on the weighted feature vector to obtain an aligned cross-modal embedding vector.
2. The transcriptome annotation method based on a large language model according to claim 1, wherein The method of fusing single cell spatial coordinates and gene expression values into pseudo image modality data includes: Obtaining the coordinate space corresponding to the single cell spatial coordinates; Gridding the coordinate space to obtain a gridded space; Querying the grid corresponding to the single cell spatial coordinates in the gridded space to discretize the single cell spatial coordinates into pixel points; Filling the gene expression value into the pixel point to obtain a pixel value; Pseudo image modality data is determined based on the pixel points and the pixel values.
3. The transcriptome annotation method based on a large language model according to claim 1, wherein The analyzing the cell type probability corresponding to the cross-modal embedding vector includes: Collect cross-modal embedding vector samples over a historical period; Using a classifier to identify a cell type probability sample corresponding to the cross-modal embedding vector sample; Taking the cell type probability sample as the output vector, and taking the single cell spatial coordinate sample corresponding to the cross-modal embedding vector sample and the cross-modal embedding vector sample as the input vector; defining a radial basis function of the input vector, a Gaussian process regression model between the output vector and the input vector; When optimizing the parameters of the radial basis function using a preset marginal likelihood function, performing parameter fitting on the Gaussian process regression model based on the output vector and the input vector to obtain a fitted regression model; The fitted regression model is used to output the cell type probability corresponding to the cross-modal embedding vector.
4. The transcriptome annotation method based on a large language model according to claim 1, wherein The constructing of the functional semantic space of the functional description text includes: Using a natural language processing model to perform text embedding on the function description text to obtain a semantic vector; Modeling gene-function relationships in UniProtKB as a knowledge graph; The knowledge graph includes gene nodes, function nodes and gene-function relationship edges; After using the semantic vector as the initial vector of the functional node in the knowledge graph, the knowledge graph is subjected to graph embedding learning through a graph convolutional network to obtain a functional semantic space.
5. The transcriptome annotation method based on a large language model according to claim 1, wherein The projecting of the non-model species into the functional semantic space to obtain gene expression embedding in the functional semantic space includes: The gene expression values of the non-model species are projected into the functional semantic space through an autoencoder to obtain the gene expression embedding of the functional semantic space.
6. The transcriptome annotation method based on a large language model according to claim 1, wherein The calculating of the semantic similarity between the gene expression embedding and the homologous genes of the reference species comprises: Obtaining a gene ontology between the gene expression embedding and the homologous gene; querying the hierarchical structure of the gene ontology; respectively querying the first functional node and the second functional node corresponding to the gene expression embedding and the homologous gene in the hierarchical structure; Querying the lowest common ancestor of the first function node and the second function node in the hierarchical structure; According to the hierarchical structure, the information content of the lowest common ancestor is calculated using the following formula: ; in, Indicates the amount of information, represents the frequency of the lowest common ancestor in the hierarchy; The amount of information is used as semantic similarity.
7. The transcriptome annotation method based on a large language model according to claim 1, wherein The converting the gene expression embedding into a semantic mapping relationship using a large language model based on the semantic similarity includes: When the semantic similarity is less than a preset similarity threshold, it is determined that the gene expression embedding has no reliable homology annotation in the reference species; When it is determined that the gene expression embedding has no reliable homologous annotation in the reference species, the gene expression embedding is mapped to a preset gene-function family using a domain adaptation method and the large language model to obtain an updated target gene; performing gene set expansion on the updated target genes to obtain an expanded gene set; Semantic mapping relationships are extracted from the expanded gene set.
8. A transcriptome annotation system based on a large language model, wherein the system is applied to the transcriptome annotation method based on a large language model according to any one of claims 1 to 7, characterized in that: The system comprises: a feature extraction module, configured to fuse the single cell spatial coordinates and gene expression values into pseudo image modal data and extract spatial topological features of the pseudo image modal data; a probability analysis module, configured to perform cross-modal alignment between the spatial topological features and a preset medical database to obtain an aligned cross-modal embedding vector, and analyze the cell type probability corresponding to the cross-modal embedding vector; The species projection module is used to collect functional description texts of proteins from all species in UniProtKB, construct a functional semantic space of the functional description texts, project non-model species into the functional semantic space, and obtain gene expression embeddings in the functional semantic space; A gene conversion module is used to calculate the semantic similarity between the gene expression embedding and the homologous genes of the reference species, and based on the semantic similarity, use a large language model to convert the gene expression embedding into a semantic mapping relationship; A result determination module is used to determine the transcriptome annotation result by using the cell type probability and the semantic mapping relationship.
Citation Information
Patent Citations
Cross-species single cell annotation method
CN118298926A
Annotation model training method, cell type annotation method and related equipment
CN119108025A
Single-cell transcriptome cell annotation method and system fused with large language model
CN119601094A
Graph neural network construction method and apparatus, and electronic device and storage medium
WO2025007301A1
Cited By
Large language model driven single-cell double-score iterative annotation method
CN122392655A
Large language model driven single-cell double-score iterative annotation method
CN122392655B