Method for immune cell state analysis based on single-cell transcriptome and spatial transcriptome
By combining single-cell transcriptomics and spatial transcriptomics, a method for analyzing the state of immune cells was constructed, which solved the problem of assessing the interaction between the intrinsic molecular characteristics of immune cells and the external environment. This enabled the precise quantification of the functional state of immune cells and the dynamic optimization of the model, thereby improving the reliability and adaptability of the assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI KECHENG INTELLIGENT HEALTH TECH CO LTD
- Filing Date
- 2026-07-06
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies cannot effectively link the interaction between the intrinsic molecular expression characteristics of immune cells and the external survival environment of tumors, lack a unified and standardized basis for evaluating the functional status of immune cells, have biases in data collection and analysis, and traditional prediction models have insufficient adaptability and generalization performance.
Based on the analysis of immune cell status using single-cell transcriptomics and spatial transcriptomics, an immune cell status mapping model is constructed through data collection, preprocessing, dimensionality reduction clustering, typing annotation, and spatial mapping. Combined with tumor local microenvironment parameters, multi-dimensional index calculation and error verification are performed, and the model is dynamically optimized to achieve accurate assessment and regulation.
It enables precise quantitative assessment of immune cell functional status, establishes the link between molecular expression characteristics and the external survival environment, rapidly distinguishes immune cell status, improves model adaptability and generalization ability, ensures the reliability and accuracy of assessment results, and supports targeted optimization of immune status.
Smart Images

Figure CN122493947A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of cell data analysis, and more specifically, relates to a method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics. Background Technology
[0002] With the rapid development of tumor immunotherapy and precision medicine, analyzing the functional state of immune cells in the tumor microenvironment has become a core step in revealing anti-tumor immune mechanisms and optimizing treatment strategies. Breakthroughs in single-cell transcriptomics technology have enabled the precise capture of molecular expression characteristics of individual immune cells, allowing for the differentiation of immune cell subtypes and the exploration of cellular functional heterogeneity at the gene level. This provides a powerful tool for a deeper understanding of the molecular regulatory basis of immune cell activation, exhaustion, and other states. Spatial transcriptomics technology further compensates for the lack of spatial information in single-cell transcriptomics, providing a direct view of the spatial distribution pattern of immune cells within tumor tissues and their positional relationships with surrounding components such as tumor cells and stromal cells. This offers a new perspective for analyzing intercellular spatial communication and microenvironment-dependent functional regulation. Currently, combining single-cell transcriptomics with spatial transcriptomics has become a mainstream trend in tumor immune microenvironment research. This approach integrates cellular molecular characteristics and spatial positioning information to comprehensively outline the survival status and functional characteristics of immune cells in complex microenvironments. Simultaneously, the regulatory role of the physicochemical properties, substance concentrations, and tissue structures of the tumor local microenvironment on immune cell function is receiving increasing attention, providing an important research direction for improving immune cell function and enhancing anti-tumor immune efficacy through microenvironment regulation. Chinese patent application CN106156540A discloses a method for analyzing immune differences between two states in an individual, including the following steps: acquiring first sequencing data and second sequencing data; splicing a first read from the first sequencing data and a second read from the second sequencing data to obtain a first spliced sequence and a second spliced sequence; aligning the first spliced sequence and the second spliced sequence with multiple CDR3 reference sequences to obtain a first CDR3 sequence and a second CDR3 sequence; and comparing the differences in the frequency of use of various VJ combination subtypes in the first CDR3 sequence and the second CDR3 sequence. Existing research cannot effectively link the interaction between the intrinsic molecular expression characteristics of immune cells and the external survival environment of tumors, resulting in a lack of unified and standardized criteria for assessing the functional status of immune cells. In addition, various biases generated during data collection and analysis are difficult to efficiently identify and correct. Traditional prediction models have insufficient adaptability and generalization performance, making it difficult to autonomously optimize and update the models based on actual conditions. Summary of the Invention
[0003] To address the problems in related technologies, this invention proposes an immune cell status analysis method based on single-cell transcriptomics and spatial transcriptomics to overcome the aforementioned technical problems in existing related technologies.
[0004] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: This invention provides a method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics, comprising the following steps: S1. Collect raw transcriptome data of historical immune cells, perform preprocessing, dimensionality reduction clustering, typing annotation, spatial mapping, functional enrichment processing, and analyze cell spatial communication, and obtain corresponding state index data. S2. Construct the final immune cell state mapping model based on the data collected and processed in S1; S3. Obtain the single-cell and spatial transcriptome data of the immune cells to be analyzed and process the data based on S1. Then, input the processed data into the mapping model in S2 for mapping. S4. Collect historical data on multiple sets of microenvironment parameters and the corresponding average values of immune cell state indices, and then construct a mapping model that ultimately affects the average state of immune cells. S5. Calculate the mean values of the current initial immune activation, exhaustion and tumor invasion capacity indices based on the mapping results in S3, and compare them with the corresponding thresholds respectively. If the thresholds are not met after comparison, proceed to S6; otherwise, no action is required. S6. Collect the current local tumor microenvironment parameter data and input them into the mapping model in S4. If the error between the mapping result and the mean calculated in S5 exceeds the standard, repeat the calculation operations in S3 and S5, and calculate the error again. S7. If the error still exceeds the standard after a finite number of repetitions in S6, then the mapping model in S4 is corrected. After correction, the current micro-environment parameter data are adjusted and mapped. Otherwise, no correction is made, and the adjustment and mapping are performed directly until the mapping result meets the threshold.
[0005] Preferably, step S1 includes the following steps: S11. Collect historical raw data of single-cell transcriptome and spatial transcriptome of immune cells in tumor tissue to obtain historical data of single-cell transcriptome and spatial transcriptome. The historical single-cell transcriptome data and the historical spatial transcriptome data were subjected to quality control, alignment, normalization, batch correction, and low-expression gene filtering to eliminate sequencing and sample batch bias, resulting in historically processed single-cell transcriptome data, historically processed spatial transcriptome data, and historically standardized gene expression matrix. S12. Perform dimensionality reduction and clustering on the historically processed single-cell transcriptome data to obtain historically clustered transcriptome data; then perform preliminary cell type identification, typing, and functional state annotation operations on the historically clustered transcriptome data to obtain historically type-annotated transcriptome data. The deconvolution algorithm is used to map the historical typing and annotated transcriptome data to the spatial transcriptome sites in the historical processed spatial transcriptome data, and decouple the immune cell composition ratio of each spatial transcriptome site. The historical typing annotation transcriptome data were screened and GO / KEGG pathway enrichment and GSVA single-cell functional enrichment were performed to obtain historical enriched transcriptome data. S13. Based on the historical enriched transcriptome data, analyze spatial cell communication between immune cells, between immune cells and tumor cells, and between immune cells and stromal cells. Then, based on the analysis results, screen characteristic gene sets of three dimensions: activation, exhaustion, and infiltration to obtain historical activation characteristic gene sets, historical exhaustion characteristic gene sets, and historical infiltration characteristic gene sets. S14. Obtain the historical data of the single-cell transcriptome and the historical data of the spatial transcriptome corresponding to each spatial site of each single cell, including the immune activation index, immune exhaustion index and tumor invasion ability index data, to obtain the historical immune activation index dataset, the historical immune exhaustion index dataset and the historical tumor invasion ability index dataset. This approach identifies feature gene sets across three functional dimensions. Simultaneously, it integrates immune function indices from individual cells and spatial sites in historical data to form a complete historical functional quantification dataset. This provides comprehensive and systematic historical data support for the subsequent construction of immune cell functional status characterization models and the realization of precise functional quantification assessment.
[0006] Preferably, step S2 includes the following steps: S21. Based on the historical normalized gene expression matrix, historical activation characteristic gene set, historical depletion characteristic gene set, historical invasion characteristic gene set, historical typing annotated transcriptome data, historical immune activation index dataset, historical immune depletion index dataset, and historical tumor invasion capacity index dataset, construct a mapping model with inputs of the normalized gene expression matrix, activation characteristic gene set, depletion characteristic gene set, invasion characteristic gene set, and typing annotated transcriptome data, and outputs of immune activation index data, immune depletion index data, and tumor invasion capacity index data, to obtain the final immune cell state mapping model. This model breaks through the limitations of a single data dimension. With the support of rich historical data, it has stronger generalization ability and prediction accuracy. It can stably output three key indices: immune activation, exhaustion and tumor invasion capacity, providing a reliable tool for rapid and accurate quantification of the functional status of immune cells in unknown samples.
[0007] Preferably, step S3 includes the following steps: S31. Obtain the single-cell transcriptome data and spatial transcriptome data of the immune cells whose current state analysis is to be performed, and obtain the current single-cell transcriptome data and the current spatial transcriptome data; then, based on S11, S12 and S13, obtain the normalized gene expression matrix, activation characteristic gene set, exhaustion characteristic gene set, infiltration characteristic gene set and the typing-annotated transcriptome data corresponding to the current single-cell transcriptome data and the current spatial transcriptome data, and obtain the current normalized gene expression matrix, the current activation characteristic gene set, the current exhaustion characteristic gene set, the current infiltration characteristic gene set and the current typing-annotated transcriptome data; S32. Input the current standardized gene expression matrix, the current activation characteristic gene set, the current exhaustion characteristic gene set, the current invasion characteristic gene set, and the current subtyping annotation transcriptome data into the final immune cell state mapping model for mapping to obtain the current immune activation index dataset, the current immune exhaustion index dataset, and the current tumor invasion capacity index dataset. By accurately quantifying the core functional dimensions of current immune cells, direct data support is provided for in-depth analysis of the immune regulatory characteristics of the tumor microenvironment in the current sample and for clarifying the functional activity and distribution patterns of immune cells, thereby helping to quickly carry out subsequent related analyses and application decisions.
[0008] Preferably, step S4 includes the following steps: S41. Set several types of tumor local microenvironment parameters to obtain a set of microenvironment parameter types; the set of microenvironment parameter types includes cytokine concentration parameters, extracellular matrix stiffness and density, local acid-base balance parameters, local blood oxygen supply parameters, and inflammatory response intensity parameters. Based on the set of microenvironment parameter types, data of various microenvironment parameters and the corresponding average values of immune activation index, immune exhaustion index and tumor invasion ability index were collected during multiple historical immune cell status analyses to obtain historical microenvironment parameter datasets, historical average immune activation index sets, historical average immune exhaustion index sets and historical average tumor invasion ability index sets. S42. Then, based on the historical microenvironment parameter dataset, the historical average immune activation index set, the historical average immune exhaustion index set, and the historical average tumor infiltration capacity index set, construct a mapping model with various microenvironment parameter data as input and the average values of immune activation index, immune exhaustion index, and tumor infiltration capacity index as output, to obtain the final mapping model affecting the average state of immune cells. The resulting mapping model provides a scientific basis and predictive tool for subsequent targeted regulation of microenvironment parameters and optimization of the overall functional state of immune cells. It can guide precise human intervention in key microenvironment parameters, achieve targeted optimization of the immune pattern of the tumor microenvironment, and provide efficient and feasible technical support for improving anti-tumor immune effects and perfecting immune regulation strategies.
[0009] Preferably, step S5 includes the following steps: S51. Based on the current immune activation index dataset, the current immune exhaustion index dataset, and the current tumor invasion capacity index dataset, calculate the average values of the current immune activation index, immune exhaustion index, and tumor invasion capacity index to obtain the current initial average immune activation index, the current initial average immune exhaustion index, and the current initial average tumor invasion capacity index. S52. Based on the current requirements for the state of immune cells, set the mean threshold values for the immune activation index, immune exhaustion index, and tumor infiltration capacity index to obtain the current threshold values for the immune activation index, immune exhaustion index, and tumor infiltration capacity index. Based on the current immune activation index threshold, the current immune exhaustion index threshold, and the current tumor infiltration capacity index threshold, if the average index data of the current initial immune activation average index and the current initial tumor infiltration capacity average index are less than the corresponding index threshold, or the current initial immune exhaustion average index is greater than the corresponding index threshold, execute S6; otherwise, no action is required. By relying on thresholds to complete multi-dimensional index comprehensive comparison and judgment, abnormal immune states such as insufficient overall activation level, weak infiltration capacity, or excessive population depletion can be quickly and accurately screened out. Two different situations can be clearly distinguished: one that requires microenvironment intervention and regulation and the other that does not require adjustment, thus achieving automated and efficient identification of immune status.
[0010] Preferably, step S6 includes the following steps: S61. Obtain various tumor local microenvironment parameter data corresponding to the immune cells to be analyzed in the current state, and obtain the current initial microenvironment parameter dataset; input the current initial microenvironment parameter dataset into the final average state mapping model of immune cells for mapping, and obtain the current immune activation mapping index, the current immune exhaustion mapping index and the current tumor infiltration capacity mapping index. Set a mapping calculation error threshold, calculate the sum of exponential errors between the current immune activation mapping index, the current immune exhaustion mapping index, and the current tumor invasion capability mapping index and the current initial average immune activation index, the current initial average immune exhaustion index, and the current initial average tumor invasion capability index, and obtain the current initial exponential error sum; S62. Set a repeated acquisition threshold; if the current initial index error is greater than or equal to the mapping calculation error threshold, repeat S31, S32, and S51 to obtain the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index; otherwise, no adjustment is required. Calculate the sum of exponential errors between the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index and the current immune activation mapping index, the current immune exhaustion mapping index, and the current tumor infiltration capacity mapping index, and obtain the sum of current adjusted exponential errors; By calculating the sum of the errors between the mapped index and the current initial average immune function index, the consistency of the data is accurately determined. If the error exceeds the standard, the data re-collection and re-analysis process is initiated. By repeatedly executing the previous data processing and index calculation steps, possible original data deviations and analysis process omissions can be effectively corrected, thereby improving the reliability of the average immune function index.
[0011] Preferably, step S7 includes the following steps: S71. If the current adjusted exponential error is less than the mapping calculation error threshold and the number of re-executions is less than or equal to the repeated collection threshold, the adjustment is complete and S72 is executed. Otherwise, the current initial microenvironment parameter dataset is merged into the historical microenvironment parameter dataset, and the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index are merged into the historical average immune activation index set, the historical average immune exhaustion index set, and the historical average tumor infiltration capacity index set, respectively. S42 is then executed again to obtain the final modified average state mapping model of immune cells. The final modified average state mapping model of immune cells is used to replace the final average state mapping model of immune cells. S72. Repeatedly adjust the current initial microenvironment parameter dataset to obtain the current adjusted microenvironment parameter dataset; input the current adjusted microenvironment parameter dataset into the final influence immune cell average state mapping model for mapping to obtain the current immune activation adjusted mapping index, the current immune exhaustion adjusted mapping index, and the current tumor infiltration capacity adjusted mapping index. The adjustment is complete when neither the average index data of the current immune activation adjusted mapping index nor the current tumor infiltration capacity adjusted mapping index is lower than the corresponding index threshold and the current immune exhaustion adjusted mapping index is greater than the corresponding index threshold. By dynamically optimizing the parameter configuration until the mapped immune activation and infiltration capacity indices meet the threshold requirements and the exhaustion index is controlled within a reasonable range, the reliability of the prediction tool is enhanced and the targeted optimization of the immune status is achieved.
[0012] An immune cell status analysis system based on single-cell transcriptomics and spatial transcriptomics includes a data acquisition and processing module, a first mapping model construction module, a current state mapping module, a second mapping model construction module, an average index determination module, an acquisition adjustment module, and a microenvironment adjustment module. The data acquisition and processing module is used to collect and process the raw transcriptome data of historical immune cells, and then obtain the corresponding state index. The first mapping model construction module is used to construct the final immune cell state mapping model; The current state mapping module is used to acquire and process the single-cell and spatial transcriptome data of the immune cells to be analyzed, and then perform mapping. The second mapping model construction module is used to construct the final mapping model that affects the average state of immune cells. The average index determination module is used to calculate the average value of the current immune cell status index, and to perform threshold comparison and determination. The acquisition and adjustment module is used to repeatedly adjust the current acquisition operation of transcriptome data of immune cells; The microenvironment adjustment module is used to repeatedly adjust various microenvironment parameters of the current immune cells.
[0013] The present invention has the following beneficial effects: 1. This invention establishes an immune cell status assessment model, enabling precise quantification of various functional indicators of immune cells at the molecular level. Simultaneously, it establishes a correlation prediction model by combining five core microenvironmental regulation parameters of the tumor locality, bridging the link between molecular expression characteristics and the external survival environment, achieving comprehensive analysis from the internal state of cells to the influence of the external environment. Furthermore, it establishes standardized evaluation criteria using mean statistics and threshold determination mechanisms to quickly distinguish whether the immune cell status meets the standards. By setting error verification and re-verification mechanisms, it effectively identifies deviations generated during data collection and analysis, ensuring the accuracy and reliability of the assessment results. For cases where multiple corrections still fail to meet the standards, iterative optimization of the environmental correlation model using supplementary sample data continuously improves the model's adaptability and generalization ability. Finally, it optimizes and adjusts the immune status by fine-tuning various microenvironmental parameters, thus accurately assessing the true functional level of immune cells and achieving targeted improvement of the immune status through environmental parameter regulation.
[0014] 2. In this invention, if the error exceeds the standard, the data re-collection and re-analysis process is initiated. By repeatedly executing the previous data processing and index calculation steps, possible original data deviations and analysis process omissions can be effectively corrected, thereby improving the reliability of the average immune function index.
[0015] 3. In this invention, when the error still does not meet the standard after repeated collection, the current microenvironment parameters and immune function index data are added to the historical dataset, the mapping model is retrained and iterated, the training sample size of the model is effectively expanded, the feature association weights are optimized, the model's adaptability to the current sample scenario and the prediction accuracy are improved, and the regulation deviation caused by insufficient model generalization is avoided.
[0016] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the process of determining the threshold of the current adjusted exponential error according to the present invention; Figure 2 This is a schematic diagram of the process for processing the raw transcriptome data of collected immune cells according to the present invention. Figure 3 Reference images for selecting tumor cells and immune cells corresponding to the immune cell transcriptome data obtained in this invention are shown below. In Figure (a), an image of immune cells killing tumor cells is shown, with red representing PKH26-labeled tumor cells and blue representing DAPI-labeled immune cells. In Figure (b), an image of immune cells killing tumor cells is also shown, with blue representing DAPI-labeled tumor cells and unlabeled round cells representing immune cells. In Figure (c), an image of K562 tumor cells and immune cells co-incubated is shown, with green representing CFSE-labeled K562 tumor cells and unlabeled cells representing immune cells. In Figure (d), an image of A549 tumor cells is shown, with green representing SYTOX Green dye labeling the tumor cell nuclei and red representing PI labeling of dead cells. Figure 4 A schematic diagram illustrating the process of constructing the final mapping model affecting the average state of immune cells in this invention; Figure 5 This is a schematic diagram of the process of determining the threshold of various initial state indices according to the present invention; Figure 6This is a schematic diagram illustrating the process of determining the current initial exponential error and threshold in this invention. Detailed Implementation
[0019] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0020] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0021] Example 1 Please see Figure 1 This embodiment describes a method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics, including the following steps: S1. Collect raw transcriptome data of historical immune cells, perform preprocessing, dimensionality reduction clustering, typing annotation, spatial mapping, functional enrichment processing, and analyze cell spatial communication, and obtain corresponding state index data. Please see Figure 2 , Figure 3 S1 includes the following steps: S11. Based on images of tumor tissues (cells) of different morphologies, obtain historical raw data of single-cell transcriptome (obtaining gene expression at the cellular level, without spatial location) and spatial transcriptome (preserving tissue spatial location, mixed cell expression profile) of immune cells in the tumor tissue corresponding to each image, and obtain historical data of single-cell transcriptome and spatial transcriptome. Quality control was performed on the historical single-cell transcriptome data and spatial transcriptome data (a comprehensive quality screening and evaluation of the raw sequencing data, cell and gene expression levels was conducted to remove invalid sequencing reads with low sequencing base quality, adapter sequence contamination, and abnormal fragments; at the same time, qualified cells were screened to remove low-quality cells with too few gene detections, too high mitochondrial gene expression, double-cell adhesion, etc., and invalid genes with abnormal expression levels were filtered out), alignment (the raw sequencing reads were precisely matched and located with the species reference genome or transcriptome sequence, the disordered sequencing fragments were anchored to the corresponding gene positions in the genome, the number of transcripts of each gene in a single cell was counted, and the conversion from raw sequencing sequence to gene expression count was achieved), and normalization (used to eliminate differences in sequencing depth and cellular mRNA between different cells). To address the expression bias caused by differences in total quantity, we correct and convert gene expression levels in each cell type to ensure comparability of gene expression levels across different cells and sequencing depths, avoiding false positive results in subsequent clustering and differential analysis due to differences in sequencing saturation. We also perform batch correction (to remove non-biological systematic errors introduced from different experimental batches, sequencing platforms, sampling times, and samples; these batch biases are not due to actual biological differences in cells but rather technical interference caused by experimental operations and sequencing procedures; correction allows for the integration of data from multiple batches, ensuring that cell clustering and expression characteristics are not affected by batch effects) and low-expression gene filtering (to remove invalid low-abundance genes that are not expressed in the vast majority of cells or are expressed at extremely low abundance in only a very few cells; these genes are often...). Background noise and random amplification interference have no actual biological significance; filtering can reduce data dimensionality, reduce computational complexity, reduce the interference of noise on dimensionality reduction, clustering, and differential analysis, and improve the accuracy of data analysis. It also eliminates sequencing and sample batch bias (the core purpose of integrating normalization and batch correction is to correct technical biases caused by sequencing depth and sequencing preference on the one hand, and smooth out non-biological differences between different samples and different experimental batches on the other hand, unify the expression baseline of all samples and cells, eliminate technical interference factors, retain the true biological expression characteristics of cells, and ensure the authenticity and reliability of subsequent cell typing, functional annotation, spatial mapping, and interaction analysis results). It yields historically processed single-cell transcriptome data, historically processed spatial transcriptome data, and historically normalized gene expression matrix. S12. Perform dimensionality reduction clustering (PCA+UMAP / TSNE) on the historically processed single-cell transcriptome data to obtain historically clustered transcriptome data; then use classical marker genes and cell lineage characteristics to perform preliminary cell type identification, typing and functional status annotation operations on the historically clustered transcriptome data to obtain historically type-annotated transcriptome data. Specifically, by using classic marker genes and cell lineage characteristics, we can achieve fine typing of immune cell subsets such as T cells, B cells, macrophages, dendritic cells, NK cells, and myeloid suppressor cells, and simultaneously complete authoritative functional annotation of cell types and define the basic biological characteristics of each subset. We used deconvolution algorithms (Cell2Location, Stereo-seq deconvolution, and Seurat mapping) to map the historical typing and annotated transcriptome data to the spatial transcriptome sites in the historically processed spatial transcriptome data, and decoupled the proportion of immune cells at each spatial transcriptome site to restore the in situ spatial distribution pattern of various immune cells in the tumor microenvironment, and clarified the differences in immune cell distribution in the tumor core, invasion margin, and adjacent stroma. The historical subtype annotation transcriptome data were screened and GO / KEGG pathway enrichment and GSVA single-cell functional enrichment were performed to obtain historical enriched transcriptome data; focusing on immune activation markers, exhaustion markers, and invasion-related chemokines / adhesion molecules, the molecular expression profiles of different subpopulations were characterized. S13. Based on the historical enriched transcriptome data, analyze the spatial cell communication between immune cells, between immune cells and tumor cells, and between immune cells and stromal cells. Determine the interaction patterns such as chemotaxis, inhibition, and pro-inflammatory / anti-inflammatory, and reveal the molecular mechanisms of TME immune cell recruitment, rejection, and immune escape. Then, based on the analysis results, screen the characteristic gene sets of three dimensions: activation, exhaustion, and infiltration to obtain the historical activation characteristic gene set, the historical exhaustion characteristic gene set, and the historical infiltration characteristic gene set. S14. Obtain the historical data of the single-cell transcriptome and the historical data of the spatial transcriptome corresponding to each spatial site of each single cell, including the immune activation index, immune exhaustion index and tumor invasion ability index data, to obtain the historical immune activation index dataset, the historical immune exhaustion index dataset and the historical tumor invasion ability index dataset. This approach fully leverages historical transcriptomic data from single cells and spatial structures in tumor tissues. Through preprocessing steps such as quality control, alignment, normalization, batch correction, and low-expression gene filtering, it effectively eliminates sequencing noise, technical biases, and non-biological interference, ensuring the reliability and consistency of historical data and constructing a high-quality, standardized historical gene expression matrix. By combining dimensionality reduction clustering with classic marker genes and cell lineage characteristics, it achieves precise typing and authoritative functional annotation of immune cell subpopulations, clearly defining the biological characteristics of each subpopulation. Combined with deconvolution algorithms, it successfully maps single-cell subtypes to spatial sites, accurately restoring the in situ spatial distribution pattern of immune cells and the distribution differences in different tumor regions, overcoming the inherent limitations of single-mathematical methods. Functional enrichment analysis was used to deeply characterize the molecular expression features of various immune subsets, focusing on key immune biomarkers and related molecules. Further analysis of spatial communication patterns among multiple cell types revealed the core mechanisms of immune cell recruitment, rejection, and tumor immune escape, and characterized gene sets across three functional dimensions were screened. Simultaneously, immune function indices from individual cells and spatial sites in historical data were integrated to form a complete historical functional quantification dataset, providing comprehensive and systematic historical data support for the subsequent construction of immune cell functional status characterization models and the realization of precise functional quantification assessment. S2. Construct the final immune cell state mapping model based on the data collected and processed in S1; S2 includes the following steps: S21. Based on the historical normalized gene expression matrix, historical activation characteristic gene set, historical depletion characteristic gene set, historical invasion characteristic gene set, historical typing annotated transcriptome data, historical immune activation index dataset, historical immune depletion index dataset, and historical tumor invasion capacity index dataset, construct a mapping model with inputs of the normalized gene expression matrix, activation characteristic gene set, depletion characteristic gene set, invasion characteristic gene set, and typing annotated transcriptome data, and outputs of immune activation index data, immune depletion index data, and tumor invasion capacity index data, to obtain the final immune cell state mapping model. The final immune cell state mapping model can employ a multilayer perceptron regression model, comprising an input layer, four fully connected layers, and an output layer. The input layer uses a standardized gene expression matrix, feature gene sets for the three functional dimensions, and immune cell typing annotation information as input features. The input dimensions are adaptively matched based on the total number of features, and the features undergo standardization preprocessing. The first fully connected layer has 256 neurons, employing the ReLU linearly modified activation function, and is connected to a random inactivation layer with an inactivation rate of 0.2 to prevent overfitting. The second fully connected layer has 128 neurons, also employing the linearly modified activation function, and is connected to a random inactivation layer with an inactivation rate of 0.2. Further extraction of higher-order feature association information is achieved. The third fully connected layer has 64 neurons and uses a linearly modified activation function to focus on the expression of key features related to immune cell function. The fourth fully connected layer has 32 neurons and uses a linearly modified activation function to compress feature dimensions and enhance the expression of features related to functional state. The output layer has 3 neurons, corresponding to the three continuous values of immune activation index, immune exhaustion index, and tumor invasion ability index, and uses a linear activation function to adapt to the regression prediction task. In addition, the model uses an adaptive moment estimator optimizer with a learning rate of 0.001 and a mean squared error loss function to ensure the accuracy and stability of index prediction. By fully integrating the basic molecular data of historical standardized gene expression matrices, the core biological markers of gene sets with three functional dimensions, cell identity information from transcriptome data after typing annotation, and existing historical immune function index datasets, a multi-dimensional and comprehensive model training foundation is constructed, ensuring the comprehensiveness and relevance of the model input data. Furthermore, by deeply integrating molecular expression features, cell typing information, and functional quantification results, the constructed mapping model can accurately capture the intrinsic correlation between immune cell gene expression patterns, subtype attributes, and activation, exhaustion, and invasion functional states, achieving efficient transformation from multi-source input data to core functional indices. This model overcomes the limitations of a single data dimension, possessing stronger generalization ability and predictive accuracy supported by rich historical data. It can stably output three key indices: immune activation, exhaustion, and tumor invasion capacity, providing a reliable tool for rapid and accurate quantification of immune cell functional states in unknown samples. It effectively connects preliminary data mining with subsequent functional assessment, contributing to the systematic analysis and accurate determination of immune cell function in the tumor microenvironment. S3. Obtain the single-cell and spatial transcriptome data of the immune cells to be analyzed and process the data based on S1. Then, input the processed data into the mapping model in S2 for mapping. S3 includes the following steps: S31. Obtain the single-cell transcriptome data and spatial transcriptome data of the immune cells whose current state analysis is to be performed, and obtain the current single-cell transcriptome data and the current spatial transcriptome data; then, based on S11, S12 and S13, obtain the normalized gene expression matrix, activation characteristic gene set, exhaustion characteristic gene set, infiltration characteristic gene set and the typing-annotated transcriptome data corresponding to the current single-cell transcriptome data and the current spatial transcriptome data, and obtain the current normalized gene expression matrix, the current activation characteristic gene set, the current exhaustion characteristic gene set, the current infiltration characteristic gene set and the current typing-annotated transcriptome data; S32. Input the current standardized gene expression matrix, the current activation characteristic gene set, the current exhaustion characteristic gene set, the current invasion characteristic gene set, and the current subtyping annotation transcriptome data into the final immune cell state mapping model for mapping to obtain the current immune activation index dataset, the current immune exhaustion index dataset, and the current tumor invasion capacity index dataset. By processing the single-cell and spatial transcriptome data of the immune cells to be analyzed, the current standardized gene expression matrix, gene sets of the three major functional characteristics, and transcriptome data annotated with typing are accurately obtained to match the input requirements of the model. This ensures the consistency and compatibility of the current data with historical training data, laying a solid foundation for subsequent accurate mapping. The standardized multi-dimensional current data is then input into the constructed final immune cell state mapping model. Leveraging the model's advantage of efficiently capturing the intrinsic correlation between gene expression, cell typing, and functional state, the model quickly outputs datasets of current immune activation index, exhaustion index, and tumor invasiveness index. This process achieves efficient transformation from raw data to functional quantification results, ensuring the accuracy and reliability of the current immune cell functional state assessment while significantly improving analysis efficiency through standardized procedures and mature models, avoiding redundant costs of repeated modeling. In summary, by accurately quantifying the core functional dimensions of the current immune cells, direct data support is provided for in-depth analysis of the immune regulatory characteristics of the tumor microenvironment in the current sample and for clarifying the functional activity and distribution patterns of immune cells, thereby facilitating rapid subsequent related analysis and application decisions. S4. Collect historical data on multiple sets of microenvironment parameters and the corresponding average values of immune cell state indices, and then construct a mapping model that ultimately affects the average state of immune cells. Please see Figure 4 S4 includes the following steps: S41. Set several types of tumor local microenvironment parameters to obtain a set of microenvironment parameter types; the set of microenvironment parameter types includes cytokine concentration parameters, extracellular matrix stiffness and density, local acid-base balance parameters, local blood oxygen supply parameters, and inflammatory response intensity parameters. Specifically, the cytokine concentration parameter refers to the content level of various immune-related active small molecules in the tumor microenvironment, including pro-inflammatory factors with immune-activating effects, inhibitory factors with immunosuppressive effects, and regulatory factors that mediate cell signal transduction. These factors can directly participate in the entire process of immune cell growth, differentiation, functional activation, and state suppression. This parameter can directly affect the process of immune cell activation and functional direction. High concentrations of inhibitory factors are the core cause of immune cell depletion and decreased activity. By artificially regulating their concentration ratio, adverse immune signal transduction can be directly reversed, and the physiological activity of weakened immune cells can be rapidly improved. This is the most direct and effective regulatory entry point for reshaping immune function. Extracellular matrix stiffness and density parameters represent the physical structural characteristics of the stromal tissue surrounding tumor lesions. Stiffness reflects the mechanical support strength of the tissue, while density refers to the density of the matrix fibers and stromal components. Together, they constitute the physical spatial environment for the migration of immune cells. Excessive matrix stiffness and excessively dense structural arrangement can form a physical barrier, hindering the infiltration and penetration of immune cells into the tumor parenchyma, and significantly reducing the efficiency of cell colonization and killing. Regulating this parameter can break through spatial barriers, open up the immune cell infiltration pathway, and solve the problem of insufficient immune cell infiltration capacity from a physical perspective. Local acid-base balance parameters specifically refer to the acid-base values determined by the hydrogen ion content in the local microenvironment of tumor tissue. Tumor metabolism tends to make the local environment more acidic, forming a special physicochemical environment that differs from normal tissue. An acidic microenvironment will continuously damage the normal physiological structure of immune cells, inhibit cell proliferation, differentiation and immune response, and accelerate the decline and exhaustion of immune cell function. Regulating the local acid-base state can eliminate cell damage caused by the physicochemical environment, maintain the normal physiological metabolism of immune cells, and delay the deterioration of cell function. Local blood oxygen supply parameters refer to the amount of oxygen transported and the adequacy of nutrient supply within the tumor tissue. They reflect the overall state of blood circulation and material transport in the lesion area. Hypoxia is one of the typical characteristics of the tumor microenvironment. Long-term insufficient blood oxygen supply can induce metabolic disorders of immune cells, significantly weaken the cell killing ability and survival ability, and further induce the appearance of immunosuppressive phenotypes. Optimizing blood oxygen supply can improve the cell survival and metabolic conditions, restore the basic physiological functions of immune cells, and reduce the problem of deterioration of immune cell status caused by hypoxia. The inflammatory response intensity parameter is used to define the activity level of the local immune inflammatory response in the tumor area and to balance the overall strength of the body's positive anti-tumor inflammatory response and the negative chronic inflammatory response within the lesion. An imbalance in inflammatory intensity will directly disrupt the order of the immune response. If the inflammation is too weak, it will not be able to initiate effective anti-tumor immunity, while excessive chronic inflammation will continuously stimulate immune cells, causing them to gradually become fatigued and exhausted. Precisely regulating this parameter can balance the rhythm of the immune response, ensuring that effective anti-tumor immunity can play its role, while avoiding continuous inflammatory damage to immune cells and stabilizing the good functional state of immune cells. Based on the set of microenvironment parameter types, data of various microenvironment parameters and the corresponding average values of immune activation index, immune exhaustion index and tumor invasion ability index were collected during multiple historical immune cell status analyses to obtain historical microenvironment parameter datasets, historical average immune activation index sets, historical average immune exhaustion index sets and historical average tumor invasion ability index sets. The five parameters selected in this protocol—cytokine concentration, extracellular matrix stiffness and density, local acid-base balance, local blood oxygen supply, and inflammatory response intensity—comprehensively cover the five core regulatory dimensions of immune regulation within the tumor microenvironment: molecular signals, physical space, physicochemical environment, metabolism, and immune response. These dimensions are clearly defined and their functions do not overlap, thus connecting the entire action chain from external environmental conditions to changes in internal immune cell function. All five parameters are practical indicators that can be precisely controlled locally within the tumor, aligning with actual intervention scenarios and encompassing the mechanisms mediating immune cell functional changes. The sub-regulatory factors include physical structural factors that limit the infiltration and migration of immune cells, while also taking into account the physicochemical conditions that affect cell survival and metabolism as well as the overall immune response balance. The parameter set is well matched with the three major functional evaluation systems of immune cell activation, exhaustion, and infiltration, and forms a high correlation with the previously constructed immune function index. The data correlation is strong and the model fitting degree is high. It can accurately explore the intrinsic quantitative law between environmental parameters and the average state of herd immunity. The number of parameters is moderate and will not cause feature redundancy or the absence of key regulatory dimensions. It balances model training efficiency and prediction accuracy, and combines practicality and scientificity. The absence of any single parameter will directly create research gaps in the corresponding regulatory dimension, disrupting the complete regulatory system of mutual synergy and checks and balances among the five dimensions. Specifically, deleting the cytokine concentration parameter will lack the core evidence of immune signal transduction, making it impossible to accurately determine the molecular driving force of immune activation and inhibition; deleting the extracellular matrix stiffness and density parameters will ignore the infiltration barrier factors brought about by physical barriers, making it difficult to explain the abnormal spatial distribution of immune cells; deleting the local acid-base balance parameter will fail to consider the damaging effects of the local physicochemical environment on the physiological activity of immune cells; deleting the local blood oxygen supply parameter will fail to reflect the key influence of the hypoxic microenvironment inducing the formation of the immunosuppressive phenotype; and deleting the inflammatory response intensity parameter will fail to control the overall immune response balance, and will fail to distinguish the different effects brought about by effective anti-tumor immunity and pathological chronic inflammation. Ultimately, this will lead to incomplete model input features, broken parameter action logic, one-sided prediction results, and an inability to fully reflect the comprehensive impact of the microenvironment on the overall state of immune cells, significantly reducing the actual value of the model in predicting and guiding regulation. Adding extra parameters directly leads to redundancy in the number of input features, introduces weakly correlated and non-core interfering indicators, significantly increases the difficulty of data collection and experimental testing costs, and increases the computational load of model training, lengthening the modeling and computation cycle. Adding irrelevant or secondary parameters can easily cause problems such as overlapping feature information and chaotic data dimensions, disrupting the original balanced proportion structure of the five major dimensions, making it very easy for the model to overfit, weakening the dominant influence weight of the original five core parameters, and disrupting the originally stable synergistic relationship between parameters, making it difficult for the model to focus on key regulatory laws, reducing the stability and generalization ability of prediction results, and also making the subsequent microenvironment regulation scheme formulation logic complicated, deviating from the simple and efficient practical application requirements; Finally, replacing any one of them would directly disrupt the balanced layout that covers all five dimensions. The new parameters after replacement cannot accurately match the mechanisms of action of the three major functions of immune cell activation, exhaustion, and infiltration, making it difficult to form an effective data linkage with the previous immune function index and destroying the established quantitative correlation between parameters and immune status. At the same time, most of the replaced indicators cannot be easily controlled by humans, deviating from the purpose of this scheme to regulate the microenvironment and improve the immune status. S42. Then, based on the historical microenvironment parameter dataset, the historical average immune activation index set, the historical average immune exhaustion index set, and the historical average tumor infiltration capacity index set, construct a mapping model with various microenvironment parameter data as input and the average values of immune activation index, immune exhaustion index, and tumor infiltration capacity index as output, to obtain the final mapping model affecting the average state of immune cells. The final model for mapping the average state of immune cells described in S42 can employ a gated recurrent unit combined with a multilayer perceptron fusion prediction model, which is adaptable to the regression mapping task of multiple types of continuous microenvironment parameters to the mean of immune function. It includes an input layer, a gated recurrent unit feature extraction layer, three fully connected layers, and an output layer. The input layer is used to uniformly input the values of five types of tumor microenvironment regulation parameters, perform data normalization, and feature dimension regularization. A single-layer gated recurrent unit structure is set in the gated recurrent unit feature extraction layer, with 128 neurons inside. It relies on internal forgetting gates, input gates, and output gates to capture the linkage and change patterns between multiple sets of microenvironment parameters, and to explore the synergistic influence of parameter combinations on the immune state. The first fully connected layer has 96 neurons and uses a linearly modified activation function to complete the nonlinear transformation of features and... A random inactivation mechanism with a probability of 0.25 is used to suppress model overfitting. The second fully connected layer has 64 neurons and continues to use a linearly modified activation function to further refine the core correlation features between microenvironment parameters and immune status. The third fully connected layer has 32 neurons and uses a linearly modified activation function to simplify feature dimensions and focus on core influencing factors. The output layer has 3 neurons, corresponding to the average immune activation index, the average immune exhaustion index, and the average tumor infiltration capacity index, respectively, and uses a linear activation function to adapt to the continuous numerical regression output requirements. In addition, the model uses an adaptive gradient descent optimization algorithm for parameter iterative training, with a base learning rate set to 0.0008 and mean squared error used as the model loss function to ensure accurate and stable multi-dimensional mean prediction results. By identifying key parameters in the tumor microenvironment that play a crucial role in regulating immune cell function, this study precisely focuses on five core parameters, including cytokine concentration, extracellular matrix stiffness, and density. It comprehensively covers key regulatory dimensions such as immune signal transduction, physical environment, physicochemical conditions, and inflammatory response, providing a scientific and comprehensive parameter foundation for subsequent model construction. Based on historical data accumulated from multiple immune cell state analyses and corresponding average indices of three immune functions, the study fully integrates multi-round, multi-dimensional historical experience data, ensuring the richness and representativeness of model training data and providing solid data support for exploring the intrinsic relationship between parameters and immune status. Furthermore, by constructing a mapping model between microenvironment parameters and average immune function indices, a quantitative correlation is established between various microenvironment regulatory parameters and immune cell activation, depletion, and infiltration capabilities. This accurately reveals the influence patterns and weights of different microenvironment parameters on the overall state of immune cells. The resulting mapping model provides a scientific basis and predictive tool for targeted regulation of microenvironment parameters and optimization of the overall functional state of immune cells. It can guide precise intervention in key microenvironment parameters, achieving targeted optimization of the tumor microenvironment immune pattern, and providing efficient and feasible technical support for improving anti-tumor immune efficacy and refining immune regulation strategies. S5. Calculate the mean values of the current initial immune activation, exhaustion and tumor invasion capacity indices based on the mapping results in S3, and compare them with the corresponding thresholds respectively. If the thresholds are not met after comparison, proceed to S6; otherwise, no action is required. Please see Figure 5 S5 includes the following steps: S51. Based on the current immune activation index dataset, the current immune exhaustion index dataset, and the current tumor invasion capacity index dataset, calculate the average values of the current immune activation index, immune exhaustion index, and tumor invasion capacity index to obtain the current initial average immune activation index, the current initial average immune exhaustion index, and the current initial average tumor invasion capacity index. S52. Based on the current requirements for the state of immune cells, set the mean threshold values for the immune activation index, immune exhaustion index, and tumor infiltration capacity index to obtain the current threshold values for the immune activation index, immune exhaustion index, and tumor infiltration capacity index. Based on the current immune activation index threshold, the current immune exhaustion index threshold, and the current tumor infiltration capacity index threshold, if the average index data of the current initial immune activation average index and the current initial tumor infiltration capacity average index are less than the corresponding index threshold, or the current initial immune exhaustion average index is greater than the corresponding index threshold, execute S6; otherwise, no action is required. By integrating and calculating the mean of various immune function indices obtained from batch samples, individual differences and random biases caused by data from single cells or single sites can be eliminated, accurately yielding average quantitative values that represent the overall functional level of the immune cell population, and objectively reflecting the overall true state of the immune status within the tumor microenvironment. Combined with actual immune regulation needs, scientifically defining the evaluation thresholds for each index establishes standardized criteria for judging the quality of immune function, providing a unified and standardized measurement standard for assessing the overall state of immune cells, effectively avoiding biases caused by subjective judgments. Furthermore, based on these thresholds, a comprehensive comparison and analysis of multi-dimensional indices can be performed, enabling rapid and accurate screening for insufficient overall activation levels and weak infiltration capabilities. Or, in cases of abnormal immune states where the population exhaustion level exceeds the standard, a clear distinction is made between two different scenarios: one requiring microenvironmental intervention and the other requiring no adjustment. This enables automated and efficient identification of immune states. This judgment method takes into account both overall population characteristics and predetermined regulatory goals. The screening logic is clear and rigorous. It can accurately identify immune state scenarios with functional defects and promptly initiate subsequent microenvironmental optimization processes. It can also directly determine that immune states within the standard acceptable range do not require intervention, reducing unnecessary regulatory operations and significantly improving the pertinence and efficiency of overall analysis and judgment and subsequent regulatory work. At the same time, it ensures that the immune state assessment results are scientific and reasonable, laying a solid foundation for accurate judgment in subsequent targeted microenvironmental parameter regulation. S6. Collect the current local tumor microenvironment parameter data and input them into the mapping model in S4. If the error between the mapping result and the mean calculated in S5 exceeds the standard, repeat the calculation operations in S3 and S5, and calculate the error again. Please see Figure 6 S6 includes the following steps: S61. Obtain various tumor local microenvironment parameter data corresponding to the immune cells to be analyzed in the current state, and obtain the current initial microenvironment parameter dataset; input the current initial microenvironment parameter dataset into the final average state mapping model of immune cells for mapping, and obtain the current immune activation mapping index, the current immune exhaustion mapping index and the current tumor infiltration capacity mapping index. Set the mapping calculation error threshold (which can be adaptively set according to the actual situation), calculate the sum of the index errors corresponding to the current immune activation mapping index, the current immune exhaustion mapping index, and the current tumor invasion ability mapping index with the current initial average immune activation index, the current initial average immune exhaustion index, and the current initial average tumor invasion ability index, and obtain the current initial index error sum; S62. Set the repeated acquisition threshold (which can be adaptively set according to the actual situation); if the current initial index error is greater than or equal to the mapping calculation error threshold, repeat S31, S32, and S51 to obtain the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index; otherwise, no adjustment is required. Calculate the sum of exponential errors between the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index and the current immune activation mapping index, the current immune exhaustion mapping index, and the current tumor infiltration capacity mapping index, and obtain the sum of current adjusted exponential errors; By acquiring various parameter data of the current local tumor microenvironment and inputting them into the constructed mapping model, the corresponding immune function mapping index is quickly obtained. Simultaneously, adaptive mapping calculation error thresholds and re-collection thresholds are set to form a standardized error verification system, providing a clear basis for data accuracy verification. By calculating the sum of errors between the mapping index and the current initial average immune function index, data consistency is accurately determined. If the error exceeds the threshold, a data re-collection and re-analysis process is initiated. By repeatedly executing the previous data processing and index calculation steps, potential original data deviations and analytical process omissions are effectively corrected, improving the reliability of the average immune function index. By dynamically comparing the sum of errors between the adjusted index and the mapping index, combined with the re-collection threshold to control the number of re-collections, meaningless repetitive operations are avoided, and data errors are kept within a reasonable range, ensuring the accuracy of subsequent regulatory decisions. This scheme constructs a rigorous data quality control mechanism, effectively eliminating the interference of data deviations on immune status assessment, ensuring that the final obtained immune function index can truly reflect the overall state of immune cells in the current microenvironment, providing high-quality and highly reliable data support for the formulation of subsequent targeted microenvironment regulation schemes. S7. If the error still exceeds the standard after a finite number of repetitions in S6, then the mapping model in S4 shall be corrected. After correction, the current micro-environment parameter data shall be adjusted and mapped. Otherwise, no correction shall be made and the adjustment and mapping shall be performed directly until the mapping result meets the threshold. S7 includes the following steps: S71. If the current adjusted exponential error is less than the mapping calculation error threshold and the number of re-executions is less than or equal to the repeated collection threshold, the adjustment is complete and S72 is executed. Otherwise, the current initial microenvironment parameter dataset is merged into the historical microenvironment parameter dataset, and the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index are merged into the historical average immune activation index set, the historical average immune exhaustion index set, and the historical average tumor infiltration capacity index set, respectively. S42 is then executed again to obtain the final modified average state mapping model of immune cells. The final modified average state mapping model of immune cells is used to replace the final average state mapping model of immune cells. Errors in basic data collection and entry represent the source data level. Deviations occur earlier and have a more direct impact, making them the easiest to investigate and the highest priority for correction. Once the raw data is distorted, subsequent statistical calculations and model predictions will also show deviations, so verification and correction must be completed first. In contrast, incomplete dataset sample coverage and missing sample scenarios are deeper issues at the model training level. These are more difficult to investigate and require a longer adjustment period. This verification work should only be carried out after confirming that the original measured data is accurate and there are still significant numerical deviations. This aligns with the investigation logic from shallow basic issues to deep model issues, avoids invalid and repeated verifications, and improves the overall efficiency of error investigation. S72. Repeatedly adjust the current initial microenvironment parameter dataset to obtain the current adjusted microenvironment parameter dataset; input the current adjusted microenvironment parameter dataset into the final influence immune cell average state mapping model for mapping to obtain the current immune activation adjusted mapping index, the current immune exhaustion adjusted mapping index, and the current tumor infiltration capacity adjusted mapping index. The adjustment is complete when neither the average index data of the current immune activation adjusted mapping index nor the current tumor infiltration capacity adjusted mapping index is lower than the corresponding index threshold and the current immune exhaustion adjusted mapping index is greater than the corresponding index threshold. By employing error assessment, data supplementation, model iteration, and parameter optimization, both data quality and model adaptability were ensured, while precise and targeted adjustments to microenvironment parameters were achieved. When the error still did not meet the standards after repeated data collection, the current microenvironment parameters and immune function index data were added to the historical dataset. The mapping model was then retrained and iterated, effectively expanding the model's training sample size, optimizing feature association weights, and improving the model's adaptability and prediction accuracy to the current sample scenario, thus avoiding regulatory bias caused by insufficient model generalization. For cases where the error met the standards, the current microenvironment parameters were repeatedly adjusted, and the optimized model was continuously used for mapping verification. The parameter configuration was dynamically optimized until the mapped immune activation and infiltration capacity indices met the threshold requirements and the exhaustion index was controlled within a reasonable range. This ensured that the final microenvironment parameter adjustment scheme could effectively improve the overall functional state of immune cells. Thus, the reliability of the prediction tool was enhanced through data supplementation and model iteration, while targeted optimization of the immune status was achieved through dynamic parameter adjustment. This ensured the scientific rigor and precision of the regulatory process while improving the specificity and effectiveness of immune status improvement.
[0022] Example 2 This embodiment discloses an immune cell status analysis system based on single-cell transcriptomics and spatial transcriptomics. The system can implement the methods of the above embodiments and includes a data acquisition and processing module, a first mapping model construction module, a current state mapping module, a second mapping model construction module, an average index determination module, an acquisition adjustment module, and a microenvironment adjustment module. The data acquisition and processing module is used to collect and process the raw transcriptome data of historical immune cells, and then obtain the corresponding state index. The first mapping model construction module is used to construct the final immune cell state mapping model; The current state mapping module is used to acquire and process the single-cell and spatial transcriptome data of the immune cells to be analyzed, and then perform mapping. The second mapping model construction module is used to construct the final mapping model that affects the average state of immune cells. The average index determination module is used to calculate the average value of the current immune cell status index, and to perform threshold comparison and determination. The acquisition and adjustment module is used to repeatedly adjust the current acquisition operation of transcriptome data of immune cells; The microenvironment adjustment module is used to repeatedly adjust various microenvironment parameters of the current immune cells.
[0023] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0024] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present invention.
Claims
1. A method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics, characterized in that, Includes the following steps: S1. Collect raw transcriptome data of historical immune cells, perform preprocessing, dimensionality reduction clustering, typing annotation, spatial mapping, functional enrichment processing, and analyze cell spatial communication, and obtain corresponding state index data. S2. Construct the final immune cell state mapping model based on the data collected and processed in S1; S3. Obtain the single-cell and spatial transcriptome data of the immune cells to be analyzed and process the data based on S1. Then, input the processed data into the mapping model in S2 for mapping. S4. Collect historical data on multiple sets of microenvironment parameters and the corresponding average values of immune cell state indices, and then construct a mapping model that ultimately affects the average state of immune cells. S5. Calculate the mean values of the current initial immune activation, exhaustion and tumor invasion capacity indices based on the mapping results in S3, and compare them with the corresponding thresholds respectively. If the thresholds are not met after comparison, proceed to S6; otherwise, no action is required. S6. Collect the current local tumor microenvironment parameter data and input it into the mapping model in S4. If the error between the mapping result and the mean calculated in S5 exceeds the standard, repeat the calculation operations in S3 and S5, and calculate the error again. S7. If the error still exceeds the standard after a finite number of repetitions in S6, then the mapping model in S4 is corrected. After correction, the current micro-environment parameter data are adjusted and mapped. Otherwise, no correction is made, and the adjustment and mapping are performed directly until the mapping result meets the threshold.
2. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 1, characterized in that, The preprocessing includes quality control, alignment, normalization, batch correction, low-expression gene filtering, and elimination of sequencing and sample batch bias.
3. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 2, characterized in that, The input to the final immune cell state mapping model is a standardized gene expression matrix, a set of activated characteristic genes, a set of exhausted characteristic genes, a set of infiltrating characteristic genes, and transcriptome data after typing and annotation. The output is immune activation index data, immune exhaustion index data, and tumor infiltration capacity index data.
4. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 3, characterized in that, S3 includes the following steps: S31. Obtain the single-cell transcriptome data and spatial transcriptome data of the immune cells to be analyzed in the current state, and obtain the current single-cell transcriptome data and the current spatial transcriptome data; then, based on S11, S12 and S13, obtain the standardized gene expression matrix, activation characteristic gene set, exhaustion characteristic gene set, invasion characteristic gene set and the transcriptome data after typing annotation corresponding to the current single-cell transcriptome data and the current spatial transcriptome data, and input them into the final immune cell state mapping model for mapping, to obtain the current immune activation index dataset, the current immune exhaustion index dataset and the current tumor invasion capacity index dataset.
5. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 4, characterized in that, S4 includes the following steps: S41. Set several types of tumor local microenvironment parameters to obtain a set of microenvironment parameter types; the set of microenvironment parameter types includes cytokine concentration parameters, extracellular matrix stiffness and density, local acid-base balance parameters, local blood oxygen supply parameters, and inflammatory response intensity parameters. Based on the set of microenvironment parameter types, data of various microenvironment parameters, as well as the average values of immune activation index, immune exhaustion index, and tumor infiltration capacity index, were collected from multiple historical analyses of immune cell status.
6. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 5, characterized in that, The input to the final model for mapping the average state of immune cells is various microenvironmental parameter data, and the output is the average value of the immune activation index, the average value of the immune exhaustion index, and the average value of the tumor infiltration capacity index.
7. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 6, characterized in that, S5 includes the following steps: S51. Based on the current immune activation index dataset, the current immune exhaustion index dataset, and the current tumor invasion capacity index dataset, calculate the average values of the current immune activation index, immune exhaustion index, and tumor invasion capacity index to obtain the current initial average immune activation index, the current initial average immune exhaustion index, and the current initial average tumor invasion capacity index. S52. Based on the current requirements for the state of immune cells, set the mean threshold values for the immune activation index, immune exhaustion index, and tumor infiltration capacity index to obtain the current threshold values for the immune activation index, immune exhaustion index, and tumor infiltration capacity index. Based on the current immune activation index threshold, the current immune exhaustion index threshold, and the current tumor infiltration capacity index threshold, if the average index data of the current initial immune activation average index and the current initial tumor infiltration capacity average index are less than the corresponding index threshold, or if the current initial immune exhaustion average index is greater than the corresponding index threshold, execute S6; otherwise, no action is required.
8. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 7, characterized in that, S6 includes the following steps: S61. Obtain various tumor local microenvironment parameter data corresponding to the immune cells to be analyzed in the current state, and obtain the current initial microenvironment parameter dataset; input the current initial microenvironment parameter dataset into the final average state mapping model of immune cells for mapping, and obtain the current immune activation mapping index, the current immune exhaustion mapping index and the current tumor infiltration capacity mapping index. Set a mapping calculation error threshold, calculate the sum of exponential errors between the current immune activation mapping index, the current immune exhaustion mapping index, and the current tumor invasion capability mapping index and the current initial average immune activation index, the current initial average immune exhaustion index, and the current initial average tumor invasion capability index, and obtain the current initial exponential error sum; S62. Set a repeated acquisition threshold; if the current initial index error is greater than or equal to the mapping calculation error threshold, repeat S31 and S51 to obtain the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index; otherwise, no adjustment is required. Calculate the sum of exponential errors between the current adjusted average immune activation index, the current adjusted average immune depletion index, and the current adjusted average tumor infiltration capacity index and the current immune activation mapping index, the current immune depletion mapping index, and the current tumor infiltration capacity mapping index, and obtain the sum of current adjusted exponential errors.
9. The method for analyzing the state of immune cells based on single-cell transcriptomics and spatial transcriptomics according to claim 8, characterized in that, S7 includes the following steps: S71. If the current adjusted exponential error is less than the mapping calculation error threshold and the number of re-executions is less than or equal to the repeated collection threshold, the adjustment is complete and S72 is executed. Otherwise, the current initial microenvironment parameter dataset is merged into the historical microenvironment parameter dataset, and the current adjusted average immune activation index, the current adjusted average immune exhaustion index, and the current adjusted average tumor infiltration capacity index are merged into the historical average immune activation index set, the historical average immune exhaustion index set, and the historical average tumor infiltration capacity index set, respectively. S42 is then executed again to obtain the final modified average state mapping model of immune cells. The final modified average state mapping model of immune cells is used to replace the final average state mapping model of immune cells. S72. Repeatedly adjust the current initial microenvironment parameter dataset to obtain the current adjusted microenvironment parameter dataset; input the current adjusted microenvironment parameter dataset into the final influence immune cell average state mapping model for mapping to obtain the current immune activation adjusted mapping index, the current immune exhaustion adjusted mapping index, and the current tumor infiltration capacity adjusted mapping index. The adjustment is complete when neither the current immune activation adjusted mapping index nor the current tumor infiltration capacity adjusted mapping index has an average index value lower than the corresponding index threshold, and the current immune exhaustion adjusted mapping index is greater than the corresponding index threshold.
10. A system for implementing the immune cell state analysis method based on single-cell transcriptomics and spatial transcriptomics as described in any one of claims 1-9, characterized in that: It includes a data acquisition and processing module, a first mapping model construction module, a current state mapping module, a second mapping model construction module, an average index determination module, an acquisition adjustment module, and a micro-environment adjustment module; The data acquisition and processing module is used to collect and process the raw transcriptome data of historical immune cells, and then obtain the corresponding state index. The first mapping model construction module is used to construct the final immune cell state mapping model; The current state mapping module is used to acquire and process the single-cell transcriptome and spatial transcriptome data of the immune cells to be analyzed, and then perform mapping. The second mapping model construction module is used to construct the final mapping model that affects the average state of immune cells. The average index determination module is used to calculate the average value of the current immune cell status index, and to perform threshold comparison and determination. The acquisition and adjustment module is used to repeatedly adjust the current acquisition operation of transcriptome data of immune cells; The microenvironment adjustment module is used to repeatedly adjust various microenvironment parameters of the current immune cells.