A gene regulatory relationship model generation method and device

By screening and generating input features from the initial gene expression matrix, and using encoders and decoders to generate gene regulatory relationship models, the problems of high computational complexity and missing maps in existing technologies are solved, and efficient gene regulatory relationship training and prediction are achieved.

CN116403634BActive Publication Date: 2026-06-02BIOMAP (BEIJING) INTELLIGENCE TECH LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BIOMAP (BEIJING) INTELLIGENCE TECH LTD
Filing Date
2023-01-19
Publication Date
2026-06-02

Smart Images

  • Figure CN116403634B_ABST
    Figure CN116403634B_ABST
Patent Text Reader

Abstract

The application provides a gene regulation relationship model generation method and device, the method comprises the following steps: obtaining an initial gene expression matrix; randomly selecting a plurality of elements in the initial gene expression matrix as first-type elements, and selecting elements in the gene expression matrix except the first-type elements as second-type elements; determining input features according to the positions of the elements in the initial gene expression matrix; inputting the input features into a to-be-trained gene regulation relationship model to obtain a gene regulation relationship representation, converting the gene regulation relationship representation to generate a predicted gene expression matrix; and updating model parameters in the to-be-trained gene regulation relationship model based on the initial gene expression matrix and the predicted gene expression matrix to generate a gene regulation relationship model. By using the above gene regulation relationship model generation method and device, the problems of great difficulty in training the regulation relationship model and systematic defects in the regulation relationship atlas learned by the model are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of bioinformatics technology, and more specifically, to a method and apparatus for generating gene regulation relationship models. Background Technology

[0002] Gene regulatory networks are dynamic biochemical networks formed by the interactions between genes. They enable a systems-wide understanding of the transmission of biological genetic signals and the laws governing cell division, and are crucial for elucidating the biological mechanisms of cell cycle, damage repair, and apoptosis. Gene regulatory networks are built upon information about the regulatory relationships between cellular genes. This information is vital for cellular tasks; for example, cell classification requires information on gene co-expression for more accurate classification, and predicting gene expression under perturbation also relies on regulatory information. Currently, the common approach is to input cellular gene expression levels into regulatory relationship models to predict the regulatory relationships between cellular genes.

[0003] However, in existing regulatory relationship models, the computational complexity is exponentially greater than the length of the input data. As the amount of input data increases, the number of model parameters required also increases, leading to increased computational complexity and workload, and making model training difficult. Therefore, during training, the amount of input data must be reduced, for example, by selecting only the expression levels of hypervariable genes in cells as input. However, ignoring non-hypervariable genes results in systematic gaps in the regulatory relationship map learned by the model. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a method and apparatus for generating gene regulation relationship models, so as to solve the problems of high training difficulty of regulation relationship models and systematic lack of the regulatory relationship map learned by the model.

[0005] In a first aspect, embodiments of this application provide a method for generating a gene regulation relationship model, including:

[0006] Obtain the initial gene expression matrix corresponding to the target cells. The initial gene expression matrix includes the expression levels of hypervariable genes and non-hypervariable genes in the cells.

[0007] Multiple elements in the initial gene expression matrix are randomly selected as first-class elements, and the elements in the gene expression matrix other than the first-class elements are selected as second-class elements.

[0008] Based on the position of the element in the initial gene expression matrix, the input features are determined. The input features include the second gene features corresponding to the elements in the second category that have non-zero values. The input features do not include the first gene features corresponding to the first category elements and the zero-value gene features corresponding to the elements in the second category that have zero values. The second gene features are determined based on the gene expression level and the gene identifier corresponding to the gene.

[0009] Input features are fed into the gene regulation relationship model to be trained to obtain a gene regulation relationship representation. The gene regulation relationship representation is then transformed to generate a predicted gene expression matrix. The elements in the predicted gene expression matrix correspond to the elements in the initial gene expression matrix.

[0010] The model parameters in the gene regulation relationship model to be trained are updated based on the initial gene expression matrix and the predicted gene expression matrix to generate the trained gene regulation relationship model.

[0011] Optionally, obtaining the initial gene expression matrix corresponding to the target cell includes: using the cell identifier of the target cell and the gene identifier of each gene in the target cell as the first dimension and the second dimension of the matrix, respectively, and using the gene expression level of each gene as the value of the corresponding element in the matrix to construct the initial gene expression matrix; wherein the gene expression level of each gene is obtained by gene sequencing.

[0012] Optionally, the gene regulation relationship model to be trained includes an encoder and a decoder; inputting the input features into the gene regulation relationship model to obtain a gene regulation relationship representation includes: inputting the input features into the encoder to obtain an initial coding feature tensor; merging the first gene features corresponding to the first type of elements and the zero-value gene features corresponding to the elements with a value of 0 in the second type of elements with the initial coding feature tensor according to the position of the elements in the initial gene expression matrix to obtain a target coding feature tensor; and inputting the target coding feature tensor into the decoder to obtain a gene regulation relationship representation.

[0013] Optionally, the input features are determined based on the position of the element in the initial gene expression matrix, including: generating a second gene expression feature based on the element values ​​of non-zero elements in the second category; generating a second gene identifier feature based on the gene identifier corresponding to the non-zero elements in the second category; and determining the second gene feature based on the second gene expression feature and the second gene identifier feature. The method further includes: determining a first gene feature based on the first gene expression feature corresponding to the first category and the first gene identifier feature corresponding to the first category; wherein, the first gene expression feature corresponding to all first category elements is the same, and the first gene expression feature is different from the second gene expression feature; and determining a zero-value gene feature based on the third gene expression feature corresponding to the element with a value of 0 in the second category and the third gene identifier feature corresponding to the element with a value of 0 in the second category.

[0014] Optionally, the encoder includes M layers of encoding units, and the decoder includes N layers of decoding units, where the value of M is greater than the value of N.

[0015] Optionally, each encoding unit of the encoder includes a multi-head attention unit and a forward propagation unit; each decoding unit of the decoder includes a forward propagation unit, and also includes a linear attention unit or a sparse attention unit.

[0016] Optionally, the model parameters in the gene regulation relationship model to be trained are updated based on the initial gene expression matrix and the predicted gene expression matrix, including: calculating the difference between the value of each element in the predicted gene expression matrix and the value of the corresponding element in the initial gene expression matrix; determining the loss value based on the difference; if the training termination condition is not met, adjusting the values ​​of the model parameters based on the loss value, and returning to the step of randomly selecting multiple elements in the initial gene expression matrix as the first type of elements.

[0017] Optionally, generating a second gene expression feature based on the element values ​​of non-zero elements in the second category of elements includes: inputting the element values ​​of non-zero elements in the second category of elements into a gene expression feature extraction model to generate a second gene expression feature; the method further includes: adjusting the parameter values ​​of the gene expression feature extraction model based on a loss value, wherein the loss value is determined based on the difference between the value of each element in the predicted gene expression matrix and the value of the element at the corresponding position in the initial gene expression matrix.

[0018] Secondly, embodiments of this application also provide a gene regulation relationship model generation device, the device comprising:

[0019] The first matrix generation module is used to obtain the initial gene expression matrix corresponding to the target cell. The initial gene expression matrix includes the expression levels of hypervariable genes and non-hypervariable genes in the cell.

[0020] The element selection module is used to randomly select multiple elements from the initial gene expression matrix as first-class elements, and to select elements from the gene expression matrix other than the first-class elements as second-class elements.

[0021] The input feature determination module is used to determine the input features based on the position of the elements in the initial gene expression matrix;

[0022] The second matrix generation module is used to input the input features into the gene regulation relationship model to be trained to obtain the gene regulation relationship representation, transform the gene regulation relationship representation to generate a predicted gene expression matrix, and the elements in the predicted gene expression matrix correspond to the elements in the initial gene expression matrix.

[0023] The model generation module is used to update the model parameters in the gene regulation relationship model to be trained based on the initial gene expression matrix and the predicted gene expression matrix, and generate the trained gene regulation relationship model.

[0024] Thirdly, embodiments of this application also provide a method for determining gene regulatory relationships, including:

[0025] Obtain the gene expression level matrix corresponding to the cells to be treated; wherein the genes expressed by the cells to be treated are a subset of the genes contained in the initial gene expression level matrix;

[0026] The gene expression matrix is ​​input into the gene regulation model to obtain the gene regulation relationship representation, which is a three-dimensional tensor.

[0027] Among them, the gene regulation relationship model is generated according to the gene regulation relationship model generation method.

[0028] Fourthly, embodiments of this application also provide a cell classification method, including:

[0029] Based on the gene regulation relationship representation, determine the target regulation relationship representation for each cell to be treated;

[0030] The target regulatory relationship representation corresponding to each cell to be treated is input into the cell classification model to obtain the classification results of each cell to be treated;

[0031] The gene regulatory relationship is represented by a gene regulatory relationship determination method.

[0032] Fifthly, embodiments of this application also provide a method for predicting perturbation expression levels, including:

[0033] Determine the perturbation information targeting the genes or proteins of the cell to be treated;

[0034] The gene regulation relationship representation and perturbation information are input into the perturbation expression level prediction model to obtain the perturbation expression level prediction results;

[0035] The gene regulatory relationship is represented by a gene regulatory relationship determination method.

[0036] Sixthly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform steps such as the gene regulation relationship model generation method, and / or, cell classification method, and / or, perturbation expression level prediction method described above.

[0037] In a seventh aspect, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the gene regulation relationship model generation method, and / or, cell classification method, and / or, perturbation expression level prediction method described above.

[0038] The embodiments of this application bring the following beneficial effects:

[0039] This application provides a method and apparatus for generating a gene regulation relationship model. From an initial gene expression matrix including the expression levels of hypervariable and non-hypervariable genes, the first type of elements and elements with a value of 0 are removed. Only the input features corresponding to the non-zero elements in the second type of elements are used as input to the gene regulation relationship model to be trained. This eliminates the need for computation on large amounts of data, reducing computational complexity and workload, and improving training efficiency. The model can learn potential gene regulation relationships at the whole-genome level. Compared with existing gene regulation relationship model generation methods, this method solves the problems of high training difficulty for regulation relationship models and systematic gaps in the learned regulatory relationship maps.

[0040] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1A flowchart of the gene regulation relationship model generation method provided in the embodiments of this application is shown;

[0043] Figure 2 This paper shows a schematic diagram of the gene regulation relationship model generation device provided in an embodiment of this application;

[0044] Figure 3 A flowchart of the gene regulation relationship determination method provided in the embodiments of this application is shown;

[0045] Figure 4 A flowchart of the cell classification method provided in the embodiments of this application is shown;

[0046] Figure 5 A flowchart of the perturbation expression level prediction method provided in the embodiments of this application is shown;

[0047] Figure 6 A schematic diagram of the structure of the electronic device provided in the embodiments of this application is shown. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0049] It is worth noting that prior to this application, gene regulatory networks were dynamic biochemical networks formed by the interactions between genes. These networks enabled a systematic understanding of biological genetic signal transmission and cell division, playing a crucial role in elucidating the biological mechanisms of cell cycle, damage repair, and apoptosis. Gene regulatory networks are built upon information about the regulatory relationships between cellular genes, which is vital for cell-related tasks. For example, cell classification requires information on gene co-expression for more accurate classification, and predicting perturbed cell gene expression also relies on regulatory information. Currently, gene expression levels are typically input into regulatory relationship models to predict these relationships. However, in existing regulatory relationship models, the computational complexity is exponentially greater than the length of the input data. As the amount of input data increases, the number of model parameters required also increases, leading to increased computational complexity and workload, and making model training difficult. Therefore, training can only reduce the amount of input data, for example, by selecting only the expression levels of highly variable genes in the cell. However, ignoring non-highly variable genes results in a systematic gap in the regulatory relationship map learned by the model.

[0050] Based on this, embodiments of this application provide a method for generating gene regulation relationship models to improve training efficiency and reduce training difficulty.

[0051] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for generating a gene regulation relationship model provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the gene regulation relationship model generation method includes:

[0052] Step S101: Obtain the initial gene expression matrix corresponding to the target cells.

[0053] In this step, the target cell can refer to a cell in the human or animal body, and the target cell contains multiple genes. The target cell can include multiple different types of cells, such as T cells and B cells.

[0054] The initial gene expression matrix refers to a matrix used to characterize the expression levels of different genes in different cells. The initial gene expression matrix includes the expression levels of hypervariable genes and non-hypervariable genes in a single cell, that is, it includes the expression levels of the entire genome in a single cell.

[0055] Among them, hypervariable genes refer to genes whose expression levels vary greatly in different cells. For example, a gene may be expressed at a very high level in some cells and at a very low level in other cells. Hypervariable genes are genes that are more likely to be regulated by other genes. Here, being regulated by other genes can mean being activated or inhibited by other genes.

[0056] In the embodiments of this application, the proportion of non-zero gene expression levels in cells is on the order of approximately 10%. Therefore, the initial gene expression matrix is ​​a very sparse matrix. The more elements in the matrix that have a value of 0, the sparser the matrix is; the fewer elements in the matrix that have a value of 0, the denser the matrix is.

[0057] In one optional embodiment, obtaining the initial gene expression level matrix corresponding to the target cell includes: using the cell identifier of the target cell and the gene identifier of each gene in the target cell as the first dimension and the second dimension of the matrix, respectively, and using the gene expression level of each gene as the value of the corresponding element in the matrix to construct the initial gene expression level matrix; wherein the gene expression level of each gene is obtained by gene sequencing.

[0058] Specifically, assuming there are three target cells, labeled Cell_1, Cell_2, and Cell_3, and six genes in total, labeled Gene_1, Gene_2, Gene_3, Gene_4, Gene_5, and Gene_6, the following steps are taken. First, gene sequencing is performed on these three target cells to obtain the expression levels of each gene. Then, these gene expression levels are used as elements in a matrix to generate an initial gene expression matrix.

[0059] The initial gene expression matrix is ​​illustrated in Table 1 below.

[0060] The gene expression matrix includes the numerical portion shown in Table 1.

[0061] Cells / Genes Gene_1 Gene_2 Gene_3 Gene_4 Gene_5 Gene_6 Cell_1 2.1 0 0 0.3 1.5 2.7 Cell_2 0 0 3.0 0 0.9 0 Cell_3 1.2 0 0 1.4 0 4.5

[0062] Taking the value of 2.7 in the last cell of the first row of Table 1 as an example, it means that the expression level of gene Gene_6 in cell Cell_1 is 2.7.

[0063] Step S102: Randomly select multiple elements from the initial gene expression matrix as first-class elements, and select the elements from the gene expression matrix other than the first-class elements as second-class elements.

[0064] In this step, the first type of element can refer to the elements in the initial gene expression matrix that are filtered out for the first time. The role of the first type of element is to reduce the amount of input data for the gene regulatory relationship model to be trained at the whole genome level.

[0065] The second type of element can refer to the elements in the initial gene expression matrix that remain unfiltered after the first filtering.

[0066] In this embodiment, the total number of elements in the first category can be selected first. For example, if the total number of elements in the first category is less than 70% of the total number of elements in the initial gene expression matrix, then taking Table 1 as an example, the total number of elements in Table 1 is 3 × 6 = 18, 18 × 0.7 = 12.6. Therefore, the total number of elements in the first category can be 11 or 12. Here, the total number of elements in the first category is selected as 12. Then, 12 elements are randomly selected from the initial gene expression matrix as the first category elements, and the remaining 6 elements are used as the second category elements. In the process of selecting 12 elements as the first category elements, the selection should be carried out according to the principle of uniform randomness. For example, multiple random numbers are generated, each corresponding to one element, and these random numbers follow a uniform distribution with a mean of 0 and a variance of 1. The top 12 random numbers with the largest values ​​are selected as the random numbers corresponding to the first category elements, and the elements corresponding to the top 12 random numbers are determined as the first category elements.

[0067] Understandably, the number of the first element can be determined based on the sparsity of the initial gene expression matrix and the desired model size. A smaller desired model size allows for a larger number of the first element, i.e., a larger number of elements filtered out. Conversely, a sparser initial gene expression matrix allows for a smaller number of the first element, i.e., fewer elements filtered out. Step S103: Determine the input features based on the position of the element in the initial gene expression matrix.

[0068] The input features include the second gene features corresponding to the elements in the second category that have a non-zero value. The input features do not include the first gene features corresponding to the first category of elements and the zero-value gene features corresponding to the elements in the second category that have a zero value. The second gene features are determined based on the gene expression level and the gene identifier corresponding to the gene.

[0069] In this step, the input features can refer to the gene features corresponding to the elements remaining after the first and second filters. The second filter can refer to filtering elements in the second category that have a value of 0.

[0070] The second gene feature is determined based on gene expression level features and gene identification features. The second gene feature corresponds to different gene expression levels and / or different gene identification features. The first type of element, the zero-value element of the second type of element, and the non-zero element of the second type of element all correspond to gene features, which are respectively called the first gene feature, the second gene feature, and the zero-value gene feature.

[0071] For example, the input feature can be a C×L×D tensor, where C is the number of cells, L is the number of genes expected to have the highest non-zero expression in a single cell, and D is the length of the gene feature. If the number of genes with the highest non-zero expression in a cell is less than L, padding is performed, as shown in the Pad position in Table 2. Each element in Table 2 corresponds to a D-dimensional gene feature. Among them, non-zero elements in the second category correspond to the second gene feature, and padding elements correspond to padding gene features, for example, specifying a uniform padding gene feature for all padding elements.

[0072] Table 2 shows the gene characteristics.

[0073] Cell_1 0.3 1.5 2.7 Cell_2 3.0 0.9 Pad Cell_3 1.2 1.4 4.5

[0074] For example, the input features can be a tensor of the number of second-class non-zero elements × D, where the second-class non-zero elements in the input features are arranged in the order of row number and column number (e.g., first in ascending order of row number, then in ascending order of column number).

[0075] For example, gene characteristics can be determined by gene expression level characteristics and gene identifier characteristics. Gene expression level characteristics are related to the gene expression level corresponding to an element; if the gene expression levels corresponding to elements are the same, then their corresponding gene expression level characteristics are the same. Gene identifier characteristics are related to the gene identifier corresponding to an element; if the gene identifier corresponding to an element is the same, then its corresponding gene identifier characteristics are the same. Gene expression level characteristics and gene identifier characteristics can be determined by looking up a mapping table or by other methods. For example, a mapping relationship between gene identifiers and gene identifier characteristics can be pre-set (e.g., gene identifier 1 corresponds to gene identifier characteristic 1…), thus enabling the determination of gene identifier characteristics based on gene identifiers. Similarly, a mapping relationship between gene expression levels and gene expression level characteristics can be pre-set, thus enabling the determination of gene expression level characteristics based on gene expression levels. It is understood that gene expression levels are usually decimals; the gene expression level can be rounded or categorized to determine its corresponding gene expression level characteristics. For example, if a gene expression level rounded to 1 corresponds to gene expression level characteristic 1, then it corresponds to gene expression level characteristic 1. Or, if a gene expression level of 1-1.99 is classified into category 1, then it corresponds to gene expression level characteristic 1. The gene characteristics corresponding to the Pad element can be specified values ​​for gene characteristics of different elements.

[0076] Understandably, the gene expression levels corresponding to the first type of elements are unknown, therefore a uniform first gene expression level feature can be assigned to the first type of elements. The positions of the first type of elements are known, therefore the gene identifier features corresponding to the first element can be determined. The gene expression level features of the zero-value elements in the second type of elements are the same, and their gene identifier features can be determined based on the gene identifier corresponding to their position.

[0077] Step S104: Input the input features into the gene regulation relationship model to be trained to obtain the gene regulation relationship representation, and transform the gene regulation relationship representation to generate a predicted gene expression matrix.

[0078] In this step, the gene regulation relationship model to be trained can refer to an untrained model. The gene regulation relationship model to be trained is used to obtain a gene regulation relationship model after training.

[0079] Gene regulation relationship representation can refer to the expression tensor of the regulatory relationship between various genes. The gene regulation relationship representation is a three-dimensional tensor, which includes not only the regulatory relationship between various genes, but also the expression level information of each gene in the cell.

[0080] For example, gene regulation relationships are represented as a three-dimensional tensor of C×G×D, where C represents the number of cells (in the example above, C=3); G represents the number of genes (in the example above, G=6); and D represents the feature dimension, which is usually a power of 2, such as 128.

[0081] For example, after obtaining the gene regulation relationship representation, the gene regulation relationship representation is transformed through a layer network to obtain the predicted gene expression matrix. The predicted gene expression matrix is ​​a prediction matrix that predicts the values ​​of the first type of elements in the initial gene expression matrix.

[0082] The elements in the predicted gene expression matrix correspond to the elements in the initial gene expression matrix. That is, if the initial gene expression matrix is ​​A×B dimensional, then the predicted gene expression matrix is ​​also A×B dimensional.

[0083] In one optional embodiment, the gene regulation relationship model to be trained includes an encoder and a decoder; inputting input features into the gene regulation relationship model to obtain a gene regulation relationship representation includes: inputting input features into the encoder to obtain an initial coding feature tensor; merging the first gene features corresponding to the first type of elements and the zero-value gene features corresponding to the elements with a value of 0 in the second type of elements with the initial coding feature tensor according to the position of the elements in the initial gene expression matrix to obtain a target coding feature tensor; and inputting the target coding feature tensor into the decoder to obtain a gene regulation relationship representation.

[0084] Here, the encoder is used to determine the feature information of the second type of elements, where the feature information includes expression level information and regulatory relationship information.

[0085] The decoder is used to reconstruct the expression information of the first type of element based on the expression level information and the regulatory relationship information.

[0086] Specifically, the gene regulation relationship model to be trained consists of two parts: an encoder and a decoder. First, the input features are fed into the encoder to obtain an initial coding feature tensor (e.g., a C×L×D tensor). This initial coding feature tensor includes expression level information of the second-class elements and regulatory relationship information. Then, according to the positions of all elements (first-class elements and second-class elements with 0 and non-zero values) in the initial gene expression matrix, the first gene features corresponding to the first-class elements and the zero-value gene features corresponding to the elements with a value of 0 in the second-class elements are merged with the initial coding feature tensor to obtain the target coding feature tensor (e.g., a C×G×D tensor). Finally, the target coding feature tensor is input into the decoder to obtain the gene regulation relationship representation (e.g., a C×G×D tensor) to predict the updated first gene features corresponding to each first-class element.

[0087] In an optional embodiment, determining input features based on the order of elements in the initial gene expression matrix includes: generating second gene expression features based on the element values ​​of non-zero elements in the second category of elements; generating second gene identifier features based on the gene identifiers corresponding to the non-zero elements in the second category of elements; determining second gene features based on the second gene expression features and the second gene identifier features; the method further includes: determining first gene features based on the first gene expression features corresponding to the first category of elements and the first gene identifier features corresponding to the first category of elements; wherein, the first gene expression features corresponding to all first category of elements are the same, and the first gene expression features are different from the second gene expression features; determining zero-value gene features based on the third gene expression features corresponding to the elements with a value of 0 in the second category of elements and the third gene identifier features corresponding to the elements with a value of 0 in the second category of elements.

[0088] For explanations of the expression level characteristics and marker characteristics of the first / second genes, please refer to the previous descriptions of gene expression level characteristics and gene marker characteristics, which will not be repeated here.

[0089] The second gene feature can be determined by adding the second gene expression level feature and the second gene identifier feature element-wise. The first gene feature and the zero-value gene feature can also be determined in this way.

[0090] The first gene expression feature can be different from any second gene expression feature. For example, the second gene expression features corresponding to gene expression levels 1-10 are gene expression features 1-10, and the first gene expression feature can be gene expression feature 11. The third gene expression feature corresponding to the element with a value of 0 in the second category can correspond to gene expression feature 0. In an optional embodiment, the encoder includes M layers of encoding units, and the decoder includes N layers of decoding units, where the value of M is greater than the value of N.

[0091] Specifically, the encoder consists of M layers of encoding units, and the decoder consists of N layers of decoding units, where the value of M is greater than the value of N. Preferably, M+N=8, so when M=5, N=3; and when M=6, N=2. Since M is greater than N, the gene regulation relationship model to be trained adopts an asymmetric encoder-decoder architecture. The encoder's input is only the input features, which greatly saves computational overhead. The decoder is used for reconstruction and can be more lightweight than the encoder. The encoder and decoder can adopt the structures found in existing transformer models.

[0092] As can be seen, the encoder only sees the elements with non-zero values ​​in the second category. Therefore, the gene regulation relationship model in this application embodiment can have a smaller scale and can accept a larger scale of input. During training, the expression level of the whole genome of the cell can be used as input, so that the gene regulation relationship model to be trained can learn the regulation relationship of the whole genome.

[0093] In one alternative embodiment, each layer of the encoder includes a multi-head attention unit and a forward propagation unit; each layer of the decoder includes a forward propagation unit, and further includes a linear attention unit or a sparse attention unit.

[0094] Specifically, each coding unit includes multiple units, such as multi-head attention units and feed forward units.

[0095] Each layer of decoding unit includes multiple units, such as a feed forward unit and a linear attention unit. The linear attention unit can also be replaced with a sparse attention unit.

[0096] Here, the input features serve as the encoder's input. The sum of the Input Embedding and Positional Embedding is fed into the encoder's multi-head attention unit. The encoder then sequentially performs residual connections and layer normalization, forward propagation, and another residual connection and layer normalization to obtain the initial encoded feature tensor. In the decoder, the multi-head attention unit can be replaced with a linear attention unit or a sparse attention unit. It is evident that the decoder uses lightweight units with lower parameter count and computational complexity than the encoder. Compared to the multi-head attention unit, linear or sparse attention units can further reduce the algorithm's time and space complexity, allowing the model's parameter count to increase to the hundreds of millions.

[0097] Step S105: Update the model parameters in the gene regulation relationship model to be trained based on the initial gene expression matrix and the predicted gene expression matrix to generate the trained gene regulation relationship model.

[0098] In this step, the model parameters refer to the parameters of the gene regulation relationship model to be trained. The model parameters determine the accuracy of the output results of the gene regulation relationship model to be trained.

[0099] A gene regulation model can refer to an optimized gene regulation model to be trained. The gene regulation model is used to determine the gene regulation relationship representation of each gene in the target cell.

[0100] For example, model parameters may include encoder parameters and decoder parameters, and may also include parameters for the network used to transform gene regulatory relationships into a matrix of predicted gene expression levels.

[0101] In one optional embodiment, updating the model parameters in the gene regulation relationship model to be trained based on the initial gene expression matrix and the predicted gene expression matrix includes: calculating the difference between the value of each element in the predicted gene expression matrix and the value of the corresponding element in the initial gene expression matrix; determining the loss value based on the difference; if the training termination condition is not met, adjusting the values ​​of the model parameters based on the loss value, and returning to the step of randomly selecting multiple elements in the initial gene expression matrix as the first type of elements.

[0102] Specifically, the difference between the predicted gene expression matrix and the initial gene expression matrix is ​​calculated. This involves subtracting the value of each element in the predicted gene expression matrix from the corresponding value in the initial gene expression matrix. The loss value is determined based on this difference (e.g., directly using the difference as the loss value, or inputting the difference into another function to determine the loss value). If the training termination condition is not met (e.g., the loss value is less than a loss threshold or the number of iterations reaches a threshold), the model parameters are adjusted based on the loss value. This process is repeated until the training termination condition is met. At this point, the model parameters are considered satisfactory, and these parameters are taken as the values ​​of the trained gene regulation relationship model.

[0103] In one optional embodiment, the element values ​​of non-zero elements in the second type of elements are used to generate a second gene expression feature, including: inputting the element values ​​of non-zero elements in the second type of elements into a gene expression feature extraction model to generate a second gene expression feature.

[0104] As mentioned earlier, a mapping relationship between gene expression levels and gene expression features can be pre-set, and gene expression features can be determined based on gene expression levels. However, this pre-setting is not flexible enough and will limit the model's ability to learn the mapping. For example, the model may not be able to distinguish between gene expression levels of 1.1 and 1.9, because after rounding / classification, they both correspond to a gene expression level of 1.

[0105] Therefore, a gene expression level feature extraction model can be set up. The element values ​​of non-zero elements in the second category are input into the gene expression level feature extraction model to generate second gene expression level features. This model can be updated together with the gene regulation relationship model to be trained. That is, before the training termination condition is reached, the model parameters of the gene regulation relationship model and the gene expression level feature extraction model are adjusted according to the difference of the loss value determined by the difference between the value of each element in the predicted gene expression level matrix and the value of the corresponding element in the initial gene expression level matrix. In this way, the model can learn that gene expression levels 1.1 and 1.2 are more similar expression levels, and gene expression levels 1.1 and 1.9 are more different expression levels, so that gene features can better characterize different gene expression levels and the relationships between different genes.

[0106] Compared with existing gene regulation relationship model generation methods, this application can remove the first type of elements and elements with a value of 0 from the initial gene expression matrix, which includes the expression levels of both hypervariable and non-hypervariable genes. It only uses the input features corresponding to the non-zero elements in the second type of elements as input to the gene regulation relationship model to be trained. This eliminates the need for computation on large amounts of data, reducing computational complexity and workload, improving training efficiency, and enabling the model to learn potential gene regulation relationships at the whole genome level. This solves the problems of high training difficulty for regulation relationship models and the systematic lack of systematic gaps in the regulatory relationship maps learned by the models.

[0107] Based on the same inventive concept, this application also provides a gene regulation relationship model generation device corresponding to the gene regulation relationship model generation method. Since the principle of the device in this application is similar to the gene regulation relationship model generation method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0108] Please see Figure 2 , Figure 2 This is a schematic diagram of a gene regulation relationship model generation device provided in an embodiment of this application. Figure 2 As shown, the gene regulation relationship model generation device 200 includes:

[0109] The first matrix generation module 201 is used to obtain the initial gene expression matrix corresponding to the target cell. The initial gene expression matrix includes the expression levels of hypervariable genes and non-hypervariable genes in the cell.

[0110] The element selection module 202 is used to randomly select multiple elements in the initial gene expression matrix as first-class elements, and to use the elements in the gene expression matrix other than the first-class elements as second-class elements.

[0111] The input feature determination module 203 is used to determine the input features based on the position of the elements in the initial gene expression matrix;

[0112] The second matrix generation module 204 is used to input the input features into the gene regulation relationship model to be trained to obtain the gene regulation relationship representation, transform the gene regulation relationship representation to generate a predicted gene expression matrix, and the elements in the predicted gene expression matrix correspond to the elements in the initial gene expression matrix.

[0113] The model generation module 205 is used to update the model parameters in the gene regulation relationship model to be trained based on the initial gene expression matrix and the predicted gene expression matrix, and generate the trained gene regulation relationship model.

[0114] Please see Figure 3 , Figure 3 This is a flowchart illustrating a method for determining gene regulatory relationships provided in an embodiment of this application. Figure 3 As shown in the embodiments of this application, the method for determining gene regulatory relationships includes:

[0115] Step S301: Obtain the gene expression matrix corresponding to the cells to be treated.

[0116] Gene expression matrices can be obtained, for example, through single-cell sequencing. When the cell to be treated is a single cell, the gene expression matrix can be a vector; when the cell to be treated is multiple cells, the gene expression matrix can be a matrix, where each row or column corresponds to the gene expression level of one cell.

[0117] Step S302: Input the gene expression matrix into the gene regulation relationship model to obtain the gene regulation relationship representation.

[0118] In this step, the obtained gene expression matrix is ​​input into the trained gene regulation model, and the gene regulation model outputs the gene regulation relationship representation of the cells to be treated.

[0119] In this model, gene regulation relationships are represented as a three-dimensional tensor (e.g., a C×G×D tensor). The gene regulation relationship corresponding to each cell to be treated is characterized by the matrix corresponding to that cell within this three-dimensional tensor. It is understood that when C is 1, the gene regulation relationship model is generated according to the gene regulation relationship model generation method. It is also understood that when C is 1, the C×G×D three-dimensional tensor becomes 1×G×D. It is also understood that the genes expressed by the cells to be treated are a subset of the genes contained in the initial gene expression matrix used during the training of the gene regulation relationship model. If the genes expressed by the cells to be treated are not included in the initial gene expression matrix, it indicates that the gene regulation relationship between their genes has not been learned by the gene regulation relationship model, and therefore, the corresponding gene regulation relationship cannot be predicted by the gene regulation relationship model.

[0120] Please see Figure 4 , Figure 4 This is a flowchart illustrating a cell classification method provided in an embodiment of this application. Figure 4 As shown, the cell classification method provided in this application includes:

[0121] Step S401: Based on the gene regulation relationship representation, determine the target regulation relationship representation corresponding to each cell to be treated.

[0122] For example, for each cell to be treated, a preset number of elements with the largest value or greater than a threshold value can be selected from the matrix corresponding to the cell in the three-dimensional tensor representing the gene regulation relationship as the target regulation relationship representation of the cell to be treated. Alternatively, these elements can be used as the target regulation relationship representation of the cell to be treated after performing operations such as averaging.

[0123] The target regulatory relationship corresponding one-to-one with the cells to be treated is represented as the input Dinput to the downstream task model to obtain the downstream task results.

[0124] Step S402: Input the target regulatory relationship representation corresponding to each cell to be treated into the cell classification model to obtain the classification results of each cell to be treated.

[0125] In this step, the downstream task model is a cell classification model. The target regulatory relationship representation corresponding to the objection of the cell to be processed is input into the cell classification model, and the downstream task results output by the cell classification model can be obtained, that is, the classification results of each cell to be processed.

[0126] Here, the gene regulatory relationship representation is determined according to the gene regulatory relationship determination method. Since this application uses the target regulatory relationship representation as input to the cell classification model, it can determine the cell classification of the cells to be treated based on factors such as gene expression levels and whether genes are co-expressed. Compared with using only gene expression levels as input to the cell classification model, using Dinput as input can greatly improve the classification accuracy.

[0127] Please see Figure 5 , Figure 5 This is a flowchart illustrating a method for predicting perturbation expression levels provided in an embodiment of this application. Figure 5 As shown, the perturbation expression level prediction method provided in this application includes:

[0128] Step S501: Determine the perturbation information for the genes or proteins of the cell to be treated.

[0129] Step S502: Input the gene regulatory relationship representation and perturbation information into the perturbation expression level prediction model to obtain the perturbation expression level prediction results.

[0130] Perturbation can refer to the knockout, increase or decrease of gene expression, or the stimulation and inhibition of proteins.

[0131] Here, the gene regulatory relationship representation is determined according to the gene regulatory relationship determination method. Since this application uses the gene regulatory relationship representation and perturbation information as Dinput, and inputs Dinput into the perturbation expression level prediction model, compared with using gene expression levels and perturbation information in cells as input to the cell classification model, using Dinput as the model input can greatly improve the perturbation prediction accuracy.

[0132] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device 600 includes a processor 610, a memory 620, and a bus 630.

[0133] The memory 620 stores machine-readable instructions executable by the processor 610. When the electronic device 600 is running, the processor 610 and the memory 620 communicate via the bus 630. When the machine-readable instructions are executed by the processor 610, they can perform the operations described above. Figure 1 The gene regulation relationship model generation method in the illustrated method embodiment, and / or, can be performed as described above. Figure 4 The cell classification method in the illustrated embodiments, and / or, can be performed as described above. Figure 5 The steps of the perturbation expression prediction method in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0134] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The gene regulation relationship model generation method in the illustrated method embodiment, and / or, can be performed as described above. Figure 4 The cell classification method in the illustrated embodiments, and / or, can be performed as described above. Figure 5 The steps of the perturbation expression prediction method in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0135] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0136] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0138] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0139] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0140] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for generating a gene regulation relationship model, characterized in that, include: Obtain the initial gene expression matrix corresponding to the target cell, wherein the initial gene expression matrix includes the expression levels of hypervariable genes and non-hypervariable genes in the cell; Randomly select multiple elements from the initial gene expression matrix as first-class elements, and use the elements in the gene expression matrix other than the first-class elements as second-class elements; The input features are determined based on the position of the element in the initial gene expression matrix. The input features include the second gene features corresponding to the elements in the second category that have a non-zero value. The input features do not include the first gene features corresponding to the first category of elements and the zero-value gene features corresponding to the elements in the second category that have a zero value. The second gene features are determined based on the gene expression level and the gene identifier corresponding to the gene. The input features are input into the gene regulation relationship model to be trained to obtain the gene regulation relationship representation. The gene regulation relationship representation is transformed to generate a predicted gene expression matrix. The elements in the predicted gene expression matrix correspond to the elements in the initial gene expression matrix. The model parameters in the gene regulation relationship model to be trained are updated based on the initial gene expression matrix and the predicted gene expression matrix to generate the trained gene regulation relationship model.

2. The method according to claim 1, characterized in that, The process of obtaining the initial gene expression matrix corresponding to the target cells includes: The cell identifier of the target cell and the gene identifier of each gene in the target cell are used as the first and second dimensions of the matrix, respectively. The gene expression level of each gene is used as the value of the corresponding element in the matrix to construct an initial gene expression matrix. The gene expression level of each gene is obtained through gene sequencing.

3. The method according to claim 1, characterized in that, The gene regulation relationship model to be trained includes an encoder and a decoder; The step of inputting the input features into the gene regulation relationship model to be trained to obtain the gene regulation relationship representation includes: The input features are input into the encoder to obtain the initial encoded feature tensor; According to the position of the element in the initial gene expression matrix, the first gene feature corresponding to the first type of element, the zero-value gene feature corresponding to the element with a value of 0 in the second type of element are merged with the initial coding feature tensor to obtain the target coding feature tensor. The target encoded feature tensor is input into the decoder to obtain the gene regulatory relationship representation.

4. The method according to any one of claims 1-3, characterized in that, The step of determining input features based on the position of elements in the initial gene expression matrix includes: The second gene expression level feature is generated based on the element values ​​of the non-zero elements in the second type of elements; A second gene identifier feature is generated based on the gene identifiers corresponding to the elements in the second category that have non-zero values; The second gene feature is determined based on the second gene expression level feature and the second gene identification feature; The method further includes: The first gene feature is determined based on the first gene expression level feature corresponding to the first type of element and the first gene identification feature corresponding to the first type of element; wherein, the first gene expression level feature corresponding to all first type of elements is the same, and the first gene expression level feature is different from the second gene expression level feature; The zero-value gene feature is determined based on the expression level feature of the third gene corresponding to the element with a value of 0 in the second category of elements and the identification feature of the third gene corresponding to the element with a value of 0 in the second category of elements.

5. The method according to any one of claims 1-4, characterized in that, The gene regulation relationship model to be trained includes an encoder and a decoder. The encoder includes M layers of coding units, and the decoder includes N layers of decoding units, where the value of M is greater than the value of N.

6. The method according to claim 5, characterized in that, Each layer of the encoder includes a multi-head attention unit and a forward propagation unit; Each decoding unit of the decoder includes a forward propagation unit and a linear attention unit or a sparse attention unit.

7. The method according to any one of claims 1-6, characterized in that, The step of updating the model parameters in the gene regulatory relationship model to be trained based on the initial gene expression matrix and the predicted gene expression matrix includes: Calculate the difference between the value of each element in the predicted gene expression matrix and the value of the corresponding element in the initial gene expression matrix; The loss value is determined based on the difference between the stated values; If the training termination condition is not met, the model parameters are adjusted according to the loss value, and the process returns to the step of randomly selecting multiple elements from the initial gene expression matrix as the first type of elements.

8. The method according to claim 4, characterized in that, The step of generating a second gene expression level feature based on the element values ​​of non-zero elements in the second type of elements includes: Input the element values ​​of the non-zero elements in the second type of elements into the gene expression level feature extraction model to generate the second gene expression level feature; The method further includes: The parameters of the gene expression level feature extraction model are adjusted based on the loss value, which is determined by the difference between the value of each element in the predicted gene expression level matrix and the value of the element at the corresponding position in the initial gene expression level matrix.

9. A gene regulation relationship model generation device, characterized in that, include: The first matrix generation module is used to obtain the initial gene expression level matrix corresponding to the target cell. The initial gene expression level matrix includes the expression levels of hypervariable genes and non-hypervariable genes in the cell. The element selection module is used to randomly select multiple elements in the initial gene expression matrix as first-class elements, and to select elements in the gene expression matrix other than the first-class elements as second-class elements. The input feature determination module is used to determine the input features based on the position of the element in the initial gene expression matrix. The input features include the second gene features corresponding to the elements with non-zero values ​​in the second category of elements. The input features do not include the first gene features corresponding to the first category of elements and the zero-value gene features corresponding to the elements with zero values ​​in the second category of elements. The second gene features are determined based on the gene expression level and the gene identifier corresponding to the gene. The second matrix generation module is used to input the input features into the gene regulation relationship model to be trained to obtain the gene regulation relationship representation, and to transform the gene regulation relationship representation to generate a predicted gene expression matrix, wherein the elements in the predicted gene expression matrix correspond to the elements in the initial gene expression matrix. The model generation module is used to update the model parameters in the gene regulation relationship model to be trained based on the initial gene expression matrix and the predicted gene expression matrix, and generate the trained gene regulation relationship model.

10. A method for determining gene regulatory relationships, characterized in that, include: Obtain the gene expression level matrix corresponding to the cells to be treated; wherein the genes expressed by the cells to be treated are a subset of the genes contained in the initial gene expression level matrix; The gene expression matrix is ​​input into the gene regulation model to obtain the gene regulation relationship representation, which is represented as a three-dimensional tensor. The gene regulation relationship model is generated by the gene regulation relationship model generation method according to any one of claims 1-8.

11. A cell classification method, characterized in that, include: Based on the gene regulation relationship representation, determine the target regulation relationship representation for each cell to be treated; The target regulatory relationship representation corresponding to each cell to be treated is input into the cell classification model to obtain the classification results of each cell to be treated; The gene regulatory relationship is represented by the gene regulatory relationship determination method according to claim 10.

12. A method for predicting perturbation expression levels, characterized in that, include: Determine the perturbation information targeting the genes or proteins of the cell to be treated; The gene regulation relationship representation and the perturbation information are input into the perturbation expression level prediction model to obtain the perturbation expression level prediction results; The gene regulatory relationship is represented by the gene regulatory relationship determination method according to claim 10.

13. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the gene regulation relationship model generation method as described in any one of claims 1 to 8, and / or the cell classification method as described in claim 11, and / or the perturbation expression level prediction method as described in claim 12.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the gene regulation relationship model generation method as described in any one of claims 1 to 8, and / or the cell classification method as described in claim 11, and / or the perturbation expression level prediction method as described in claim 12.