Rare cell type detection method, system and device based on topological characteristics
Through the rare type cell detection method based on topological characteristics, the entropy value and skewness of the cells are calculated, combined with the local abnormal factor detection algorithm, to solve the problems of low detection efficiency and poor accuracy of rare cells in the existing technology, and achieve high efficiency , accurate rare cell type identification and subpopulation classification.
Patent Information
- Application Number
- CN202210617086.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-06-01
AI Technical Summary
Existing methods for detecting rare cell types have low efficiency and poor accuracy, making it difficult to distinguish rare cell types. They have high false positive rates, insufficient recall and accuracy rates, and are highly sensitive to parameters and greatly affected by noise.
Using a detection method based on topological characteristics, a topological feature matrix is constructed by calculating the entropy value, average value, median and skewness of cells, combined with the local abnormal factor detection algorithm to calculate the rarity score, and setting the threshold through adaptive parameter optimization. Output the binary prediction results of rare types of cells, and further use the community discovery algorithm to divide into subpopulations.
It effectively reduces the data dimension, improves prediction efficiency, accuracy and adaptability, significantly improves the detection accuracy and recall rate of rare cell types, and reduces the false positive rate.
Smart Images

Figure CN115019890B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to a method, system and device for detecting rare cell types based on topological characteristics. Background Art
[0002] At present, compared with traditional sequencing technology, single-cell sequencing technology greatly improves the research accuracy in the field of life medicine by providing high-resolution sequencing data, provides new solutions for some important medical problems, and helps researchers to explore the development and disease progression of organisms from the cellular level. The discovery of rare cell types, such as short-lived precursor cells, endothelial progenitor cells, antigen-specific T cells, stem cells, circulating tumor cells or cancer cells, invariant natural killer T cells, etc., is of great help to the clinical diagnosis and treatment of patients, and is of great significance for the in-depth understanding of tissue biology in normal and disease states. At present, the analysis process of single-cell transcriptome data is relatively mature. In recent years, a large number of clustering algorithms for single-cell transcriptome data have emerged. They can better discover common cell types for subsequent marker screening. However, to study the developmental changes and functions of a tissue or organ, it is necessary to clearly know all the cell types in it. It is far from enough to just understand the common cell types. At present, most heterogeneity analysis algorithms are aimed at analyzing common cell types, because common cell types have a large number of cells and high expression levels. Often, ideal results can be achieved by calculating the similarity of their highly variable genes, that is, genes with the largest expression differences between cells, and clustering them. For some rare cell types, the selection of highly variable gene features of common cell types is not applicable, but it is still a big challenge to identify marker genes that are specifically expressed in rare cell types and can be used for type classification. Moreover, compared with common cell types, rare cell types are more susceptible to interference from various factors such as sample quality or batch effects. Not only that, most rare cell types are mixed in common cell types, making it difficult to distinguish between rare cell types and common cell types.
[0003] At present, most algorithms for identifying rare cell types rely on single-cell clustering algorithms, which often expose some problems such as long time consumption, high false positive rate and low accuracy. The current mainstream rare cell detection algorithms are GiniClust3, RaceID3, CellSIUS, Fire and GapClust and their advantages and disadvantages. Among them, the core of GiniClust3, RaceID3 and CellSIUS algorithms are based on clustering, so they can only output binary prediction results of single-cell expression profiles. The design idea of GiniClust3 is to select Gini genes for clustering based on the Gini index. When the biological complexity in the single-cell expression profile is high, GiniClust3 cannot consider the relationship within the rare cell type cluster, so it is not suitable for rare cell subtype division. CellSIUS is based on K-means to perform rough clustering first and then subdivide the class. Its prediction performance is poor and the false positive rate is high. RaceID3 is also designed based on the K-means algorithm, but it is extremely time-consuming. When the number of cells in the data set reaches 5k, its calculation time exceeds 78h. Fire and GapClust can output continuous rarity scores of single-cell expression profiles. Fire calculates the rarity score for each cell based on the hash code obtained by random projection, but its feature selection process consumes a lot of time and memory. GapClust calculates the rarity score for each cell based on the second-order partial derivative of the change in the neighbor distance. The selection of the neighbor position of its parameters can directly and significantly affect the accuracy of the prediction results. It can be seen that the parameter sensitivity of the GapClust method is strong and the robustness is poor, and the experimental results will be greatly affected by the noise points in the data set.
[0004] The current mainstream rare cell type detection methods have the following problems: (1) How to design a fast and efficient rare cell detection method; (2) How to combine other biological information to improve the accuracy of rare cell type classification; (3) How to reduce the false positive of rare cell type detection; (4) How to improve the recall rate and accuracy of rare cell detection.
[0005] It can be seen that there is an urgent need for an efficient, accurate and adaptable method for detecting rare cell types based on topological characteristics. Summary of the invention
[0006] In view of this, the embodiments of the present disclosure provide a method, system and device for detecting rare cell types based on topological characteristics, which at least partially solve the problems of poor detection efficiency, accuracy and adaptability in the prior art.
[0007] In a first aspect, the present disclosure provides a method for detecting rare cell types based on topological characteristics, comprising:
[0008] Step 1: Input a single cell expression profile, N cells and M genes, retain M1 highly variable genes with the highest expression divergence ranking through data preprocessing to form a feature matrix, and calculate the KNN nearest neighbor distance matrix X for the obtained feature matrix;
[0009] Step 2: For the neighbor distance matrix X consisting of the distances between N cells and k neighboring cells, calculate the entropy value H(X) and the average value according to the distance vector between each cell and its other k neighboring cells. Median m 0.5 and skewness g as the four domain topological characteristics of the cell, and use them to construct the cell domain topological feature matrix R;
[0010] Step 3: Based on the topological feature matrix R, the rarity score of each cell is calculated in combination with the local anomaly factor detection algorithm, and the threshold is set according to the adaptive parameter optimization method to output the binary prediction results of rare type cells;
[0011] Step 4: Combine the binary prediction results of rare cell types with the community discovery algorithm to further divide the rare cells into subgroups.
[0012] According to a specific implementation of the embodiment of the present disclosure, step 2 specifically includes:
[0013] The formula for calculating the entropy value topological feature H(X) is expressed as:
[0014]
[0015] Where p(x ij ) represents the probability of the jth neighbor distance of the ith cell, and its formula is expressed as:
[0016]
[0017] Domain topology features Represents the average topological feature, and its formula is expressed as:
[0018]
[0019] Adopt X 0.5 Represents the median topological feature, and its calculation method is expressed as:
[0020] When the number of nearest neighbors k is an odd number,
[0021]
[0022] When the number of nearest neighbors k is even,
[0023]
[0024] Skew(X) is used to represent the skewness topological characteristics, and its calculation method is expressed as:
[0025] Skew(X i )=g([x i1 ,x i2 ,x i3 ,…,x ik ]),i∈(1,2,…,N)
[0026] Where k is the number of neighbors, N is the number of cells, and x ij represents the jth neighbor distance of the ith cell, H(X) represents the entropy value, represents the average value, m 0.5 represents the median and g represents the skewness;
[0027] Construct the topological feature matrix R based on the above four topological features:
[0028]
[0029] According to a specific implementation of the embodiment of the present disclosure, the expression of the local anomaly factor detection algorithm is: Indicates point N in the cell i area k The average of the ratios of the local accessible density of (i) to the local accessible density of cell i;
[0030] Among them, lrd(i) represents the local reachable density of cell i, and the formula is expressed as:
[0031]
[0032] Distance k (i,p) is expressed as:
[0033] distance k (i,p)=max{distance k (p),d(i,p)}
[0034] Among them, distance k (i,p) represents the kth reachable distance from cell p to cell i, which is at least the distance between p’s k nearest neighbors or the distance between i and p. d(i,p) represents the distance between i and p.
[0035] According to a specific implementation of the embodiment of the present disclosure, step 3 specifically includes:
[0036] Using a data-driven approach to input a preset rare cell ratio;
[0037] The continuous rarity scores of all cells will be output and sorted from large to small, and a scatter plot will be drawn;
[0038] Calculate the rarity score difference ΔW between cell i and its neighboring cells based on the scatter plot i ;
[0039] According to the rarity score difference ΔW i Calculate the rate of change of the rarity score, i.e. the second-order partial derivative ΔΔW i , and ΔΔW i The horizontal axis of the extreme point position is the number of cells with the highest rarity scores.
[0040] In a second aspect, the present disclosure provides a rare cell type detection system based on topological characteristics, including:
[0041] The preprocessing module is used to input a single-cell expression profile, N cells and M genes, retain the top M1 highly variable genes with the highest expression divergence through data preprocessing to form a feature matrix, and calculate the KNN nearest neighbor distance matrix X for the obtained feature matrix;
[0042] The calculation module is used to obtain the neighbor distance matrix X composed of the distances between N cells and k neighbor cells, and calculate its entropy value H(X), average value according to the distance vector between each cell and other k neighbor cells Median m 0.5 and skewness g as the four domain topological characteristics of the cell, and use them to construct the cell domain topological feature matrix R;
[0043] The prediction module is used to calculate the rarity score of each cell based on the topological feature matrix R and the local anomaly factor detection algorithm, and to set the threshold according to the adaptive parameter optimization method to output the binary prediction results of rare type cells;
[0044] The partitioning module is used to combine the binary prediction results of rare cell types with the community discovery algorithm to further divide the rare cells into subgroups.
[0045] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0046] at least one processor; and,
[0047] a memory communicatively connected to the at least one processor; wherein,
[0048] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the rare type cell detection method based on topological characteristics in the aforementioned first aspect or any implementation of the first aspect.
[0049] The rare cell type detection scheme based on topological characteristics in the embodiment of the present disclosure includes: step 1, inputting a single cell expression profile, N cells and M genes, retaining M1 highly variable genes with the highest expression divergence ranking through data preprocessing to form a feature matrix, and calculating the KNN nearest neighbor distance matrix X for the obtained feature matrix; step 2, for the obtained neighbor distance matrix X composed of the distances between the N cells and the k nearest neighbor cells, calculating its entropy value H(X), average value according to the distance vector between each cell and the other k nearest neighbor cells Median m 0.5 and skewness g as the four domain topological characteristics of the cell, and use them to construct the cell domain topological feature matrix R; Step 3, based on the topological feature matrix R, combined with the local anomaly factor detection algorithm, calculate the rarity score of each cell, and set the threshold according to the adaptive parameter optimization method to output the binary prediction results of rare type cells; Step 4, combine the binary prediction results of rare type cells with the community discovery algorithm to further divide the rare cells into subgroups.
[0050] The beneficial effects of the embodiments of the present disclosure are as follows: through the scheme of the present disclosure, a topological feature matrix is constructed based on the neighbor differences of rare types of cells, which has the advantage of effectively reducing the data dimension and improving the prediction efficiency, accuracy and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A schematic diagram of a process for detecting rare cell types based on topological characteristics provided in an embodiment of the present disclosure;
[0053] Figure 2 A schematic diagram of a process flow of another rare cell type detection method based on topological characteristics provided in an embodiment of the present disclosure;
[0054] Figure 3 A schematic diagram of the heterogeneity analysis performance of rare cell types on a real data set using the method provided in an embodiment of the present disclosure;
[0055] Figure 4 A schematic diagram of the structure of a rare cell type detection system based on topological characteristics provided in an embodiment of the present disclosure;
[0056] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0057] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0058] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0059] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0060] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0061] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0062] The embodiments of the present disclosure provide a method for detecting rare cell types based on topological characteristics, which can be applied to single cell detection in the field of life medicine.
[0063] See also Figure 1 , is a schematic diagram of a process flow of a rare cell type detection method based on topological characteristics provided by an embodiment of the present disclosure. Figure 1 and Figure 2 As shown, the method mainly comprises the following steps:
[0064] Step 1: Input a single cell expression profile, N cells and M genes, retain M1 highly variable genes with the highest expression divergence ranking through data preprocessing to form a feature matrix, and calculate the KNN nearest neighbor distance matrix X for the obtained feature matrix;
[0065] In specific implementation, a single-cell expression spectrum, N cells, and M genes can be input. Through data preprocessing, the M1 highly variable genes with the highest expression divergence ranking are retained to form a feature matrix, and the KNN nearest neighbor (K-Nearest Neighbor, referred to as KNN) is calculated based on the feature matrix obtained in the previous step. The naive KNN calculation method is to calculate the distance between the sample point and all other sample points in the data set, and then sort and select the sample with the smallest distance. Assuming that the present invention calculates the k nearest neighbor cells of each cell (excluding itself), when the number of cells is large, the time consumed by the naive calculation method will increase linearly. Therefore, Topo uses the lightweight and fast HNSW (Hierarchical Navigable Small World) nearest neighbor search algorithm to construct a KNN graph. The HNSW nearest neighbor search algorithm is based on the traditional construction of the KNN graph. By retaining some non-nearest neighbor edges during the construction process, jumps between distant points are achieved, and multi-level nearest neighbor searches are achieved through the "skip list structure". After this step, the nearest neighbor distance matrix X can be obtained:
[0066]
[0067] The matrix X represents the neighbor distance matrix composed of the distances between N cells and k neighboring cells in the single-cell expression profile, where the row vector [x i1 ,x i2 ,x i3 ,…,x ik ], i∈(1,2,…,N) represents the distance vector between the ith cell and its k nearest neighbor cells. The KNN nearest neighbor calculation method adopts the lightweight and fast HNSW method.
[0068] Step 2: For the neighbor distance matrix X consisting of the distances between N cells and k neighboring cells, calculate the entropy value H(X) and the average value according to the distance vector between each cell and its other k neighboring cells. Median m 0.5 and skewness g as the four domain topological characteristics of the cell, and use them to construct the cell domain topological feature matrix R;
[0069] Furthermore, the step 2 specifically includes:
[0070] The formula for calculating the entropy value topological feature H(X) is expressed as:
[0071]
[0072] Where p(x ij ) represents the probability of the jth neighbor distance of the ith cell, and its formula is expressed as:
[0073]
[0074] Domain topology features Represents the average topological feature, and its formula is expressed as:
[0075]
[0076] Adopt X 0.5 Represents the median topological feature, and its calculation method is expressed as:
[0077] When the number of nearest neighbors k is an odd number,
[0078]
[0079] When the number of nearest neighbors k is even,
[0080]
[0081] Skew(X) is used to represent the skewness topological characteristics, and its calculation method is expressed as:
[0082] Skew(X i )=g([x i1 ,x i2 ,x i3 ,…,x ik ]),i∈(1,2,…,N)
[0083] Where k is the number of neighbors, N is the number of cells, and x ij represents the jth neighbor distance of the ith cell, H(X) represents the entropy value, represents the average value, m 0.5 represents the median and g represents the skewness;
[0084] Construct the topological feature matrix R based on the above four topological features:
[0085]
[0086] In the specific implementation, we can get the neighbor distance matrix X consisting of the distances between N cells and k neighbor cells from the previous step. Take each row of the matrix [x i1 ,x i2 ,x i3 ,…,x ik], i∈(1,2,…,N), that is, the distance vector between each cell and its k nearest neighbor cells, and the entropy value H(X) is calculated for this vector, the average value Median m 0.5 And skewness g constitute a four-column topological matrix feature, where the formula of the entropy value topological feature H(X) is expressed as:
[0087]
[0088] Where p(x ij ) represents the probability of the jth neighbor distance of the ith cell, and its formula is expressed as:
[0089]
[0090] Domain topology features Represents the average topological feature, and its formula is expressed as:
[0091]
[0092] Adopt X 0.5 Represents the median topological feature, and its calculation method is expressed as:
[0093] a. If the number of nearest neighbors k is an odd number,
[0094]
[0095] b. When the number of nearest neighbors k is even,
[0096]
[0097] Skew(X) is used to represent the skewness topological characteristics, and its calculation method is expressed as:
[0098] Skew(X i )=g([x i1 ,x i2 ,x i3 ,…,x ik ]),i∈(1,2,…,N)
[0099] Where k is the number of neighbors, N is the number of cells, and x ij represents the jth neighbor distance of the ith cell. H(X) represents the entropy value, represents the average value, m 0.5 denotes the median and g denotes the skewness.
[0100] According to the above four calculation formulas based on entropy, mean, median and skewness, we finally get an N×4 topological feature matrix R with N rows and 4 columns:
[0101]
[0102] Step 3: Based on the topological feature matrix R, the rarity score of each cell is calculated in combination with the local anomaly factor detection algorithm, and the threshold is set according to the adaptive parameter optimization method to output the binary prediction results of rare type cells;
[0103] Furthermore, the expression of the local anomaly factor detection algorithm is: Indicates point N in the cell i area k The average of the ratios of the local accessible density of (i) to the local accessible density of cell i;
[0104] Among them, lrd(i) represents the local reachable density of cell i, and the formula is expressed as:
[0105]
[0106] Distance k (i,p) is expressed as:
[0107] distance k (i,p)=max{distance k (p),d(i,p)}
[0108] Among them, distance k (i,p) represents the kth reachable distance from cell p to cell i, which is at least the distance between p’s k nearest neighbors or the distance between i and p. d(i,p) represents the distance between i and p.
[0109] Based on the above embodiment, step 3 specifically includes:
[0110] Using a data-driven approach to input a preset rare cell ratio;
[0111] The continuous rarity scores of all cells will be output and sorted from large to small, and a scatter plot will be drawn;
[0112] Calculate the rarity score difference ΔW between cell i and its neighboring cells based on the scatter plot i ;
[0113] According to the rarity score difference ΔW i Calculate the rate of change of the rarity score, i.e. the second-order partial derivative ΔΔW i , and ΔΔW i The horizontal axis of the extreme point position is the number of cells with the highest rarity scores.
[0114] During specific implementation, based on the topological feature matrix R, rare cells and common cells can be distinguished from the features, so this step only needs to adopt a simple outlier detection algorithm to classify the cells into two categories. The present invention adopts the outlier detection algorithm LOF (Local Outlier Factor), which is a density-based unsupervised outlier detection algorithm. Compared with other outlier detection algorithms, LOF does not require the data to satisfy any distribution, and can quantify the degree of abnormality (outlierness) of each data point. The main idea of the LOF algorithm is that if the local neighborhood data points of a given data point are relatively dense, then it is more likely to be a normal point, that is, a common type of cell. If the data points in the neighborhood of the point are relatively sparse and the density is small, then it is more likely to be an outlier, that is, a rare cell. The LOF formula is expressed as:
[0115]
[0116] The above formula represents the cell i area point N k The average of the ratios of the local reachability density of cell i to the local reachability density of cell i. If this ratio is closer to 1, it means that the density of i is close to that of the domain points, and i may belong to the same cluster as the domain; if this ratio is less than 1, it means that the density of i is higher than the density of its domain points, and i is a dense point; if this ratio is greater than 1, it means that the density of i is lower than the density of its domain points, and i is more likely to be an outlier. Among them, lrd(i) represents the local reachability density of cell i, and the formula is expressed as:
[0117]
[0118] lrd(i) represents the density value. If cell i and the domain cell belong to the same cluster, the reachable distance is small and the density value is high. If the reachable distance is large, the density value is small and the possibility that cell i is an outlier is greater. k (i,p) is expressed as:
[0119] distance k (i,p)=max{distance k (p),d(i,p)}
[0120] where distance k (i,p) represents the kth reachable distance from cell p to cell i, which is at least the distance of p's k nearest neighbors, or the distance between i and p. d(i,p) represents the distance between i and p.
[0121] Because the larger the outlier factor is, the higher the probability that the data point is an outlier, the present invention defines the outlier factor as a rarity score. The higher the rarity score is, the greater the probability that the cell belongs to a rare type.
[0122] The embodiment of the present invention can output the LOF rarity score through two parameter selection methods. One method is to input the default rare cell ratio of 0.02, and the other method is the adaptive parameter optimization method designed by the present invention. It is to input the default rare cell ratio of 0.02 in a data-driven manner, and then output the continuous rarity scores of all cells and sort them from large to small, and draw a scatter plot. Assume that W i represents the rarity score of cell i, where i∈(1,2,…,N). Then
[0123] ΔW i =W i -W i+1
[0124] In the above formula, ΔW i represents the difference in rarity scores between cell i and its neighboring cells. The rarity score change rate, i.e., the second-order partial derivative, is expressed as:
[0125]
[0126] Where ΔΔW i The horizontal coordinate of the extreme point position is the number of cells with the highest rarity scores. The present invention sets it as the outlier ratio in the LOF method so that the model achieves the best experimental effect.
[0127] Step 4: Combine the binary prediction results of rare cell types with the community discovery algorithm to further divide the rare cells into subgroups.
[0128] In specific implementation, after obtaining the binary prediction results of the rare type cells, the binary prediction results of the rare type cells can be combined with the community discovery algorithm to further divide the rare cells into subgroups.
[0129] The rare cell type detection method based on topological characteristics provided in this embodiment constructs a topological feature matrix based on the neighbor differences of the rare cell type. The advantage is that it effectively reduces the data dimension and improves the prediction efficiency, accuracy and adaptability.
[0130] The present solution will be described below in conjunction with an embodiment. In order to verify the effectiveness of the method of the present invention, we tested 12 simulated data sets generated by the R package splatter and 5 sets of standard single-cell sequencing data sets Baron_human, Shekhar, HCF-spleen, Macosko and PBMC~68k. The detailed information of the data sets is listed in Table 1. And compared and analyzed with five rare cell detection methods, GiniClust3, Fire, CellSIUS, GapClust and RaceID3. The present invention quotes the simulated data set of the Fire method, that is, the Jurkat and 293T data sets are mixed using the R package splatter. According to the unchanged category, that is, only divided into two categories of common cell types and rare cell types, the number of common type cells is controlled to 1500, and the proportion of rare type cells is adjusted to 0.5%, 1%, 1.5%, 2%, 2.5%, 5%, 10%, 15%, and 8 sets of data sets are simulated and generated. These 8 sets of data sets are named simulate_1508, simulate_1516, simulate_1523, simulate_1531, simulate_1539, simulate_1579, simulate_1667 and simulate_1765 according to the number of cells, wherein the number of rare type cells is 8, 16, 23, 31, 39, 79, 167 and 265 respectively. The present invention compares the Recall, Precision and F1 values of the Topo method and the GiniClust3, Fire, CellSIUS, GapClust and RaceID3 methods on these 8 sets of simulated data sets. Because the number of common cell types needs to change, the data simulation of this experiment cannot be completed using a single real data set. Therefore, unlike the previous method of mixing and generating simulated data sets by real data sets, this experiment uses splatter to randomly generate simulated data sets with 5000 cells and 4000 genes. In the simulated data set, the proportion of rare cells is fixed to 1%, and the number of common cell types is adjusted to 1, 4, 7 and 10, that is, the total number of cell types is 2, 5, 8 and 11, totaling 4 sets of simulated data sets. The present invention names these 4 sets of simulated data sets as simulate_2clusters, simulate_5clusters, simulate_8clusters and simulate_11clusters according to the number of cell types.Because the calculation time of the RaceID3 method exceeds 48 hours when the number of cells in the data set reaches 3000, the present invention compares the Recall, Precision and F1 values of the Topo method and the GiniClust3, Fire, CellSIUS and GapClust methods on these 8 sets of simulated data sets. In order to analyze the experimental effect of the Topo framework on the classification of rare cell subtypes, the present invention designed 15 rare cell clusters based on 5 sets of data sets, namely Baron_human, Shekhar, HCF-spleen, Macosko and PBMC~68k, for comparative analysis experiments.
[0131] Dataset Cell number Number of genes Rare cell number Rare ratio Organization Source Baron_human 8569 20125 118 1.3% The pancreas Shekhar 26830 13166 139 0.5% The retina HCF-spleen 13180 14133 189 1.4% The spleen Macosko 44808 23288 269 0.6% The retina PBMC~68k 68579 32738 374 0.5% A healthy donor
[0132] Table 1
[0133] In order to objectively evaluate the effectiveness of this method, two commonly used indicators, Recall, Precision and F1 value, are selected as evaluation criteria. Conventional binary classification prediction models usually divide the results into positive and negative classes, and construct a confusion matrix (Table 2) based on the true positive and negative classes and the predicted positive and negative classes, where TP (True Positive) means that the true positive sample is correctly predicted as positive, TN (True Negative) means that the true negative sample is correctly predicted as negative, FP (False Positive) means that the true negative sample is incorrectly predicted as positive, and FN (False Negative) means that the true positive sample is incorrectly predicted as negative.
[0134]
[0135] Table 2
[0136] In the two-classification model, the recall rate is defined as:
[0137]
[0138] Accuracy Precision is defined as:
[0139]
[0140] The comprehensive evaluation index F1 value is calculated by Recall and Precision, and is defined as:
[0141]
[0142] The default parameter settings of the Topo method in the experiment are shown in Table 3.
[0143] parameter Default value Number of features 2000 Distance calculation method cosine The number of nearest neighbors k 1000 Rare cell ratio 0.02
[0144] Table 3
[0145] The experimental results show that the method of the present invention is superior to other methods based on Recall, Precision and F1 value under different samples. It can be seen that the Topo framework of our proposed method can accurately predict rare cells and realize effective heterogeneity analysis of rare cell types.
[0146]
[0147] Table 4
[0148]
[0149] Table 5
[0150]
[0151] Table 6
[0152] Table 4, Table 5 and Table 6 show the performance of Recall, Precision and F1 values of Topo method and other rare cell detection methods when rare cell types account for different proportions in the data set, wherein Table 4 shows the Recall values of the method of the present invention and 5 comparative methods on eight sets of simulated data sets with different rare cell proportions, Table 5 shows the Precision values of the method of the present invention and 5 comparative methods on eight sets of simulated data sets with different rare cell proportions, and Table 6 shows the F1 values of the method of the present invention and 5 comparative methods on eight sets of simulated data sets with different rare cell proportions. For example, simulate_1508 means that the simulated data set contains a total of 1508 cells, of which 8 are rare cells with a rarity of 0.5%. It can be seen from the results that in the data set simulated by the Fire tool, the performance of the Topo method is not only not affected by the change in the proportion of rare cells, but also its Recall, Precision and F1 values can be stably maintained at 100%. In short, all rare cells in the real label of the data set are detected in the prediction results, and there is no prediction error. Currently, no rare cell detection method can achieve such performance. At the same time, the experimental results also verified that the performance of the Topo method is not affected by changes in the proportion of rare cells in the data set.
[0153]
[0154] Table 7
[0155]
[0156] Table 8
[0157]
[0158]
[0159] Table 9
[0160] Tables 7, 8, and 9 show the performance of the Topo method when the proportion of rare cells remains unchanged and the number of common cell types in the data set increases. The experimental results show that the rare cell detection performance of the Topo method is not affected by the number of common cell types, that is, no matter how many common cell types there are, it does not affect the experimental performance of the Topo method, and is the same as the results of the previous simulation experiment. In this set of simulation experiments, the Recall, Precision, and F1 values of the Topo method remain stable at 100%, and there is no false positive rate.
[0161]
[0162] Table 10
[0163]
[0164] Table 11
[0165]
[0166]
[0167] Table 12
[0168] Tables 10, 11 and 12 show the Recall, Precision and F1 performance of the Topo method and four methods, namely GiniClust3, Fire, CellSIUS and GapClust, on five real data sets. The experimental results show that the prediction results of the Topo method are significantly improved compared with other rare cell detection methods, and the prediction performance of the Topo method is far better than other methods.
[0169] Figure 3The present invention combines the Louvain method of Seurat tool to further classify rare cell types, and compares the results of rare cell subtype division when using Seurat tool and Toomanycells tool alone in real data sets Baron_human, Shekhar, HCF-spleen, Macosko and PBMC~68k clustering. Among them, the rare cell types of Baron_human data set are macrophage, mast, epsilon, schwann and t_cell, the rare cell types of Shekahr data set are rods and cones, the rare cell types of HCF-spleen data set are Megakaryocytes and AFP_ALBpositivecells, the rare cell types of Macosko data set are fibroblasts, microglia, pericytes and astrocytes, and the rare cell types of PBMC~68k data set are CD34+ and CD4+T. There are 15 rare cell types in all the above data sets. By analyzing the clustering results of these 15 rare cell types, it was found that the F1 value of subtype classification using the Topo framework was much higher than that of directly using the classic clustering tools Seurat and Toomanycells for all rare cell types. Even for most rare cell types, the F1 value of the prediction results of the Topo framework can reach 100%, which shows that the Topo framework can reliably and accurately achieve the detection accuracy and subtype classification accuracy of rare cell types.
[0170] Corresponding to the above method embodiment, see Figure 4 The embodiment of the present disclosure further provides a rare cell type detection system 40 based on topological characteristics, comprising:
[0171] A preprocessing module 400 is used to input a single cell expression profile, N cells and M genes, retain M1 highly variable genes with the highest expression divergence ranking through data preprocessing to form a feature matrix, and calculate a KNN nearest neighbor distance matrix X for the obtained feature matrix;
[0172] The calculation module 402 is used to obtain the neighbor distance matrix X formed by the distances between N cells and k neighbor cells, and calculate the entropy value H(X), the average value, and the average value according to the distance vector between each cell and the other k neighbor cells. Median m 0.5 and skewness g as the four domain topological characteristics of the cell, and use them to construct the cell domain topological feature matrix R;
[0173] Prediction module 403, used to calculate the rarity score of each cell based on the topological feature matrix R in combination with the local abnormal factor detection algorithm, and set the threshold according to the adaptive parameter optimization method to output the binary prediction result of the rare type cell;
[0174] The division module 404 is used to combine the binary prediction results of rare type cells with the community discovery algorithm to further divide the rare cells into subgroups.
[0175] Figure 4 The system shown can correspondingly execute the contents of the above method embodiment. For the parts not described in detail in this embodiment, refer to the contents recorded in the above method embodiment and will not be repeated here.
[0176] See also Figure 5 The embodiment of the present disclosure further provides an electronic device 50, which includes: at least one processor and a memory in communication with the at least one processor. The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the rare cell type detection method based on topological characteristics in the aforementioned method embodiment.
[0177] The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the rare type cell detection method based on topological characteristics in the aforementioned method embodiment.
[0178] The embodiments of the present disclosure also provide a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the rare type cell detection method based on topological characteristics in the aforementioned method embodiment.
[0179] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 50 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0180] like Figure 5As shown, the electronic device 50 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 50 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0181] Typically, the following devices may be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication device 509 may allow the electronic device 50 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 50 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0182] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0183] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0184] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0185] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device can execute the relevant steps of the method embodiment.
[0186] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can perform the relevant steps of the method embodiment.
[0187] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0188] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0189] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware.
[0190] It should be understood that various parts of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
[0191] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for detecting rare cell types based on topological characteristics, characterized in that: include: Step 1: Input a single cell expression profile, N cells and M genes, retain M1 highly variable genes with the highest expression divergence ranking through data preprocessing to form a feature matrix, and calculate the KNN nearest neighbor distance matrix X for the obtained feature matrix; Step 2: For the neighbor distance matrix X consisting of the distances between N cells and k neighboring cells, calculate the entropy value H(X) and the average value according to the distance vector between each cell and its other k neighboring cells. Median m 0.5 and skewness g as the four domain topological characteristics of the cell, and use them to construct the cell domain topological feature matrix R; The step 2 specifically includes: The formula for calculating the entropy value topological feature H(X) is expressed as: Where p(x ij ) represents the probability of the jth neighbor distance of the ith cell, and its formula is expressed as: Domain topology features Represents the average topological feature, and its formula is expressed as: Adopt X 0.5 Represents the median topological feature, and its calculation method is expressed as: When the number of nearest neighbors k is an odd number, When the number of nearest neighbors k is even, Skew(X) is used to represent the skewness topological characteristics, and its calculation method is expressed as: Skew(X i )=g([x i1 ,x i2 ,x i3 ,…,x ik ]),i∈(1,2,…,N) Where k is the number of neighbors, N is the number of cells, and x ij represents the jth neighbor distance of the ith cell, H(X) represents the entropy value, represents the average value, m 0.5 represents the median and g represents the skewness; Construct the topological feature matrix R based on the above four topological features: Step 3, based on the topological feature matrix R, combined with the local anomaly factor detection algorithm, calculate the rarity score of each cell, set the threshold according to the adaptive parameter optimization method, and output the binary prediction result of the rare type cell, where the expression of the local anomaly factor detection algorithm is: Indicates point N in the cell i area k The average of the ratios of the local accessible density of (i) to the local accessible density of cell i; Among them, lrd(i) represents the local reachable density of cell i, and the formula is expressed as: Distance k (i,p) is expressed as: distance k (i,p)=max{distance k (p),d(i,p)} Among them, distance k (i,p) represents the kth reachable distance from cell p to cell i, which is at least the distance of p's k nearest neighbors or the distance between i and p. d(i,p) represents the distance between i and p. Step 4: Combine the binary prediction results of rare cell types with the community discovery algorithm to further divide the rare cells into subgroups.
2. The method according to claim 1, characterized in that , the step 3 specifically includes: Using a data-driven approach to input a preset rare cell ratio; The continuous rarity scores of all cells will be output and sorted from large to small, and a scatter plot will be drawn; Calculate the rarity score difference ΔW between cell i and its neighboring cells based on the scatter plot i ; According to the rarity score difference ΔW i Calculate the rate of change of the rarity score, i.e. the second-order partial derivative ΔΔW i , and ΔΔW i The horizontal axis of the extreme point position is the number of cells with the highest rarity scores.
3. A rare cell type detection system based on topological characteristics, characterized in that: include: The preprocessing module is used to input a single-cell expression profile, N cells and M genes, retain the top M1 highly variable genes with the highest expression divergence through data preprocessing to form a feature matrix, and calculate the KNN nearest neighbor distance matrix X for the obtained feature matrix; The calculation module is used to obtain the neighbor distance matrix X composed of the distances between N cells and k neighbor cells, and calculate its entropy value H(X), average value according to the distance vector between each cell and other k neighbor cells Median m 0.5 and skewness g as the four domain topological characteristics of the cell, and use them to construct the cell domain topological feature matrix R; The specific process of the calculation module includes: The formula for calculating the entropy value topological feature H(X) is expressed as: Where p(x ij ) represents the probability of the jth neighbor distance of the ith cell, and its formula is expressed as: Domain topology features Represents the average topological feature, and its formula is expressed as: Adopt X 0.5 Represents the median topological feature, and its calculation method is expressed as: When the number of nearest neighbors k is an odd number, When the number of nearest neighbors k is even, Skew(X) is used to represent the skewness topological characteristics, and its calculation method is expressed as: Skew(X i )=g([x i1 ,x i2 ,x i3 ,…,x ik ]),i∈(1,2,…,N) Where k represents the number of neighbors, N represents the number of cells, and x ij represents the jth neighbor distance of the ith cell, H(X) represents the entropy value, represents the average value, m 0.5 represents the median and g represents the skewness; Construct the topological feature matrix R based on the above four topological features: The prediction module is used to calculate the rarity score of each cell based on the topological feature matrix R and the local anomaly factor detection algorithm, and to set the threshold according to the adaptive parameter optimization method to output the binary prediction result of the rare type of cells. The expression of the local anomaly factor detection algorithm is: Indicates point N in the cell i area k The average of the ratios of the local accessible density of (i) to the local accessible density of cell i; Among them, lrd(i) represents the local reachable density of cell i, and the formula is expressed as: Distance k (i,p) is expressed as: distance k (i,p)=max{distance k (p),d(i,p)} Among them, distance k (i,p) represents the kth reachable distance from cell p to cell i, which is at least the distance of p's k nearest neighbors or the distance between i and p. d(i,p) represents the distance between i and p. The partitioning module is used to combine the binary prediction results of rare cell types with the community discovery algorithm to further divide the rare cells into subgroups.
4. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the rare type cell detection method based on topological characteristics described in any one of claims 1 to 2.
