Large language model driven single-cell double-score iterative annotation method
By employing a large language model-driven single-cell dual-score iterative annotation method, combined with physical evidence constraints and information entropy evaluation, the problems of insufficient generalization ability and inconsistent results in single-cell transcriptome sequencing annotation are solved, achieving high-resolution and robust cell type identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HIGH PRECISION (ZHEJIANG ANJI) PRECISION MEDICINE TECH CO LTD
- Filing Date
- 2026-06-12
- Publication Date
- 2026-07-14
AI Technical Summary
Existing single-cell transcriptome sequencing annotation methods have reduced generalization ability when faced with non-model species and abnormal cells, are easily affected by batch effects, and lack effective modeling of gene expression specificity, resulting in coarse or inconsistent annotation results, especially in complex samples where it is difficult to achieve fine-grained and reliable tag output.
A single-cell dual-score iterative annotation method driven by a large language model is adopted. By constructing an adaptive threshold gating mechanism and semantic stability assessment, combined with physical evidence constraints and information entropy calculation, the annotation results are closed-loop repair and refinement are achieved.
It improves the resolution and stability of annotation results, reduces misjudgments that do not conform to expression characteristics, enhances the applicability and interpretability of complex samples, and ensures that the annotation results are consistent with real biological characteristics.
Smart Images

Figure CN122392655A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of bioinformatics and single-cell sequencing data processing, specifically to a large language model-driven single-cell dual-scoring iterative annotation method and system. Background Technology
[0002] Single-cell transcriptome sequencing (scRNA-seq) has significant advantages in revealing cellular heterogeneity, but automated and accurate annotation of cell types remains a key challenge. Current common annotation methods, such as traditional methods, mainly rely on similarity matching of reference maps or weighted scoring based on marker gene libraries. Representative tools include SingleR, CellTypist, ScType, and SCSA. In recent years, with the development of generative artificial intelligence, annotation methods based on large language models have also emerged, such as GPT CellType, demonstrating the feasibility of zero-shot prediction using differentially expressed genes (DEGs)-driven models. In patent technology, Chinese patent CN119601094B proposes improving prediction stability by constructing cue words containing significantly upregulated genes, sampling multiple times, and taking the mode as the final result; Chinese patent CN120356514B attempts to integrate spatial coordinates and gene expression into pseudo-image data, extracting topological features and aligning them with medical databases to achieve cross-modal semantic mapping. Furthermore, some recent studies are exploring different directions for improvement. For example, CASSIA uses multi-agent verification for results, mLLMCelltype uses Shannon entropy to assess uncertainty, and LICT introduces an iterative correction strategy based on text feedback. Although these methods have made some progress in automation, there is still room for improvement in terms of the rigor of biological evidence and the robustness of the algorithms.
[0003] Mapping methods, such as SingleR and CellTypist, are heavily reliant on reference datasets. When analyzing non-model species or cells in abnormal states, the lack of suitable reference maps often leads to decreased generalization ability. Furthermore, these methods are susceptible to batch effects, resulting in misclassification. Scoring-based models like ScType and SCSA often employ statistical methods such as linear summation or Fisher's exact test, but they typically fail to effectively model the specificity of gene expression and struggle to penalize genes widely expressed across multiple cell types. Consequently, annotation results often remain at a relatively coarse categorical level.
[0004] Methods based on large language models (such as Chinese patent CN119601094B) essentially rely on existing knowledge for inference without directly constraining the original expression matrix. This approach lacks a mechanism to verify the predicted results against actual expression data, easily leading to results inconsistent with true biological characteristics. Furthermore, while the mode determination method can improve output consistency, it does not fully reflect the uncertainty within the model. For example, when the model diverges among similar cell subtypes, even if the final results are consistent, it is difficult to determine whether they are based on stable evidence.
[0005] Furthermore, the cross-modal method described in Chinese patent CN120356514B lacks flexibility when faced with information lacking corresponding annotations. Although methods such as CASSIA, mLLMCelltype, and LICT introduce feedback or iterative mechanisms, they rely primarily on unstructured text information and lack a systematic integration of quantitative information such as gene expression intensity and expression ratio. This makes it difficult to accurately locate parts inconsistent with the data during the correction process, resulting in slow convergence speed and limiting further refinement of cell subtypes.
[0006] When reliable results cannot be obtained after multiple iterations, existing methods often lack backtracking strategies based on cell ontology, potentially resulting in unreliable fine-grained labels. This remains a problem to be solved in biomedical research that requires high interpretability and traceability. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a single-cell dual-scoring iterative annotation method driven by a large language model. This method achieves closed-loop repair and refinement of annotation results by constructing a dual gating mechanism based on adaptive threshold-based physical evidence constraints and semantic stability evaluation.
[0008] On the one hand, this invention provides a single-cell dual-scoring iterative annotation method driven by a large language model, the specific technical solution of which includes the following steps:
[0009] Step S1: Feature Extraction and Preliminary Prediction Generation
[0010] S11 Data Preprocessing and Dimensionality Reduction: Quality control was performed on the original single-cell transcriptome expression matrix to remove low-quality cells and low-abundance expressed genes; data standardization was performed, and sequencing depth differences were eliminated through expression scaling and log-transformation. Dimensionality reduction was performed using hypervariable gene selection and principal component analysis, and graph-based clustering algorithms were used to define cell clusters within the expression space.
[0011] S12 Differential Feature Extraction: For each cell cluster, statistical tests are used to extract a set of differentially expressed genes (DEGs) that are significantly upregulated. The quantitative screening indicators include the p-value of significant difference, the average fold change in expression, and the proportion of positive expression within the cluster.
[0012] S13 Prompt Construction and Prediction Generation: This involves constructing structured natural language prompts, which are sequentially divided into a background domain, a data domain, and a canonical domain. The background domain is used to inject the species classification information and anatomical tissue origin of the sample to be tested. The data domain embeds the differentially expressed gene set extracted in step S12 and explicitly labels the corresponding cell group information. The canonical domain, while setting output format constraints, further explicitly specifies the target granularity level of cell type annotation, including but not limited to coarse-grained, medium-grained, or fine-grained granularity. It requires the large language model to perform zero-shot inference within the specified granularity range and output results conforming to the preset format. Based on this, preliminary cell type annotation results are generated by calling the large language model through an application programming interface (API).
[0013] Furthermore, the coarse granularity refers to cell type, the medium granularity refers to functional subpopulation, and the fine granularity refers to specific differentiation state or subtype;
[0014] Furthermore, the preset format is a single entity noun;
[0015] Furthermore, the large language model can be selected as Gemini-3.
[0016] Step S2: Two-dimensional quantitative score calculation
[0017] Step S21: Database test scoring (S DB )calculate
[0018] ① Reverse retrieval of recognized marker genes: Using the preliminary cell type annotation tags generated in step S1 as query terms, perform text matching in the pre-set cell marker gene library to extract the set of recognized marker genes (Canonical Markers) corresponding to the predicted cell type;
[0019] Furthermore, the cell marker gene library can be selected as the Cell Marker database.
[0020] ②Statistical analysis of physical expression features: Map the recognized marker gene set back to the original single-cell gene expression matrix and extract its physical statistical features in the target cluster:
[0021] Coverage (C): Calculate the proportion of positive cells for each gene in the recognized marker gene set within the target cluster, and take the average value to characterize the overall coverage of the marker genes by the cluster;
[0022] Intensity (I): Calculate the normalized expression level of each gene in the recognized marker gene set within the target cluster, and take the average value to reflect the overall expression intensity;
[0023] Specificity (S): For the set of recognized marker genes, calculate the positive proportion of each gene outside the target cluster (global outpopulation cells), and take the maximum value for inverse transformation. It is used to characterize the constraint effect of the least specific marker gene on the overall determination.
[0024] ③ Harmonic Mean Quantitative Modeling: Construct a harmonic mean model to calculate database verification scores. By utilizing the extreme value penalty effect of this model, the support of preliminary annotation tags in the underlying physical expression data is quantified. When recognized marker genes show broad-spectrum expression or missing expression, a scoring penalty is applied.
[0025] Step S22: Model self-test scoring calculate
[0026] ① Independent sampling and candidate distribution acquisition: For the prompt words constructed in step S13, perform N independent inference samplings using a large language model to obtain a complete set of candidate tags covering the diversity of outputs.
[0027] ② Semantic Alignment and Merging: The entire set of candidate labels is fed back to the large language model, and a semantic alignment instruction is issued. The model is driven to merge and map semantically equivalent but spelled differently labels based on cellular taxonomy consensus, and outputs a standard label set and its corresponding occurrence frequency. .
[0028] ③ Normalized information entropy calculation: Calculate the normalized information entropy based on the merged probability distribution to obtain the model self-test score: This score is used to quantify the internal semantic consistency and knowledge fluctuation of the large language model in relation to the clustering recognition logic.
[0029] Step S3: Dynamic threshold gating and structured feedback
[0030] S31 Adaptive Threshold Baseline Calibration: Traverse the first round of double scores for all clusters in the current sample, and extract... and High-confidence clusters, all ranking in the top percentile globally, are used as the anchor set. The statistical mean of the two scores in the anchor set is calculated and adjusted down by a specified standard deviation, which are then used as adaptive gating thresholds for the current dataset. and .
[0031] S32 Matching Result Matrix Construction: For any cluster whose dual scores do not reach the adaptive gating threshold, extract the physical statistical details of its recognized marker genes and construct a structured matching result matrix containing quantitative fields such as gene name, predicted role, expression ratio within the cluster, highest expression ratio in the outgroup, and state of evidence contradiction.
[0032] Step S4: Convergence Determination and Granularity Rollback Strategy
[0033] S41 Normal Convergence: If both scores after the S3 step of repair cross the adaptive gating threshold, the system is considered to have converged, and the current cell type annotation is output.
[0034] S42 Large Language Model-Driven Granular Degradation and Rollback: If the target cluster reaches the preset maximum number of iterations and its dual score still does not cross the adaptive gating threshold, the current abnormal annotation is intercepted and a safe rollback mechanism is triggered. The system no longer requires the model to continue generating candidate subtypes of equal or finer granularity. Instead, it forcibly issues the following general granularity downgrading instruction template: "Based on the expression matrix evidence of the current cluster, please perform granularity downgrading judgment on candidate cell type labels. Input includes: current candidate label, parent lineage path of the label, differentially expressed genes of the target cluster, coverage / expression intensity / specificity of key marker genes of the candidate label, evidence of failure, and labels of previous iteration failures. Please output according to the following rules: If the subdivision modifier or specific subtype lacks key marker gene support, delete the modifier and backtrack upwards along the lineage; if the label still lacks expression evidence after backtracking, continue backtracking to the nearest parent label supported by the expression matrix; if there is contamination, low quality, or two-cell signal, add a low-confidence warning after the parent label. Output format: final label, backtracking path, deleted subdivision modifier, evidence that does not support the original label, evidence that supports the final label, whether to issue a warning." The system ultimately extracts the backtracked label output by this template as the final result and adds a low-confidence warning label when the evidence is insufficient or there is a contamination signal.
[0035] On the other hand, the present invention also provides a large language model-driven single-cell cell type dual-scoring iterative annotation system, comprising:
[0036] ① Feature extraction and preliminary prediction generation module: used to implement step S1 described above;
[0037] ② Dual-dimensional quantitative scoring calculation module: used to implement step S2 described above;
[0038] ③ Dynamic threshold gating and structured feedback module: used to implement step S3 described above;
[0039] ④ Convergence determination and granularity degradation rollback module: used to implement step S4 described above.
[0040] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the large language model-driven single-cell dual-scoring iterative annotation method.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0042] 1. Reduce hallucinations through physical constraints and improve annotation resolution.
[0043] This invention introduces a database test score based on harmonic mean. The scoring system comprehensively considers the coverage, expression intensity, and specificity of marker genes. It naturally penalizes genes with high coverage but low specificity, thus guiding the model to prioritize judgments based on more discriminative biological evidence. This constraint effectively reduces annotation results that do not conform to expression characteristics and improves the resolution of cell type classification to some extent.
[0044] 2. Quantitatively evaluate the stability of the model output.
[0045] This invention introduces a model self-testing score based on normalized information entropy. Combining semantic alignment with other methods can reduce interference from synonymous expressions and quantify the model's fluctuations across multiple candidate labels. This metric helps identify unstable or contradictory predictions, thus providing a basis for subsequent screening and correction.
[0046] 3. Improve the effectiveness of iterative correction through structured feedback.
[0047] This invention constructs a matching result matrix that incorporates multidimensional statistical information. By feeding specific data inconsistencies back to the model, the correction process can be driven by clear evidence rather than simply generating repeated data, thereby improving the efficiency of the iterative process and the consistency of the results.
[0048] 4. Introduce adaptive and rollback mechanisms to improve overall robustness.
[0049] This invention designs an adaptive threshold based on data features, combined with granular control and a hierarchical backoff strategy. When the evidence is insufficient to support fine-grained classification, the system can automatically backoff to a more robust upper-level category, avoiding the risk of misjudgment caused by over-segmentation. This mechanism ensures the reasonableness of the results while also enhancing the applicability of the method to complex samples and non-pattern species.
[0050] 5. Demonstrating relative advantages in complex subgroup segmentation scenarios.
[0051] This invention provides expression matrix-level constraints and traceable evidence for subgroup subdivision within the same large group, identification of low-quality mixed populations, and interception of over-subdivision labels in complex samples such as tumor microenvironments. Attached Figure Description
[0052] Figure 1 This is a schematic diagram of the system module architecture provided for an embodiment of the present invention.
[0053] Figure 2 This is a flowchart illustrating the single-cell dual-scoring iterative annotation method driven by a large language model, as provided in an embodiment of the present invention. Detailed Implementation
[0054] The technical solutions described in this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. Obviously, the embodiments described in this specification are only a part of the feasible technical solutions of this invention. Other implementation methods obtained by those skilled in the art based on the embodiments of this invention without any creative effort should be considered to fall within the scope of protection of this invention. It should be noted that the data preprocessing, dimensionality reduction clustering, and other operations in step S1 are conventional techniques in the field of single-cell transcriptome analysis and can be implemented using standard workflows in toolkits such as Seurat and Scanpy. The specific algorithm selection (such as Louvain or Leiden clustering) does not affect the implementation of the core mechanism of this invention. The innovation of this invention lies in the subsequent dual-score iterative annotation method, rather than the data preprocessing step itself.
[0055] Example 1: CD4 in the microenvironment of human gastric cancer tissue + Automated Refined Annotation and Multidimensional Feedback Interception Mechanism for T Cells
[0056] Figure 1 This is a schematic diagram of the system module architecture in this embodiment, including four parts: a feature extraction and preliminary prediction generation module, a two-dimensional quantization scoring calculation module, a dynamic threshold gating and structured feedback module, and a convergence determination and granularity degradation fallback module. A more detailed flowchart is provided in this embodiment as follows: Figure 2 As shown, the method for iterative annotation of single-cell cell types with dual scoring driven by a large language model is explained, and the specific steps are as follows:
[0057] 1.1 Data Preprocessing and Differential Feature Extraction
[0058] This embodiment uses the Seurat (v4.3.0) software package based on the R language environment to perform rigorous preprocessing and quality control on the raw sequence expression matrix of single-cell transcriptomes from human gastric cancer tissue. First, a cellular-level filtering threshold was set: potential cell fragments and doublets with a total number of detected genes (nFeature_RNA) less than 500 or greater than 4000 were removed, and the mitochondrial gene expression ratio (percent.mt) was strictly controlled to be less than 10%. Subsequently, a global scaling normalization method (Log Normalization, scaling factor set to 10000) was used to standardize the retained high-quality cell expression matrix. The VST method was used to extract the top 2000 highly variable features from the expression matrix, and principal component analysis (PCA) was performed based on these features. The top 30 principal components (PCs1-30) capturing the main biological variance were extracted to construct a K-nearest neighbor (KNN) graph. The Louvain modular optimization method was specified in the graph clustering algorithm to divide the target cell population into 7 clusters (Cluster0 to Cluster6) with a resolution of 0.5.
[0059] In the feature gene extraction stage, the system calls the Wilcoxon rank-sum test to perform inter-group differential analysis on each cluster. The statistical test parameters for extracting differentially expressed genes are set as follows: significance p_val_adj < 0.05, mean fold change avg_log2FC > 0.5, and minimum expression proportion min.pct of the gene in the target cluster > 0.25. For the seven global clusters, the system sorts them in descending order of statistical significance and extracts the top 30 significantly upregulated genes in each subgroup as the analysis background. In this embodiment, the top 10 core genes of each cluster are displayed in the feature list.
[0060] Cluster0: NKG7, CCL5, HBB, HBA2, HBA1, GZMA, GZMB, GNLY, HLA-DRB1, CST7
[0061] Cluster1: S100A4, VIM, S100A11, IL32, S100A10, FXYD5, ANXA1, S100A6, CRIP1, SH3BGRL3
[0062] Cluster2: ZFP36L2, CXCR4, BTG1, DUSP2, TSC22D3, CCL5, TNFAIP3, SRGN, JUNB, FTH1
[0063] Cluster3: EIF1, FTH1, SRGN, ARID5B, LEPROTL1, EZR, NR3C1, EML4, UBC, RNF19A
[0064] Cluster4:MT-ND1, HBB, MT-CO2, VIM, TSC22D3, FOS, HBA1, DUSP1, PTGER4, NEAT1
[0065] Cluster5: IL32, HLA-A, CD74, TIGIT, FOXP3, S100A4, CYTOR, BATF, HLA-DRB1, CTLA4
[0066] Cluster6: STMN1, GAPDH, TUBA1B, H2AFZ, PCLAF, TYMS, HMGB2, HMGN2, TUBB, HMGB1
[0067] 1.2 Parallel Scheduling Annotation and Efficient Convergence of Regular Subpopulations
[0068] The system initiates the first round of automated annotation scheduling scripts. These scripts employ a parallel workflow, first automatically encapsulating the feature gene lists of each cluster into a preset prompt template. The prompt template is specifically designed as follows: "You are a senior bioinformatics expert. There is a set of differentially expressed gene data from single-cell transcriptomes of human gastric cancer tissue, clustered at [extracted cluster number]. The list of genes significantly upregulated in this cluster is: [extracted list of the top 30 feature genes]. Based on your prior biological knowledge, please determine the most likely cell type for this cluster. Please only output the cell type name, without explanation, annotating to the cell subpopulation level."
[0069] The script sends the loaded instructions in batches to the Gemini-3 Flash API interface. While acquiring the initial predicted labels, the script simultaneously activates the dual-dimensional quantization scoring module: on one hand, it uses a multi-path parallel sampling mechanism to repeatedly output the same prompt word 10 times, to calculate the model's self-check score in real time. On the other hand, the script retrieves the physical features corresponding to the predicted labels from a pre-set comprehensive biomarker reference database via asynchronous requests, and calculates the database test score in real time by mapping the underlying representation matrix. The adaptive gating threshold baseline for this batch of data is automatically calibrated as follows: Set to 0.70. The value was set to 0.85. In actual operation, most of the conventional clusters (Cluster 0, 1, 2, 5, and 6) showed high single-round convergence. The final classification annotation results for each cluster are as follows: Cluster 0 is identified as cytotoxic T cells (CD4+). + Tc); Cluster1 recognizes central memory T cells (CD4+). + Tcm); Cluster 2 recognizes it as effector memory T cells (CD4+). + Cluster 5 recognizes regulatory T cells (Tregs); Cluster 6 recognizes proliferating T cells (CD4+). + The dual scores of the above clusters successfully crossed the gating threshold, and the annotation results were completely consistent with the actual biological situation.
[0070] 1.3 Iterative Restriction and Precise Interception of the Anomalous Subpopulation (Cluster 4)
[0071] When processing Cluster 4, the underlying feature data exhibited high transcriptional disorder. Subsequent manual qualitative assessment and bioinformatics auditing confirmed that this population was actually a low-quality doublet population contaminated with erythrocyte free RNA, mitochondrial fragments, and highly stressed cells. Our system successfully achieved precise interception using the following logic flow:
[0072] Phase 1: Initial Bias Formation. When the system issues its initial prediction command, the large language model, faced with chaotic features including mitochondrial genes, hemoglobin genes, and stress signals, is misled by local factors and outputs an incorrect prediction, "Regulatory Tcell (Treg)".
[0073] Phase Two: Physical Evidence Interception. The system extracts Treg tags, retrieves core evidence genes such as IL2RA and FOXP3 from the biomarker reference database, and maps them back to the expression matrix for verification. Verification revealed that these core marker genes are almost not expressed in this cluster, with a database verification score of only 0.16. The model subsequently attempted to change several specific subtype tags, but failed to pass the expression matrix verification within the maximum number of iterations.
[0074] Phase 3: Interception and Early Warning. After identifying the risk of an infinite loop, the system executes a rollback according to the general granularity degradation instruction template: the current candidate label is a specific CD4 that has failed multiple rounds. + T functional subtype, parent path is specific functional subtype - CD4 + T-cell - T-cell, the evidence for failure to meet the criteria was the absence of key markers such as FOXP3 and IL2RA, and the dominance of pollution / stress signals. The model eventually regressed to the parent label "CD4".+ The system adds a "[Low Confidence / Potential Low Quality Group Warning]" label to the T cell, thereby enabling accurate identification and interception of non-true subgroups.
[0075] The general granularity downgrading instruction template is as follows: "Based on the expression matrix evidence of the current cluster, please perform granularity downgrading judgment on candidate cell type labels. Input includes: current candidate label, parent lineage path of the label, differentially expressed genes of the target cluster, coverage / expression intensity / specificity of key marker genes of the candidate label, evidence of failure, and labels of previous iteration failures. Please output according to the following rules: If the subdivision modifier or specific subtype lacks key marker gene support, delete the modifier and backtrack upwards along the lineage; if the label still lacks expression evidence after backtracking, continue backtracking to the nearest parent label that can be supported by the expression matrix; if there is contamination, low quality, or two-cell signal, add a low confidence warning after the parent label. The output format is: final label, backtracking path, deleted subdivision modifier, evidence that does not support the original label, evidence that supports the final label, and whether to issue a warning."
[0076] 1.4 Single-step granularity degradation and precision adaptation for over-subdivided subgroups (Cluster3)
[0077] For Cluster3, the system demonstrated its ability to automatically correct biases when encountering a normal cell subpopulation exhibiting an illusion of longitudinal over-resolution. Phase 1: Over-resolution prediction. The large language model captured signals such as NR3C1 in Cluster3; to achieve high-resolution annotation, it output "Terminally Exhausted CD4". + "T cell". Second stage: Physical gating interception. The system retrieves terminal exhaustion limiting markers such as HAVCR2 and LAYN corresponding to this tag and maps them back to the expression matrix for verification. The results show that the expression ratio of these limiting markers in this cluster is extremely low, with a database verification score of 0.35, failing to meet the gating standard. Third stage: Granularity degradation. The system executes a rollback according to the general granularity degradation instruction described in 1.3 Third Stage: The current candidate tag is "Terminally Exhausted CD4". + T cell", parent path is "Terminally Exhausted CD4" + Tcell”-Exhausted CD4+ T cell-CD4 + The T cell did not meet the criteria due to insufficient evidence of terminal exhaustion markers such as HAVCR2 and LAYN. The model removed the "Terminally" modifier and rolled back the output to "Exhausted CD4". +"T cell". After secondary validation, the database test score of the backtracked label rose to 0.78, successfully achieving convergence.
[0078] Example 2: Conventional Large Class Group Annotation and Complex CD4 + Comparative experiment on T cell subset subdivision
[0079] 2.1 Experimental Objective
[0080] This embodiment illustrates the practical improvements of the present invention compared to conventional LLM annotation methods. Conventional LLM annotation methods include GPTCelltype and the method described in Chinese patent CN119601094B, which constructs cue words based on significantly upregulated genes, performs multiple sampling, and takes the mode as the final result. These methods generally perform well in the identification of recognized large groups; therefore, this embodiment does not focus on simple large group identification as the main point of contention, but rather further examines its limitations when performing subgroup subdivision within the same large group in the complex tumor microenvironment.
[0081] 2.2 Comparison with Scenario 1: Recognized Major Class Annotations in Publicly Available PBMC 3k Data
[0082] This embodiment first uses a publicly available dataset for simple large-group identification comparison. The data source is the PBMC 3k filtered gene-barcode matrix (hg19) published by 10xGenomics. Standard single-cell clustering and differential expression analysis were performed on this publicly available data using Seurat, ultimately obtaining 2638 control cells, 13714 genes, and 9 clusters. The main markers of each cluster clearly correspond to recognized PBMC large groups: T cells, B cells, monocytes, NK cells, dendritic cells, and platelets all have typical markers. When these markers are input into GPTCelltype or the method described in Chinese patent CN119601094B based on multiple sampling and mode selection of significantly upregulated genes, it can usually stably output the corresponding large-group labels. The method of this invention also outputs the same or similar large-group results under the same input. This publicly available data comparison demonstrates that in scenarios with clear marker genes and coarse target granularity, conventional LLM annotation methods can meet the initial large-group annotation needs.
[0083] 2.3 Comparison Scenario 2: CD4 in a Complex Environment + T cell subset subgroups
[0084] CD4 in human gastric cancer tissue of Example 1 + In the T cell data, all clusters belong to CD4. +While T cell-related broad categories exist, further differentiation is needed to distinguish subpopulations or states such as cytotoxicity, memory, regulation, exhaustion, proliferation, stress, and low-quality confounding. This scenario differs from the generally accepted broad category identification in publicly available PBMC 3k: conventional LLM methods, GPTCelltype, or the multiple sampling mode method described in Chinese patent CN119601094B can usually determine whether it belongs to T cells or CD4 cells. + T cell range, but further determination of "which type of CD4" is needed. + When considering the "T subgroup," it is easily affected by localized high expression, contamination signals, or model prior bias. This invention returns the candidate subgroup label to the original expression matrix for scoring and feedback. Specific comparisons are shown in the table below.
[0085] 2.4 Processing method of the present invention
[0086] For the aforementioned complex subgroups, this invention does not directly accept single or mode labels from large language models. Instead, it maps the recognized marker genes corresponding to candidate labels back to the original expression matrix, calculates coverage, expression intensity, and specificity respectively, and combines this with the model's self-test score to determine whether the label has sufficient supporting evidence. When the model outputs overly detailed labels, this invention can detect whether restrictive marker genes are missing and back down unsupported modifiers. When there is confounding in the cluster due to mitochondrial genes, hemoglobin genes, or stress signals, this invention can identify the lack of reliable physical evidence for the label through low coverage and low specificity, thereby outputting a low-confidence warning or backing down to a more robust parent label.
[0087] 2.5 Comparative Conclusions
[0088] The comparative experiment shows that GPTCelltype and the Chinese patent CN119601094B method are suitable for initial screening of large groups with clear labels. However, they mainly rely on the knowledge inference and output consistency of language models on significantly upregulated genes, and the mode result cannot prove that the label is supported by the true expression matrix. As shown in Table 1, the advantages of this invention are concentrated in the subdivision of large groups in complex environments: on the one hand, it retains the convenience of conventional LLM methods in large group identification; on the other hand, through database verification scoring, model self-testing scoring, structured feedback, and granularity backoff mechanisms, it avoids problems in CD4... + In T cell subset subdivision, there is no evidence of over-subdivision or contamination-driven misjudgment, thus improving the reliability and interpretability of annotation for complex samples.
[0089] Table 1 Example 1 Classification Conventional LLM method for determination The problems exposed by this invention Results of the invention <![CDATA[Cytotoxic T cells (CD4 + Tc)]]> <![CDATA[CD4 + cytotoxicT cell]]> Consistent; this clear subgroup can be identified using conventional LLM methods. Consistent; this invention further provides evidence of expression matrix. <![CDATA[Central memory T cells (CD4 + Tcm)]]> <![CDATA[CD4 + memory Tcell]]> The general category is correct, but the granularity is too coarse and has not stabilized to Tcm. <![CDATA[Better; the present invention is refined to central memory T cells (CD4 + Tcm)]]> <![CDATA[Effector memory T cells (CD4 + Tem)]]> <![CDATA[CD4 + effectormemory T cell]]> Consistent; this subgroup can be identified using conventional LLM methods. Consistency; this invention confirms consistency through dual scoring. Regulatory T cells (Tregs) Regulatory Tcell Consistent; the group is clearly labeled. Consistent; this invention verifies evidence such as FOXP3 / CTLA4. <![CDATA[Proliferating CD4 + T cell)]]> Proliferating Tcell <![CDATA[Correct in the general direction but lacking CD4 + Parent-level qualification]]> <![CDATA[Better; the present invention outputs proliferating CD4 + T cell)]]> <![CDATA[Deplete CD4 + T cells (CD4 + Tex)]]> <![CDATA[TerminallyExhausted CD4 + T cell]]> Over-segmentation and the lack of evidence supporting the "Terminally modified" designation, such as HAVCR2 / LAYN, are problematic. <![CDATA[Better; the present invention reverts to depleting CD4 + T cell (CD4 + Tex)]]> <![CDATA[CD4 + T cell (low confidence / potential low-quality group early warning) Regulatory Tcell Misjudgment; polluted / low-quality groups were interpreted as specific functional subtypes. <![CDATA[Better; the present invention reverts to CD4 + T cell and issues a low-confidence warning]]>
[0090] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A single-cell bi-score iterative annotation method driven by a large language model, characterized in that, Includes the following steps: Step S1: Feature extraction and preliminary prediction generation, including: obtaining the single-cell transcriptome expression matrix, and after quality control, standardization, dimensionality reduction and clustering, extracting the set of significantly upregulated differentially expressed genes for each cell cluster; constructing structured cue words, which include background information of the sample to be tested, the set of differentially expressed genes and output format constraints, and calling a large language model to generate preliminary cell type annotation results; Step S2: Calculate the dual-dimensional quantitative score, which includes the database verification score and the model self-test score; Step S3: Dynamic threshold gating and structured feedback, including: adaptively calibrating the gating threshold based on the first round of dual scores for all clusters; when the database test score and / or model self-test score do not reach the adaptive gating threshold, extracting the physical statistical details of the recognized marker genes of the cluster and constructing a structured matching result matrix; constructing a feedback instruction by combining the structured matching result matrix with the previous round of prediction results and inputting it into the large language model for correction; Step S4: Convergence determination and granularity degradation rollback, including: if both scores after correction cross the adaptive gating threshold, convergence is determined and the current cell type annotation is output; if the two scores still do not cross the adaptive gating threshold after reaching the preset maximum number of iterations, the granularity degradation rollback mechanism is triggered and the rolled-back cell type label is output.
2. The method according to claim 1, characterized in that, In step S1, the prompt word also explicitly indicates the target granularity level of cell type annotation, including coarse-grained, medium-grained, or fine-grained, wherein coarse-grained refers to the cell type level, medium-grained refers to the functional subgroup level, and fine-grained refers to the specific differentiation state or subtype level.
3. The method according to claim 1, characterized in that, Step S2 includes the following steps: Step S21: Database verification scoring The calculation includes: using the preliminary cell type annotation results as query terms, retrieving and extracting a set of recognized marker genes from a pre-set cell marker gene library; mapping the set of recognized marker genes back to the original single-cell gene expression matrix, extracting its physical statistical features in the target cluster, the physical statistical features including coverage C, intensity I, and specificity S; constructing a harmonic mean model to calculate the database validation score. This is used to quantify the support of the preliminary cell type annotation results in the underlying physical expression data; Step S22: Model self-test scoring The calculation includes: for the prompt word, performing N independent inference samplings using a large language model to obtain a complete set of candidate tags, where N is an integer greater than 1; and semantically aligning and merging the complete set of candidate tags to obtain a standard tag set and its corresponding occurrence frequencies. Based on the merged probability distribution, the normalized information entropy is calculated to obtain the model self-test score: It is used to quantify the internal semantic consistency and knowledge fluctuation of a large language model in relation to the current clustering recognition logic.
4. The method according to claim 3, characterized in that, In step S21, the coverage C is the average proportion of positive cells for each gene in the recognized marker gene set within the target cluster; the intensity I is the average normalized expression level of each gene within the target cluster; and the specificity S is obtained by calculating the maximum positive proportion of each gene outside the target cluster and then taking the inverse of that value. .
5. The method according to claim 3, characterized in that, In step S22, the semantic alignment and merging involves calling a large language model based on cellular taxonomy consensus to merge and map semantically equivalent but spelledly different labels; the semantic equivalence means that two labels are merged into the same standard label after the semantic alignment and merging process.
6. The method according to claim 1, characterized in that, In step S3, the adaptive calibration gate threshold is specifically defined as follows: extracting high-confidence clusters from all clusters where both the database test score and the model self-test score are in the top percentile globally as anchor sets, calculating the statistical mean of the double scores of the anchor set and lowering it by a specified standard deviation, and using it as the adaptive gate threshold for the current dataset.
7. The method according to claim 1, characterized in that, In step S3, the structured matching result matrix includes gene name, predicted role, expression ratio within cluster, highest expression ratio in outgroup, and quantitative field of evidence contradiction status.
8. The method according to claim 1, characterized in that, In step S4, the granularity downgrade rollback mechanism includes: issuing a general granularity downgrade instruction template to the large language model, requiring the model to make a granularity downgrade judgment on candidate cell type labels based on the expression matrix evidence of the current cluster, including rolling back up the lineage to the parent label, deleting subdivision modifiers that lack support, and adding a low confidence warning label when the evidence is insufficient.
9. A large language model-driven single-cell cell type dual-scoring iterative annotation system, characterized in that, include: ① Feature extraction and preliminary prediction generation module: used to implement step S1 as described in claim 1; ② Dual-dimensional quantitative scoring calculation module: used to implement step S2 as described in claim 1; ③ Dynamic threshold gating and structured feedback module: used to implement step S3 as described in claim 1; ④ Convergence determination and granularity degradation rollback module: used to implement step S4 as described in claim 1.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method of any one of claims 1 to 8.