A virtual cell construction method and system
By constructing a coding network based on a structural causal model and using a flow matching method, the intrinsic state of cells and exogenous perturbation factors are separated, and stable causal relationships are learned. This solves the problems of causal relationship confusion and unstable generation process in existing technologies, and achieves high-precision virtual cell construction, thereby improving the interpretability and accuracy of drug screening and disease mechanism research.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-24
AI Technical Summary
Existing cell state modeling methods mostly focus on statistical correlation modeling, ignoring causal relationships. This results in a lack of biological interpretability and accuracy in the generated results, making it difficult to make accurate predictions under unseen conditions. Furthermore, the generation process of traditional generative models is unstable, making it difficult to guarantee the stability and consistency of the data.
We construct an encoding network based on a structural causal model, and use causal decoupling and flow matching methods to separate the endogenous state of cells from exogenous perturbation factors, learn stable causal relationships, and use deterministic cell state changes for modeling to generate virtual cell expression data.
It improves the stability and interpretability of the generation process, achieves high-precision prediction under unseen conditions, solves the problems of causal confusion and combinatorial explosion, and provides new tools for drug screening and disease mechanism research.
Smart Images

Figure CN122455073A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of bioinformatics and artificial intelligence, specifically to a method and system for constructing virtual cells. Background Technology
[0002] With the rapid development of single-cell transcriptomics technology, gene expression data provides a wealth of information for biological research, especially in areas such as cell heterogeneity, drug screening, and personalized medicine, where it has enormous application potential. Existing cell state modeling methods often focus on statistical correlation modeling, neglecting the causal relationships behind cell states, resulting in results that frequently lack biological interpretability and precision.
[0003] Traditional gene expression models typically model gene expression by directly learning statistical correlations between genes. However, these correlation-based models fail to effectively distinguish between endogenous and exogenous perturbations, leading to confusion regarding causal relationships. This makes it difficult for these models to provide accurate inferences about biological mechanisms and lacks explanatory power for biological processes, which significantly limits further drug screening and disease mechanism research.
[0004] Traditional methods rely solely on statistical properties to predict drug-cell combinations, but their performance is often poor when faced with unseen drug combinations or cell types. This is because traditional models cannot effectively learn and capture robust causal relationships, leading to a significant drop in predictive performance under unknown conditions.
[0005] In single-cell data generation, traditional generative models (such as diffusion models) typically rely on random sampling, resulting in a slow and unstable generation process. This is especially true during training, where the data is susceptible to noise, making it difficult to guarantee the stability and consistency of the generated data. This limits the feasibility and practicality of real-time data generation for tasks such as high-throughput drug screening. Summary of the Invention
[0006] The purpose of this invention is to provide a virtual cell construction method and system to solve the above-mentioned technical problems, thereby addressing issues such as causal aliasing, insufficient out-of-distribution generalization ability, unstable generation process, and difficulty in counterfactual reasoning in existing single-cell perturbation prediction methods.
[0007] The objective of this invention can be achieved through the following technical solutions: A method for constructing virtual cells, comprising: S1. Use the single-cell gene expression matrix and the corresponding perturbation condition data as input data; S2. Construct a coding network based on a structural causal model, input single-cell gene expression into the coding network, and output a latent representation; construct perturbation variables based on perturbation condition data; model the latent representation and perturbation variables, and output the decoupled latent representation, where the structural causal model is used to describe the causal relationship between multiple latent variables; S3. Construct a continuous-time evolution path from the initial distribution to the target distribution based on the flow matching model, and determine the state changes in the continuous-time evolution path according to the decoupled potential representation. S4. Input the target perturbation conditions, perform numerical solutions for the continuous-time evolution path, and output virtual cell expression data.
[0008] Furthermore, the perturbation condition data includes at least the drug type, drug dosage, and drug concept label.
[0009] Furthermore, the encoding network is a deep neural network, and the operation steps of the encoding network include: S21. Input the single-cell gene expression matrix into the coding network and calculate the latent representation. : in, This represents a single-cell gene expression matrix. The mapping function representing the encoding network; S22. Generate disturbance variables based on disturbance condition data. : S23. Construct a causal directed acyclic graph (DAG) between latent variables, determine the adjacency matrix A based on the DAG, and calculate the decoupled latent representation z: in, It is the identity matrix; S24. Apply covariance constraints to nodes with no connection in the causal directed acyclic graph so that the corresponding latent variables satisfy the statistical independence constraint.
[0010] Furthermore, the perturbation variable u follows a Gaussian distribution, and its mean and variance are learned through parameterization: in, These represent the mean and variance of the disturbance variable, respectively.
[0011] Furthermore, the method also includes constraint supervision of the decoupled latent representation and perturbation variables between steps S2 and S3: S25. Construct a predictor based on the decoupled latent representation and perturbation variables to obtain the prediction result c: Where z is the decoupled latent representation, u is the perturbation variable, and g is the mapping function of the predictor; S26. Construct a supervised loss function to optimize the predictor parameters: in, For the conditional distribution of the latent representation, For the prior distribution, The loss term is constructed based on the difference between the prediction results and the label data.
[0012] Furthermore, step S3 includes: S31. Construct a continuous time path from the initial distribution to the target distribution, and determine the cell state at any time t in the path: in, For real cell data, For noise data that follows a Gaussian distribution; S32, Based on cell state The decoupled latent representation and time variables are used to construct the joint input; S33. Construct a cross-attention structure based on joint input, where: Where z is the decoupled potential representation; S34. Encode the time variable, and input the encoded result along with the joint input into the vector field model to output the vector field: And satisfy: .
[0013] Furthermore, step S3 also includes: S35, training the vector field by minimizing the difference between the predicted vector field and the true vector field.
[0014] Furthermore, step S4 includes: S41. Intervention based on the decoupled latent representation, including keeping the single-cell gene expression matrix in the decoupled latent representation unchanged and updating the perturbation variables according to the target perturbation conditions; S42. Calculate the latent representations after intervention based on the coding network, so that the latent representations after intervention can propagate among latent variables according to causal relationships; S43. Input the latent representation after intervention as a conditional input to the vector field model; S44. Initialize the cell states in the continuous time path so that the cell states satisfy a Gaussian distribution; S45. Iterative update of cell state based on vector field: S46. Obtain the target state based on the iteratively updated state; use the target state as virtual cell expression data.
[0015] Furthermore, the virtual cell expression data includes cell expression matrices, cell state trajectories, and perturbation response scores.
[0016] Furthermore, a virtual cell construction system includes: The data input module is used to acquire the single-cell gene expression matrix and the perturbation condition data corresponding to the single-cell gene expression matrix; The coding network module is used to input single-cell gene expression into the coding network, generate potential representations, and construct perturbation variables based on perturbation condition data; The causal decoupling modeling module constructs a structural causal model based on the latent representations and perturbation variables generated by the encoding network module. It models the latent representations and perturbation variables to generate decoupled latent representations. The structural causal model is used to describe the causal relationships between multiple latent variables. The flow matching generation module is used to construct a continuous-time evolution path from the initial distribution to the target distribution based on the decoupled latent representation, and to numerically solve the continuous-time evolution path to generate virtual cell expression data under the target conditions. The supervision and constraint module is used to build a predictor based on the decoupled latent representation and perturbation variables, and generate prediction results. The counterfactual intervention module is used to intervene in specific factors in the latent space, including fixing the latent representation representing the endogenous state of the cell and replacing the latent representation representing the exogenous perturbation with the representation corresponding to the target condition. The intervention information is propagated based on the causal structure to generate the latent representation after intervention. The latent representation after intervention is used as a condition input to the generation module to generate virtual cell expression data. The output module is used to output virtual cell expression data.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention constructs an encoding network based on a structural causal model and models the decoupled latent representations and perturbation variables, separating the endogenous state of cells from exogenous perturbation factors, thereby avoiding causal confusion, improving interpretability, and making the prediction results more consistent with actual biological mechanisms.
[0018] 2. This invention achieves accurate prediction of drug and cell combinations by learning stable causal relationships rather than simple statistical correlations. Even without available data, it maintains high prediction accuracy, improves predictive capabilities under out-of-distribution conditions, and solves the combinatorial explosion problem.
[0019] 3. This invention employs a conditional flow matching method, which models cell state changes through deterministic means, replacing the random sampling process in traditional generative models. This improves generation efficiency and training stability, providing a more efficient solution for real-time generation of cell expression data.
[0020] 4. This invention predicts cell states under unobserved conditions by intervening in potential factors, thus constructing a virtual cell model. This provides a new tool for drug screening and mechanism research, and enables the prediction of cell responses under unseen drug conditions, improving the controllability and accuracy of virtual cell construction. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating a virtual cell construction method according to the present invention; Figure 2 This is a flowchart illustrating the flow matching model in a virtual cell construction method of the present invention; Figure 3 This is a schematic diagram illustrating an application scenario of the virtual cell construction method of the present invention. Detailed Implementation
[0022] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0023] like Figures 1 to 3 A virtual cell construction method shown includes: S1. The single-cell gene expression matrix and its corresponding perturbation conditions are used as input data; each sample in the single-cell gene expression matrix represents the gene expression vector of a single cell. Simultaneously, cell-related biological condition information is incorporated, including cell type, drug perturbation type, dosage information, and other experimental conditions. The input data is then normalized and feature-selected. This provides a unified format of high-dimensional expression data and corresponding condition information for subsequent models.
[0024] S2. Construct a coding network based on a structural causal model. Input single-cell gene expression into the coding network and output a latent representation. Map single-cell gene expression to a latent space to obtain multiple latent factors, each corresponding to a biological concept. Construct perturbation variables based on perturbation condition data; model the latent representation and perturbation variables, and output a decoupled latent representation. The structural causal model is used to describe the causal relationships between multiple latent variables. Achieve causal separation between endogenous cellular states and exogenous perturbation factors, providing a controllable representation for subsequent intervention and generation.
[0025] S3. Based on the flow matching model, a continuous-time evolution path from the initial distribution to the target distribution is constructed, and the state changes in the continuous-time evolution path are determined according to the decoupled potential representation. By learning deterministic cell state changes, the distribution of real cell data is continuously evolved, realizing efficient and stable single-cell expression data generation and maintaining the consistency of biological signals.
[0026] S4. Input the target perturbation conditions, numerically solve the continuous-time evolution path, and output virtual cell expression data. Based on the causal decoupling representation, intervene in specific factors in the latent space to achieve counterfactual prediction. Support cell state prediction under unobserved conditions and realize virtual cell construction.
[0027] S5. Post-process the generated gene expression data, including non-negative constraint processing and sparsification processing, to simulate the characteristics of real single-cell sequencing data, and output the final prediction results.
[0028] This invention constructs a coding network based on a structural causal model and models the decoupled latent representations and perturbation variables, separating the intrinsic state of cells from exogenous perturbation factors. This avoids causal confusion, improves interpretability, and makes the prediction results more consistent with actual biological mechanisms. By learning stable causal relationships rather than simple statistical correlations, it achieves accurate prediction of drug-cell combinations. Even under unseen data conditions, it maintains high prediction accuracy, improves prediction capabilities under out-of-distribution conditions, and solves the combinatorial explosion problem. Employing a conditional flow matching method, it models deterministic cell state changes, replacing the random sampling process in traditional generative models, improving generation efficiency and training stability, and providing a more efficient solution for real-time generation of cell expression data. By intervening in latent factors, it achieves prediction of cell states under unobserved conditions, constructing a virtual cell model. This provides a new tool for drug screening and mechanism research, and can predict cell responses under unseen drug conditions, improving the controllability and accuracy of virtual cell construction.
[0029] Specifically, the encoding network is a deep neural network, and the operation steps of the encoding network include: S21. Input the single-cell gene expression matrix into the coding network and calculate the latent representation. : in, This represents a single-cell gene expression matrix. N is the number of cells, and G is the number of genes. The mapping function representing the encoding network; S22. Generate disturbance variables based on disturbance condition data. The perturbation variable u follows a Gaussian distribution, and its mean and variance are learned through parameterization. in, These represent the mean and variance of the disturbance variable, respectively.
[0030] S23. Construct a causal directed acyclic graph (DAG) between latent variables, determine the adjacency matrix A based on the DAG, and calculate the decoupled latent representation z: in, It is the identity matrix; S24. Apply covariance constraints to nodes with no connections in the causal directed acyclic graph, ensuring that the corresponding latent variables satisfy statistical independence constraints. Applying statistical independence constraints to nodes with no connections in the causal graph makes their covariance approach zero, thereby preventing information leakage. Generate latent variables through reparameterization methods to achieve decoupled representation of endogenous factors and exogenous disturbance factors.
[0031] Decouple drug perturbation from the cellular state to clarify the causal propagation path of the perturbation.
[0032] Specifically, the method also includes constraint supervision of the decoupled potential representation and perturbation variables between steps S2 and S3: S25. Construct a predictor based on the decoupled latent representation and perturbation variables to obtain the prediction result c: Where z is the decoupled latent representation, u is the perturbation variable, and g is the mapping function of the predictor; S26. Construct a supervised loss function to optimize the predictor parameters: in, For the conditional distribution of the latent representation, For the prior distribution, The loss term is constructed based on the difference between the predicted results and the labeled data. By supervising the decoupled latent representation and perturbation variables, the biological interpretability of the latent variables is ensured, and the representation space is aligned with cell type or functional labels.
[0033] Specifically, step S3 includes: S31. Construct a velocity field neural network to predict the direction of state change at any time point, i.e., construct a continuous time path from the initial distribution to the target distribution, and determine the cell state at any time t in the path: in, For real cell data, For noise data that follows a Gaussian distribution, , t∈[0,1]; thus defining a continuous temporal path from a simple prior distribution (such as Gaussian noise) to the true gene expression distribution; S32, Based on cell state The decoupled latent representation and time variables are used to construct the joint input; S33. Construct a cross-attention structure based on joint input, where: Where z is the decoupled latent representation; a cross-attention mechanism is used to take the decoupled latent factors as conditional inputs to guide the generation process; S34. Encode the time variable, and input the encoded result along with the joint input into the vector field model to output the vector field: And satisfy: The time variables are encoded using a time embedding function and then acted on in conjunction with latent factors in the velocity field network.
[0034] S35. The vector field is trained by minimizing the difference between the predicted vector field and the true vector field. The formula for minimizing the predicted vector field is: This enables the model to learn the actual direction of change.
[0035] Specifically, step S4 includes: S41. Intervention based on the decoupled latent representation, including keeping the single-cell gene expression matrix in the decoupled latent representation unchanged and updating the perturbation variables according to the target perturbation conditions; S42. Calculate the latent representations after intervention based on the coding network, so that the latent representations after intervention can propagate among latent variables according to causal relationships; S43. Input the latent representation after intervention as a conditional input to the vector field model; S44. Initialize the cell states in the continuous time path so that the cell states satisfy a Gaussian distribution; S45. Iterative update of cell state based on vector field: S46. Obtain the target state based on the iteratively updated state; use the target state as virtual cell expression data.
[0036] The virtual cell expression data includes a cell expression matrix, cell state trajectories, and perturbation response scores. The cell expression matrix is derived from the final state obtained through numerical solution of a continuous-time evolution path, iterating step-by-step from an initial noisy state until the termination time. All generated cell states are stacked to form a cell expression matrix; the cell state trajectory is the intermediate state sequence at each step in the numerical solution process, and the state at each time step is recorded during the numerical integration process; the perturbation response score is used as a quantitative indicator to measure the difference in cell states before and after perturbation. The perturbation response score is calculated based on the gene expression difference between virtual cell expression data and control cell expression data. Optionally, the perturbation response score can be expressed as L1 norm and L2 norm.
[0037] A virtual cell construction system, comprising: The data input module is used to acquire the single-cell gene expression matrix and the perturbation condition data corresponding to the single-cell gene expression matrix; The coding network module is used to input single-cell gene expression into the coding network, generate potential representations, and construct perturbation variables based on perturbation condition data; The causal decoupling modeling module constructs a structural causal model based on the latent representations and perturbation variables generated by the encoding network module. It models the latent representations and perturbation variables to generate decoupled latent representations. The structural causal model is used to describe the causal relationships between multiple latent variables. The flow matching generation module is used to construct a continuous-time evolution path from the initial distribution to the target distribution based on the decoupled latent representation, and to numerically solve the continuous-time evolution path to generate virtual cell expression data under the target conditions. The supervision and constraint module is used to build a predictor based on the decoupled latent representation and perturbation variables, and generate prediction results. The counterfactual intervention module is used to intervene in specific factors in the latent space, including fixing the latent representation representing the endogenous state of the cell and replacing the latent representation representing the exogenous perturbation with the representation corresponding to the target condition. The intervention information is propagated based on the causal structure to generate the latent representation after intervention. The latent representation after intervention is used as a condition input to the generation module to generate virtual cell expression data. The output module is used to output virtual cell expression data.
[0038] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0039] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.
[0040] The present invention has been further described above with reference to specific embodiments. However, it should be understood that the specific description herein should not be construed as limiting the nature and scope of the present invention. Various modifications made to the above embodiments by those skilled in the art after reading this specification are all within the scope of protection of the present invention.
Claims
1. A method for constructing virtual cells, characterized in that, include: S1. Use the single-cell gene expression matrix and the corresponding perturbation condition data as input data; S2. Construct a coding network based on a structural causal model, input the single-cell gene expression into the coding network, and output a latent representation; construct perturbation variables based on the perturbation condition data; model the latent representation and the perturbation variables, and output a decoupled latent representation, wherein the structural causal model is used to describe the causal relationship between multiple latent variables; S3. Construct a continuous-time evolution path from the initial distribution to the target distribution based on the flow matching model, and determine the state changes in the continuous-time evolution path according to the decoupled potential representation; S4. Input the target perturbation conditions, perform numerical solutions on the continuous-time evolution path, and output virtual cell expression data.
2. The virtual cell construction method according to claim 1, characterized in that, The perturbation condition data includes at least the drug type, drug dosage, and drug concept label.
3. The virtual cell construction method according to claim 1, characterized in that, The encoding network is a deep neural network, and the operation steps of the encoding network include: S21. Input the single-cell gene expression matrix into the coding network and calculate the latent representation. : in, This represents a single-cell gene expression matrix. The mapping function representing the encoding network; S22. Generate disturbance variables based on the disturbance condition data. : S23. Construct a causal directed acyclic graph (DAG) between latent variables, determine the adjacency matrix A based on the DAG, and calculate the decoupled latent representation z: in, It is the identity matrix; S24. Apply covariance constraints to nodes with no connection in the causal directed acyclic graph so that the corresponding latent variables satisfy statistical independence constraints.
4. The virtual cell construction method according to claim 3, characterized in that, The perturbation variable u follows a Gaussian distribution, and its mean and variance are learned through parameterization: in, These represent the mean and variance of the disturbance variable, respectively.
5. A method for constructing virtual cells according to any one of claims 1 or 3, characterized in that, The method further includes constraining and supervising the decoupled latent representation and the perturbation variable between steps S2 and S3: S25. Construct a predictor based on the decoupled latent representation and perturbation variables to obtain the prediction result c: Where z is the decoupled latent representation, u is the perturbation variable, and g is the mapping function of the predictor; S26. Construct a supervised loss function to optimize the predictor parameters: in, For the conditional distribution of the latent representation, As a prior distribution, the The loss term is constructed based on the difference between the prediction results and the label data.
6. The virtual cell construction method according to claim 1, characterized in that, Step S3 includes: S31. Construct a continuous time path from the initial distribution to the target distribution, and determine the cell state at any time t in the path: in, For real cell data, For noise data that follows a Gaussian distribution; S32, Based on the cell state The decoupled latent representation and time variables are used to construct the joint input; S33. Construct a cross-attention structure based on the joint input, wherein: Where z is the decoupled potential representation; S34. Encode the time variable, and input the encoded result and the joint input into the vector field model to output the vector field: And satisfy: 。 7. The virtual cell construction method according to claim 6, characterized in that, Step S3 further includes: S35, training the vector field by minimizing the difference between the predicted vector field and the true vector field.
8. A method for constructing virtual cells according to claim 6, characterized in that, Step S4 includes: S41. Intervene based on the decoupled latent representation, including keeping the single-cell gene expression matrix in the decoupled latent representation unchanged and updating the perturbation variable according to the target perturbation condition; S42. Calculate the latent representation after intervention based on the coding network, so that the latent representation after intervention propagates among latent variables according to causal relationships; S43. Input the latent representation after intervention as a conditional input to the vector field model; S44. Initialize the cell states in the continuous time path so that the cell states satisfy a Gaussian distribution; S45. Iteratively update the cell state based on the vector field: S46. Obtain the target state based on the iteratively updated state; use the target state as the virtual cell expression data.
9. A method for constructing virtual cells according to any one of claims 1 or 8, characterized in that, The virtual cell expression data includes a cell expression matrix, cell state trajectory, and perturbation response score.
10. A virtual cell construction system, characterized in that, include: The data input module is used to acquire the single-cell gene expression matrix and the perturbation condition data corresponding to the single-cell gene expression matrix; The coding network module is used to input the single-cell gene expression into the coding network, generate the potential representation, and construct perturbation variables based on the perturbation condition data; The causal decoupling modeling module constructs a structural causal model based on the latent representation and perturbation variables generated by the encoding network module. It models the latent representation and the perturbation variables to generate a decoupled latent representation. The structural causal model is used to describe the causal relationship between multiple latent variables. The flow matching generation module is used to construct a continuous-time evolution path from the initial distribution to the target distribution based on the decoupled latent representation, and to numerically solve the continuous-time evolution path to generate virtual cell expression data under the target conditions. The supervision and constraint module is used to construct a predictor based on the decoupled latent representation and perturbation variables, and generate prediction results; The counterfactual intervention module is used to intervene in specific factors in the latent space, including fixing the latent representation representing the endogenous state of the cell and replacing the latent representation representing the exogenous perturbation with the representation corresponding to the target condition, propagating the intervention information based on the causal structure, generating the latent representation after intervention, and using the latent representation after intervention as a condition input to the generation module to generate virtual cell expression data; The output module is used to output the virtual cell expression data.