Gene expression matrix optimization method, electronic device, and storage medium
By analyzing and processing the gene expression data of multiple cells, the gene expression similarity and spatial relationship between cells are determined, and the gene expression matrix of target cells is smoothly processed, which solves the problems of gene expression matrix sparsity and noise, and improves the accuracy of subsequent analysis.
Patent Information
- Application Number
- PCT/CN2023/124611
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-04-17
AI Technical Summary
When obtaining the cell gene expression matrix, the prior art does not consider the gene diffusion problem between cells, resulting in the gene expression matrix being highly sparse and contains a lot of noise, affecting the accuracy of subsequent feature extraction and biological information mining.
By obtaining cell data of multiple cells, determining the nearest neighbor cells of the target cell, calculating the gene expression distance, smoothing the initial gene expression matrix of the target cell based on the distance parameters and weight parameters, and generating the optimized gene expression matrix.
It effectively solves the problem of high sparsity of the gene expression matrix, reduces noise, enhances the characteristics and spatial autocorrelation of cell data, and improves the accuracy of subsequent feature extraction and biological information mining.
Smart Images

Figure CN2023124611_17042025_PF_FP_ABST
Abstract
Description
Gene expression matrix optimization method, electronic device and storage medium Technical Field
[0001] The present application relates to the field of biomedicine technology, and in particular to a gene expression matrix optimization method, electronic device, and storage medium. Background Art
[0002] When studying how genes respond to external factors in different cellular states, or how genes interact with each other, it is necessary to obtain a cellular gene expression matrix. However, due to technical limitations, such as not considering intercellular gene diffusion and only considering gene expression information within the cell nucleus, the resulting gene expression matrix is highly sparse and contains a lot of noise, which in turn affects the accuracy of downstream feature extraction and bioinformatics mining based on the gene expression matrix.
[0003] Summary of the Invention
[0004] In view of the above, it is necessary to propose a gene expression matrix optimization method, electronic device and storage medium, which can solve the problem that the obtained gene expression matrix is highly sparse and contains a lot of noise.
[0005] An embodiment of the present application provides a gene expression matrix optimization method, the method comprising: obtaining cell data of a plurality of cells, the cell data comprising an initial gene expression matrix of each of the plurality of cells; determining a preset number of nearest neighbor cells of a target cell among the plurality of cells based on the cell data; determining a gene expression distance between the target cell and each nearest neighbor cell, determining a distance parameter based on a target non-zero value in the gene expression distance, and determining a weight parameter corresponding to each nearest neighbor cell based on the distance parameter; and obtaining a target gene expression matrix after smoothing the initial gene expression matrix of the target cell based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell.
[0006] In one embodiment, before determining a preset number of nearest neighbor cells of the target cell among the multiple cells based on the cell data, the method further includes preprocessing the cell data, including: normalizing the cell data and performing dimensionality reduction on the normalized cell data.
[0007] In one embodiment, the cell data also includes the spatial position coordinates of each cell in the multiple cells, and determining a preset number of nearest neighbor cells of the target cell based on the cell data includes: determining other cells in the multiple cells except the target cell based on the spatial position coordinates of each cell, and determining the spatial position distance between each cell in the other cells and the target cell; sorting the spatial position distances in ascending order, and selecting cells corresponding to the preset number of spatial position distances that are ranked first in the sorted sequence as the nearest neighbor cells of the target cell.
[0008] In one embodiment, determining the gene expression distance between the target cell and each nearest neighbor cell includes: calculating the Euclidean distance between the initial gene expression matrix of the target cell and the initial gene expression matrix of each nearest neighbor cell, and using the Euclidean distance as the gene expression distance.
[0009] In one embodiment, the method for determining the target non-zero value includes: constructing a non-negative distance matrix based on the non-zero values in the gene expression distance, wherein the non-negative distance matrix is a one-dimensional matrix, and the value of the preceding element in the one-dimensional matrix is less than or equal to the value of the following element; extracting the percentage quantile of the percentage position in the non-negative distance matrix based on a preset percentage, and using the percentage quantile as the target non-zero value.
[0010] In one embodiment, the formula used to determine the distance parameter based on the target non-zero value in the gene expression distance includes:
[0011] Among them, c represents the distance parameter, DDT represents the target non-zero value, gs represents the preset average value of the weight formula for smoothing processing, and a and b represent preset hyperparameters.
[0012] In one embodiment, the formula used to determine the weight parameter corresponding to each nearest neighbor cell based on the distance parameter includes:
[0013] Among them, w i Represents the weight parameter corresponding to the nearest neighbor cell i, R(x,i) represents the spatial distance between the target cell x and the nearest neighbor cell i, i∈N x (k), N x (k) represents a set of k nearest neighbor cells of the target cell x, c represents the distance parameter, and a and b represent preset hyperparameters.
[0014] In one embodiment, the formula used to obtain the target gene expression matrix after smoothing the initial gene expression matrix of the target cell based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell includes:
[0015] Among them, exp′ x represents the target gene expression matrix of target cell x, w i Represents the weight parameter corresponding to the nearest neighbor cell i, N x (k) represents the set of k nearest neighbor cells of the target cell x, exp i represents the initial gene expression matrix of the nearest neighbor cell i.
[0016] An embodiment of the present application provides a gene expression matrix optimization device, which includes: an acquisition module for acquiring cell data of multiple cells, the cell data including an initial gene expression matrix of each of the multiple cells; a preprocessing module for determining a preset number of nearest neighbor cells of a target cell among the multiple cells based on the cell data; a determination module for determining a gene expression distance between the target cell and each nearest neighbor cell, determining a distance parameter based on a target non-zero value in the gene expression distance, and determining a weight parameter corresponding to each nearest neighbor cell based on the distance parameter; and an optimization module for obtaining a target gene expression matrix after smoothing the initial gene expression matrix of the target cell based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell.
[0017] An embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the processor is configured to implement the gene expression matrix optimization method when executing a computer program stored in the memory.
[0018] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the gene expression matrix optimization method is implemented.
[0019] In summary, the gene expression matrix optimization method described in the present application can determine the distance parameter based on the similarity of gene expression between cells and the spatial distance information between cells, use the distance parameter to determine the weight parameter of the nearest neighbor cell of the target cell, and use the weight parameter to smooth the initial gene expression matrix of the target cell. This can solve the high sparsity problem of the gene expression matrix, reduce the noise in the gene expression matrix and enhance the features of the gene data, enhance the spatial autocorrelation of the tissue where the cell corresponding to the smoothed cell data is located and the intra-class similarity of different cells in the tissue, thereby improving the accuracy of downstream feature extraction and biological information mining of cells based on the gene expression matrix. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] FIG1 is a structural diagram of an electronic device provided in one embodiment of the present application.
[0021] FIG2 is a flow chart of a gene expression matrix optimization method provided in one embodiment of the present application.
[0022] FIG3 is a flow chart of a method for determining the nearest neighbor cells of a target cell provided in one embodiment of the present application.
[0023] FIG4 is a comparative example diagram of gene expression of a target gene before and after smoothing processing provided in an embodiment of the present application.
[0024] FIG5 is a comparative example diagram of the results of cell annotation based on gene expression matrices obtained by two smoothing methods provided in an embodiment of the present application.
[0025] FIG6 is a comparative example diagram of the results of cell annotation based on gene expression matrices obtained by two smoothing methods provided in another embodiment of the present application.
[0026] FIG7 is a comparative example diagram of the results of cell annotation based on gene expression matrices obtained by two smoothing methods provided in another embodiment of the present application.
[0027] FIG8 is a comparative example diagram of the results of cell annotation based on gene expression matrices obtained by two smoothing methods provided in yet another embodiment of the present application.
[0028] FIG9 is a structural diagram of a gene expression matrix optimization device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to more clearly understand the above-mentioned objectives, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features therein can be combined with each other in the absence of conflict.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are for the purpose of describing embodiments in one embodiment only and are not intended to limit this application.
[0031] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0032] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner. The following embodiments and features in the embodiments may be combined with each other unless there is a conflict.
[0033] In one embodiment, when studying the response of genes to external factors in different cell states, or the regularity of the interaction between genes, it is necessary to obtain a cell gene expression matrix. Due to the limitations of related technologies (e.g., Stereo-seq spatial transcriptome sequencing technology, etc.), for example, without considering the problem of gene diffusion between cells, only considering the gene expression information within the range of the cell nucleus, the gene expression matrix obtained will be highly sparse and contain a lot of noise, thereby affecting the accuracy of downstream feature extraction and biological information mining of cells according to the gene expression matrix.
[0034] Methods used in related technologies to optimize gene expression matrices, such as Gaussian smoothing models, usually require manual setting of model parameters based on prior knowledge. Due to the lack of prior knowledge or errors caused by manual setting, the effect of using the model to optimize the gene expression matrix after the set parameters are applied to the model is not good.
[0035] To solve the above problems, an embodiment of the present application provides a gene expression matrix optimization method, which first obtains cell data including an initial gene expression matrix of multiple cells, then determines a preset number of nearest neighbor cells of a target cell and the gene expression distance between the target cell and each nearest neighbor cell based on the cell data, then determines a distance parameter based on a target non-zero value in the gene expression distance and determines a weight parameter corresponding to each nearest neighbor cell based on the distance parameter, and finally uses the weight parameter corresponding to each nearest neighbor cell to smooth the initial gene expression matrix of the target cell to obtain a target gene expression matrix of the target cell.
[0036] Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 10 can be a computer, server, mobile phone, tablet computer, laptop computer, cloud server, cloud computer, etc. The embodiment of the present application does not impose any restrictions on the specific type of electronic device.
[0037] As shown in Figure 1, the electronic device 10 may include a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104, and a bus 105. The processor 103 is coupled to the communication interface 101, the memory 102, and the I / O interface 104 via the bus 105.
[0038] The communication module 101 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as universal serial bus (USB) and controller area network bus (CAN). The wireless communication module may provide one or more wireless communication solutions such as wireless fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0039] The memory 102 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The RAM can be directly read and written by the processor 103 and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. The RAM may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.
[0040] The non-volatile memory can also store executable programs and user and application data, etc., and can be pre-loaded into the random access memory for direct reading and writing by the processor 110. The non-volatile memory can include disk storage devices and flash memory.
[0041] The memory 102 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 103. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 103, the gene expression matrix optimization method executed on the electronic device 10 can be implemented.
[0042] In other embodiments, the electronic device 10 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device 10 .
[0043] The processor 103 may include one or more processing units. For example, the processor 103 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0044] The processor 103 provides computing and control capabilities. For example, the processor 103 is configured to execute a computer program stored in the memory 102 to implement the above-mentioned gene expression matrix optimization method.
[0045] The I / O interface 104 is used to provide a channel for user input or output. For example, the I / O interface 104 can be used to connect various input and output devices, such as a mouse, keyboard, touch device, display screen, etc., so that the user can enter information or visualize information.
[0046] The bus 105 is at least used to provide a channel for mutual communication among the communication module 101 , the memory 102 , the processor 103 , and the I / O interface 104 in the electronic device 10 .
[0047] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0048] FIG2 is a flow chart of a gene expression matrix optimization method according to an embodiment of the present application. The gene expression matrix optimization method is applied to an electronic device, such as electronic device 10 in FIG1 , and specifically includes the following steps. The order of the steps in the flow chart may be changed, and some steps may be omitted, depending on different requirements.
[0049] S21, acquiring cell data of a plurality of cells.
[0050] In one embodiment, the plurality of cells may be cells belonging to the same biological tissue or organ, for example, the plurality of cells may be cells in a mouse brain slice. The cell data includes, but is not limited to, an initial gene expression matrix for each of the plurality of cells and spatial position coordinates of each of the plurality of cells.
[0051] In one embodiment, the cell data of the plurality of cells may be obtained using spatial transcriptomics sequencing technology. For example, the spatial transcriptomics sequencing technology may be Stereo-seq (Spatial Transcriptomics through Ribonucleic Acid sequencing) technology. Specifically, the Stereo-seq technology can obtain the cell data of the multiple cells through the following process: (1) performing image segmentation on a single-stranded deoxyribonucleic acid (ssDNA) image of a slice of a biological tissue sample containing multiple cells, determining the region where each cell is located in the ssDNA image, and taking the coordinates of the center point of the region where each cell is located in the slice coordinate system as the spatial position coordinates of the corresponding cell; (2) within each cell region, determining the nuclear range where the cell nucleus is located in each cell by identifying DNA chromosomes or performing nuclear labeling; (3) aligning the nuclear range of each cell to the DNB (Digital Nucleic Acid Barcoding) expression spectrum to obtain the mRNA (messenger Ribonucleic Acid) transcript information associated with each cell; (4) based on the alignment information of the nuclear range of each cell to the DNB expression spectrum, segmenting the DNB expression spectrum to obtain the gene expression information of each cell, and obtaining the initial gene expression matrix of each cell based on the gene expression information, wherein each element of the initial gene expression matrix can represent the gene expression amount of a gene.
[0052] Due to the limitations of spatial transcriptome sequencing technology, such as low gene capture rates, failure to account for intercellular gene diffusion, and exclusive consideration of gene expression information within the nucleus, single-cell gene expression profiles obtained with spatial transcriptome sequencing are often highly sparse and contain a certain amount of noise. To improve the signal-to-noise ratio of expression profiles, the initial gene expression matrix needs to be processed.
[0053] S22, determining a preset number of nearest neighbor cells of the target cell among the multiple cells according to the cell data.
[0054] In one embodiment, before determining a preset number of nearest neighbor cells of the target cell among the multiple cells based on the cell data, the method further includes preprocessing the cell data, including: normalizing the cell data and using principal component analysis to reduce the dimension of the normalized cell data.
[0055] In one embodiment, when the cell data are normalized, the initial gene expression matrix of each cell can be normalized using data processing tools such as scanpy. Specifically, scanpy can be used to load the initial gene expression matrix, and functions or methods such as scanpy.pp.normalize_per_cell() are used to normalize the initial gene expression matrix, so that the scales of the different initial gene expression matrices of different cells are consistent with comparability. In other embodiments, the initial gene expression matrix can also be processed using a logarithmic transformation method, so as to compress the value range of each element in each initial gene expression matrix and reduce the skewness between the gene expression data.
[0056] In one embodiment, principal component analysis (PCA) can be used to reduce the dimensionality of the normalized cell data. Specifically, the following process can be included: feature extraction is performed on the normalized initial gene expression matrix, principal component analysis is performed on the feature set obtained by feature extraction, multi-dimensional (for example, 50 dimensions to 200 dimensions) principal component information of the entire gene expression matrix is obtained, and the principal component information of the gene expression spectrum is retained, thereby achieving dimensionality reduction of the normalized gene expression matrix.
[0057] By performing dimensionality reduction on the normalized cell data, the cell data can be mapped to a lower-dimensional space to reduce data redundancy and improve the computational efficiency of subsequent steps. In addition, using principal component analysis to reduce the dimensionality of the normalized initial gene expression matrix can also better extract the most representative gene features in the initial gene expression matrix to achieve feature enhancement.
[0058] In one embodiment, preprocessing the cell data further includes performing the normalization process and the PCA dimensionality reduction process on the spatial position coordinates of each cell. Furthermore, when the multiple cells do not belong to the same slice, preprocessing the cell data further includes registering the three-dimensional spatial position coordinates of each cell so that the spatial position coordinates of the multiple cells are in the same coordinate system.
[0059] In one embodiment, as shown in FIG3 , the method for determining the nearest neighbor cell of a target cell includes the following steps:
[0060] Step S31 , based on the spatial position coordinates of each cell, determining other cells in the plurality of cells except the target cell, and determining the spatial position distance between each of the other cells and the target cell.
[0061] In one embodiment, when determining the spatial position distance between each cell in the other cells and the target cell, the Euclidean distance, Manhattan distance, Chebyshev distance, etc. between the spatial position coordinates of each cell in the other cells and the spatial position coordinates of the target cell can be calculated in the PCA space as the spatial position distance.
[0062] Step S32 , sorting the spatial position distances in ascending order, and selecting cells corresponding to the preset number of spatial position distances that are ranked first in the sorted sequence as the nearest neighbor cells of the target cell.
[0063] In one embodiment, the smaller the spatial distance between a cell in the other cells and the target cell, the closer the cell is to the target cell. Therefore, the cells corresponding to a preset number of spatial distances that are ranked first in the above sequence can be selected as the nearest neighbor cells of the target cell. The preset number can be set according to actual needs, for example, the preset number can be proportional to the total number of the multiple cells.
[0064] In another embodiment, in addition to the above-mentioned method of determining the nearest neighbor cells of the target cell using the proximity relationship of the spatial position between cells, the nearest neighbor cells of the target cell can also be determined using the similarity of gene expression between cells. For example, the first distance (e.g., Euclidean distance, Manhattan distance, etc.) between the initial gene expression matrix of each cell in the other cells and the initial gene expression matrix of the target cell can be calculated; and a preset number of cells with the smallest first distance are selected from the other cells as the neighbor cells of the target cell. The smaller the first distance between a cell in the other cells and the target cell, the higher the similarity of gene expression between the cell and the target cell.
[0065] In another embodiment, the nearest neighbor cells can be determined by combining the spatial proximity relationship between cells and the similarity of gene expression between cells. For example, a first weight corresponding to the spatial distance and a corresponding second weight can be set, where the first weight = 1 - the second weight; the second distance between each of the other cells and the target cell is set to = the spatial distance between each of the other cells and the target cell × the first weight - the first distance between each of the other cells and the target cell × the second weight; and a preset number of cells with the smallest second distances are selected from the other cells as the neighbor cells of the target cell.
[0066] In one embodiment, by determining the nearest neighbor cells of the target cell, the cell that has the greatest impact on the gene expression level of the target cell can be determined, so that in subsequent steps, the effect of smoothing the initial gene expression matrix of the target cell can be improved by determining the weight parameters corresponding to the nearest neighbor cells.
[0067] Step S23, determining the gene expression distance between the target cell and each nearest neighbor cell, determining a distance parameter according to a target non-zero value in the gene expression distance, and determining a weight parameter corresponding to each nearest neighbor cell based on the distance parameter.
[0068] In one embodiment, determining the gene expression distance between the target cell and each nearest neighbor cell includes calculating the Euclidean distance between the initial gene expression matrix of the target cell and the initial gene expression matrix of each nearest neighbor cell, and using the Euclidean distance as the gene expression distance. In other embodiments, the gene expression distance may be calculated as the Euclidean distance, Manhattan distance, or other distance between the initial gene expression matrix of the target cell and the initial gene expression matrix of each nearest neighbor cell.
[0069] In one embodiment, the method for determining the target non-zero value includes: constructing a non-negative distance matrix based on the non-zero values in the gene expression distance, wherein the non-negative distance matrix is a one-dimensional matrix, and the value of the preceding element in the one-dimensional matrix is less than or equal to the value of the following element; extracting the percentile of the percentile position in the non-negative distance matrix based on a preset percentage, and using the percentile as the target non-zero value. The preset percentage can be set based on the number of the nearest neighbor cells, for example, the preset percentage can be proportional to the number of the nearest neighbor cells.
[0070] In one embodiment, when constructing the non-negative distance matrix, the non-zero values in the gene expression matrix can be sorted in ascending order to obtain an ascending sequence of non-zero values, and the one-dimensional matrix constructed by the ascending sequence is used as the non-negative distance matrix NCM. nonzero For example, the mth non-zero value in the ascending sequence can be taken as the one-dimensional matrix NCM nonzero The value of the mth element, and the number of non-zero values in the ascending sequence and the non-negative distance matrix NCM nonzero The number of elements in are the same.
[0071] In one embodiment, the percentage quantile of the percentage position in the non-negative distance matrix is extracted based on a preset percentage as the target non-zero value. The formula used can be exemplarily expressed as: (G-1)×p th =n+t, DDT=(1-t)×NCMnonzero [n]+t×NCM nonzero [n+1],
[0072] Where G represents the non-negative distance matrix NCM nonzero The number of elements in p th Represents the preset percentage, n represents the percentage quantile in the non-negative distance matrix NCM nonzero The integer part of the corresponding position in the range of (0, G); t represents the percentage quantile in the non-negative distance matrix NCM nonzero The decimal part of the corresponding position in the range is (0,1); DDT represents the percentage p th The corresponding non-negative distance matrix NCM nonzero The percentage quantile in, that is, the target non-zero value; NCM nonzero [n] represents the non-negative distance matrix NCM nonzero The nth element (i.e., the nth non-zero value) in NCM nonzero [n+1] represents the non-negative distance matrix NCM nonzero From the above formula, we can see that the target non-zero value ranges from the nth non-zero value to the n+1th non-zero value in the ascending sequence of all non-zero values. This can be considered as another screening among the nearest neighboring cells of the target cell, further narrowing the range of cells that have the greatest impact on the gene expression of the target cell.
[0073] In one example, when G=26, p th =25%, (G-1)×p th =6.25, that is, n = 6, t = 0.25; then DDT = (1-0.25) × NCM nonzero [6]+0.25×NCM nonzero [6+1]=0.75×NCM nonzero [6]+0.25×NCM nonzero [7], that is, the target non-zero value = 0.75 × non-negative distance matrix NCM nonzero The sixth element in + 0.25 × non-negative distance matrix NCM nonzero The target non-zero value range is between the 6th and 7th non-zero values in the ascending sequence of all non-zero values.
[0074] In one embodiment, the formula used to determine the distance parameter based on the target non-zero value in the gene expression distance includes:
[0075] Wherein, c represents the distance parameter, DDT represents the target non-zero value, gs represents the preset average value of the weight formula for smoothing, and a and b represent preset hyperparameters. A preset average value gs input by a user may be received.
[0076] In one embodiment, the formula used to determine the weight parameter corresponding to each nearest neighbor cell based on the distance parameter includes:
[0077] Among them, w i represents the weight parameter corresponding to the nearest neighbor cell i, R(x,i) represents the spatial distance between the target cell x and the nearest neighbor cell i (refer to step S31), i∈N x (k), N x (k) represents the set of k nearest neighbor cells of the target cell x, c represents the distance parameter, a and b represent preset hyperparameters, and GS() represents the Gaussian formula. Through the above formula, it is possible to use an adaptive improvement strategy to obtain the weight parameters corresponding to each nearest neighbor cell on the basis of the original Gaussian model, thereby obtaining an adaptive Gaussian smoothing strategy for smoothing the gene expression of the target cell based on the weight parameters corresponding to each nearest neighbor cell, and improving the biological interpretability of the target gene expression matrix obtained in subsequent steps, further improving the accuracy of the results of downstream analysis based on the target gene expression matrix.
[0078] In other embodiments, in addition to using the Gaussian formula GS() of the Gaussian distribution to calculate the weight parameters of the smoothing process, formulas of other distribution models can also be used, including but not limited to the probability density function of the Laplace distribution, the probability density function of the Cauchy distribution, the probability density function of the Rayleigh distribution, and the probability density function of the exponential distribution.
[0079] Step S24 , obtaining a target gene expression matrix after smoothing the initial gene expression matrix of the target cell based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell.
[0080] In one embodiment, the formula used to obtain the target gene expression matrix after smoothing the initial gene expression matrix of the target cell based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell includes:
[0081] Among them, exp′ x represents the target gene expression matrix of the target cell x, and the target gene expression matrix represents the gene expression matrix of the target gene of the target cell x restored after smoothing; w i Represents the weight parameter corresponding to the nearest neighbor cell i, N x (k) represents the set of k nearest neighbor cells of the target cell x, exp i represents the initial gene expression matrix of the nearest neighbor cell i.
[0082] In one embodiment, the above-mentioned smoothing process is based on the initial expression matrix of the nearest neighbor cells of a single cell and the corresponding weight parameters to obtain a smoothed target gene expression matrix of the single cell, thereby realizing the use of the weight parameters corresponding to the nearest neighbor cells to repair the initial gene expression matrix of the target cell, fully considering the influence of the nearest neighbor cells on the gene expression of the target cell, and can effectively reduce the noise generated by the influence of the nearest neighbor cells on each gene in the initial gene expression matrix of the target cell.
[0083] For example, as shown in Figure 4, it is a comparative example diagram of the gene expression of the target gene provided in one embodiment of the present application before and after smoothing. Among them, the original expression of three target genes in three tissue sections of the mouse brain was visualized to obtain three images in the leftmost column; the three images in the middle column are images obtained after adaptive Gaussian smoothing of the original expression in the left image of the same row using the adaptive smoothing strategy of this case; the three images in the rightmost column are the results obtained after in situ hybridization experiments on the target genes in the same row, which can provide a reference for the true expression of the corresponding genes in the mouse brain. Through the comparison between the three columns of images, it can be seen that the gene expression characteristics of the target genes after adaptive Gaussian smoothing have been significantly enhanced, and the noise has been significantly reduced, and its expression pattern is closer to the results of the in situ hybridization experiment.
[0084] In other embodiments, the method for determining the hyperparameters a and b in the above formulas 1 and 2 may include: randomly generating two random numbers as initial hyperparameters; using the initial hyperparameters and the above formula to perform the smoothing process; comparing the gene expression matrix of the target cell after the smoothing process with the initial gene expression matrix of the target cell; when the comparison result indicates that the noise amount in the gene expression matrix of the target cell obtained after the smoothing process is greater than or equal to a preset threshold, updating the initial hyperparameters and repeating the above steps using the updated hyperparameters until the comparison result indicates that the noise amount in the gene expression matrix of the target cell after the smoothing process is less than the preset threshold, and using the hyperparameters used this time as the above hyperparameters a and b. In other embodiments, the percentage and average value gs used in step S23 can also be determined using a method similar to the method for determining the hyperparameters a and b. The selection of the hyperparameters a and b can also be determined with reference to the parameters of the standard Gaussian kernel function.
[0085] In one embodiment, after obtaining the target gene expression matrix after smoothing the initial gene expression matrix of the target cell, the method may further include: performing downstream analysis on the target cell based on the target gene expression matrix. The downstream analysis includes but is not limited to: (11) obtaining multiple target gene expression matrices of target cells under different conditions, and determining the difference in the expression amount of the target gene in the target cell based on the multiple target gene expression matrices; (12) clustering the genes in the target cell based on the difference in the expression amount of each gene in the target gene expression matrix; (13) obtaining multiple target gene expression matrices of target cells of patients at different time points, and determining the pathological changes of the patients based on the multiple target gene expression matrices; (14) analyzing the relationship between genomic variation (such as single nucleotide deletion, etc.) and gene expression based on the target gene expression matrix, thereby determining the influence of genetic factors on gene expression; (15) obtaining multiple target gene expression matrices of different target cells, and determining marker genes based on the target gene expression matrix to achieve annotation of the types of different target cells (hereinafter referred to as cell annotation), wherein the marker genes represent genes expressed by known genes of cells of known types.
[0086] For example, as shown in Figure 5, a comparative example diagram of the results of cell annotation of the gene expression matrix obtained based on two smoothing methods provided in an embodiment of the present application. Among them, the images in the three rectangular boxes are visualization results of cell annotation of cells in the same tissue section of the mouse brain based on three gene expression matrices, wherein different grayscales are used to indicate different cell types, and the right side of each rectangular box should be the name of the cell type corresponding to the different grayscales. Among them, the images in the two smaller rectangular boxes on the left use the gene expression matrix obtained after the original Gaussian model smoothes the initial gene expression matrix. The difference between the two is that the Gaussian parameters of the two original Gaussian models used are different; the image in the larger rectangular box on the right uses the target gene expression matrix obtained by the adaptive smoothing Gaussian model of this case. By comparison, it can be seen that since the adaptive smoothing Gaussian model of this case can achieve better noise and sparsity reduction and gene feature enhancement in the initial gene expression matrix, more cell types can be obtained in the result of cell annotation based on the adaptive smoothing Gaussian model of this case, and the outline of the visualized image of the obtained tissue is clearer and more obvious.
[0087] For example, as shown in Figure 6, a comparative example diagram of the results of cell annotation of the gene expression matrix obtained based on two smoothing methods provided in another embodiment of the present application. The numerical values in Figure 6 are the Calinski Harabase index (Score) of the cell type for cell annotation of the gene expression matrix obtained based on the original Gaussian model and the adaptively smoothed Gaussian model. The Calinski Harabase index is positively correlated with the intra-class similarity of the cell type. It can be seen that the data processed by the adaptively smoothed Gaussian model in this case are more in line with the biological characteristics than the results processed by the original Gaussian model, and the downstream analysis results are more excellent.
[0088] For example, as shown in Figure 7, a comparative example diagram of the results of cell annotation based on the gene expression matrix obtained by two smoothing processing methods provided in another embodiment of the present application. The numerical values in Figure 7 are the Moran's I Index of cell types for cell annotation based on the gene expression matrix obtained by the original Gaussian model and the adaptive smoothed Gaussian model. The Moran's I Index is positively correlated with the spatial autocorrelation of the cell type. It can be seen that the data processed by the adaptive smoothed Gaussian model in this case is more consistent with the biological characteristics than the results processed by the original Gaussian model, and the downstream analysis results are more excellent.
[0089] For example, as shown in Figure 8, a comparative example diagram of the results of cell annotation based on the gene expression matrix obtained by two smoothing processing methods provided in another embodiment of the present application. The values in Figure 8 are the Geary's C Index of cell types for cell annotation based on the gene expression matrix obtained by the original Gaussian model and the adaptive smoothed Gaussian model. The Geary's C Index is negatively correlated with the spatial autocorrelation of the cell type. It can be seen that the data processed by the adaptive smoothed Gaussian model in this case is more consistent with the biological characteristics than the results of the original Gaussian model processing, and the downstream analysis results are more excellent.
[0090] The gene expression matrix optimization method provided in the embodiments of the present application can determine a distance parameter based on the similarity of gene expression between cells and the spatial distance information between cells, use the distance parameter to determine the weight parameter of the nearest neighbor cell of the target cell, and use the weight parameter to smooth the initial gene expression matrix of the target cell. This can solve the high sparsity problem of the gene expression matrix, reduce the noise in the gene expression matrix, enhance the features of the gene data, enhance the spatial autocorrelation of the tissue where the cell corresponding to the smoothed cell data is located and the intra-class similarity of different cells in the tissue, thereby improving the accuracy of downstream feature extraction and biological information mining of cells based on the gene expression matrix.
[0091] FIG9 is a structural diagram of a gene expression matrix optimization device provided in one embodiment of the present application.
[0092] In some embodiments, the gene expression matrix optimization device 40 may include multiple functional modules composed of computer program segments. The computer program of each program segment in the gene expression matrix optimization device 40 may be stored in the memory of an electronic device and executed by at least one processor to perform the gene expression matrix optimization function (see FIG. 2 for details).
[0093] In this embodiment, the gene expression matrix optimization device 40 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an acquisition module 401, a preprocessing module 402, a determination module 403, and an optimization module 404. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can perform fixed functions, which are stored in a memory. In this embodiment, the functional implementation of each module in the gene expression matrix optimization device 40 can be found in the above definition of the gene expression matrix optimization method, and will not be repeated here.
[0094] The acquisition module 401 is used to acquire cell data of a plurality of cells, where the cell data includes an initial gene expression matrix of each of the plurality of cells.
[0095] The pre-processing module 402 is configured to determine a preset number of nearest neighbor cells of a target cell among the multiple cells based on the cell data.
[0096] The determination module 403 is used to determine the gene expression distance between the target cell and each nearest neighbor cell, determine a distance parameter according to a target non-zero value in the gene expression distance, and determine a weight parameter corresponding to each nearest neighbor cell based on the distance parameter.
[0097] The optimization module 404 is configured to obtain a target gene expression matrix after smoothing the initial gene expression matrix of the target cell based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell.
[0098] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the methods in the above-mentioned embodiments of the present application.
[0099] The computer-readable storage medium may be an internal memory of the electronic device described in the above embodiment, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the electronic device.
[0100] In some embodiments, the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, applications required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc.
[0101] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0102] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0103] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0104] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0105] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A gene expression matrix optimization method, characterized in that: The method comprises: Acquire cell data of a plurality of cells, the cell data comprising an initial gene expression matrix of each cell in the plurality of cells; Determine a preset number of nearest neighbor cells of the target cell among the multiple cells according to the cell data; Determine the gene expression distance between the target cell and each nearest neighbor cell, determine a distance parameter according to a target non-zero value in the gene expression distance, and determine a weight parameter corresponding to each nearest neighbor cell based on the distance parameter; Based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell, a target gene expression matrix is obtained after smoothing the initial gene expression matrix of the target cell.
2. The gene expression matrix optimization method according to claim 1, before determining a preset number of nearest neighbor cells of the target cell among the plurality of cells according to the cell data, the method further comprises preprocessing the cell data, comprising: The cell data are normalized, and the dimension of the normalized cell data is reduced.
3. The gene expression matrix optimization method according to claim 1, wherein the cell data further comprises the spatial position coordinates of each cell in the plurality of cells, and the determining of a preset number of nearest neighbor cells of the target cell according to the cell data comprises: Based on the spatial position coordinates of each cell, determining other cells among the multiple cells except the target cell, and determining the spatial position distance between each cell among the other cells and the target cell; The spatial position distances are sorted in ascending order, and the cells corresponding to the preset number of spatial position distances that are ranked first in the sorted sequence are selected as the nearest neighbor cells of the target cell.
4. The gene expression matrix optimization method according to claim 1, wherein determining the gene expression distance between the target cell and each nearest neighbor cell comprises: The Euclidean distance between the initial gene expression matrix of the target cell and the initial gene expression matrix of each nearest neighbor cell is calculated, and the Euclidean distance is used as the gene expression distance.
5. The gene expression matrix optimization method according to claim 1, wherein the method for determining the target non-zero value comprises: Constructing a non-negative distance matrix according to the non-zero values in the gene expression distance, wherein the non-negative distance matrix is a one-dimensional matrix, and the value of the preceding element in the one-dimensional matrix is less than or equal to the value of the succeeding element; The percentage quantile of the percentage position in the non-negative distance matrix is extracted based on a preset percentage, and the percentage quantile is used as the target non-zero value.
6. The gene expression matrix optimization method according to claim 1, wherein the formula used to determine the distance parameter according to the target non-zero value in the gene expression distance comprises: Among them, c represents the distance parameter, DDT represents the target non-zero value, gs represents the preset average value of the weight formula for smoothing processing, and a and b represent preset hyperparameters.
7. The gene expression matrix optimization method according to claim 1, wherein the formula used to determine the weight parameter corresponding to each nearest neighbor cell based on the distance parameter comprises: Among them, w i represents the weight parameter corresponding to the nearest neighbor cell i, R(x,i) represents the spatial distance between the target cell x and the nearest neighbor cell i, i∈N x (k), N x (k) represents a set of k nearest neighbor cells of the target cell x, c represents the distance parameter, and a and b represent preset hyperparameters.
8. The gene expression matrix optimization method according to claim 1, wherein the formula used to obtain the target gene expression matrix after smoothing the initial gene expression matrix of the target cell based on the weight parameter corresponding to each nearest neighbor cell and the initial gene expression matrix of each nearest neighbor cell includes: Among them, exp′ x represents the target gene expression matrix of target cell x, w i represents the weight parameter corresponding to the nearest neighbor cell i, n x (k) represents the set of k nearest neighbor cells of the target cell x, exp i represents the initial gene expression matrix of the nearest neighbor cell i.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory, and the processor is used to implement the gene expression matrix optimization method according to any one of claims 1 to 8 when executing a computer program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the gene expression matrix optimization method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Single cell clustering method and device, electronic equipment and storage medium
CN110827921A
Method for calculating cell subset enrichment fraction in pool sequencing by using single cell sequencing data
CN114708910A
Method for detecting phase change critical point of complex biological system based on single cell map entropy
CN115083524A
Cited By
Immunohistochemical staining machine data acquisition and analysis method and system
CN121207795A
A method and system for data acquisition and analysis of immunohistochemical staining machine
CN121207795B