Clustering processing method and apparatus, electronic device, and readable storage medium
Patent Information
- Application Number
- CN202111235864.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2041-10-22
AI Technical Summary
[0004]本申请实施例提供了一种聚类处理方法、装置、电子设备及可读存储介质,可用于解决相关技术中聚类结果准确性较低的问题,所述技术方案包括如下内容
本申请实施例提供的技术方案中第一聚类簇集合和第二聚类簇集合中的至少一个为目标聚类簇集合,目标聚类簇集合为对目标聚类簇集合对应的聚类结果进行至少一次更新处理得到的,实现了更新目标聚类簇集合对应的聚类结果,之后,基于第二聚类簇集合对第一聚类簇集合进行更新处理,得到第三聚类簇集合,以在满足目标条件时,将第三聚类簇集合作为目标聚类结果,且不同聚类簇集合对应的聚类结果是基于不同的聚类算法对多个对象数据进行聚类处理得到的,实现了通过多次更新融合第一聚类算法和第二聚类算法,提高聚类结果的准确性。
Smart Images

Figure CN114298123B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a clustering processing method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] With the rise of computer technology, more and more data is being processed by computers, and clustering is an important technique for computer data processing. Clustering is a technique that groups data with high similarity attributes into the same cluster and data with low similarity attributes into different clusters based on the attributes of the data objects themselves and the attribute relationships between them, thereby obtaining multiple clusters.
[0003] In related technologies, a single clustering algorithm is typically used to cluster multiple object datasets. However, there are many types of clustering algorithms, including but not limited to K-means clustering, Leiden's algorithm, Louvain's algorithm, and the current state-of-the-art (SOTA) algorithm based on deep learning feature representation. Using only one clustering algorithm to cluster multiple object datasets will affect the accuracy of the clustering results due to the limitations of that algorithm itself. Summary of the Invention
[0004] This application provides a clustering processing method, apparatus, electronic device, and readable storage medium, which can be used to solve the problem of low accuracy of clustering results in related technologies. The technical solution includes the following contents.
[0005] On the one hand, embodiments of this application provide a clustering processing method, the method comprising: Obtain a first cluster set and a second cluster set. The target cluster set in the first cluster set and the second cluster set is obtained by updating the clustering result corresponding to the target cluster set at least once. The target cluster set is at least one of the first cluster set and the second cluster set. The clustering result corresponding to different cluster sets is obtained by clustering multiple object data based on different clustering algorithms. The first cluster set is updated based on the second cluster set to obtain the third cluster set; In response to the satisfaction of the target conditions, the third cluster set is taken as the target clustering result.
[0006] On the other hand, embodiments of this application provide a clustering processing apparatus, the apparatus comprising: The acquisition module is used to acquire a first cluster set and a second cluster set. The target cluster set in the first cluster set and the second cluster set is obtained by updating the clustering result corresponding to the target cluster set at least once. The target cluster set is at least one of the first cluster set and the second cluster set. The clustering results corresponding to different cluster sets are obtained by clustering multiple object data based on different clustering algorithms. The update module is used to update the first cluster set based on the second cluster set to obtain a third cluster set; The determination module is used to determine the third cluster set as the target clustering result in response to the satisfaction of the target conditions.
[0007] In one possible implementation, the update module is further configured to update the third cluster set based on the second cluster set in response to the failure to meet the target condition, thereby obtaining a fourth cluster set; The determining module is further configured to, in response to satisfying the target condition, use the fourth cluster set as the target clustering result.
[0008] In one possible implementation, the update module is used to update the second cluster set based on the first cluster set to obtain a fifth cluster set; and to update the third cluster set based on the fifth cluster set to obtain the fourth cluster set.
[0009] In one possible implementation, the determining module is configured to, in response to the third cluster set being the same as the first cluster set, use the third cluster set as the target clustering result.
[0010] In one possible implementation, the determining module is configured to take the third cluster set as the target clustering result in response to the current update count reaching the target count.
[0011] In one possible implementation, the first cluster set includes a plurality of first clusters, the second cluster set includes a plurality of second clusters, and the third cluster set includes a plurality of third clusters; The update module is used to determine the coefficient of variation of any second cluster based on the first cluster to which each object data in the second cluster belongs, where the coefficient of variation of the second cluster is used to characterize the dispersion of each object data in the second cluster; and to update the plurality of first clusters based on the coefficient of variation of each second cluster to obtain the plurality of third clusters.
[0012] In one possible implementation, the update module is configured to, for any second cluster, in response to the coefficient of variation of the any second cluster being greater than a target coefficient of variation, determine the first cluster corresponding to the any second cluster from the plurality of first clusters; determine the first cluster corresponding to the any second cluster as a third cluster; and add object data in the any second cluster that does not belong to the third cluster to the third cluster.
[0013] In one possible implementation, the update module is configured to, for any second cluster, determine the first cluster to which each object data in the second cluster belongs as the third cluster in response to the fact that the coefficient of variation of the second cluster is not greater than the target coefficient of variation.
[0014] In one possible implementation, the first cluster set includes a plurality of first clusters, the second cluster set includes a plurality of second clusters, and the third cluster set includes a plurality of third clusters; The update module is used to perform outlier detection processing on each object data in any second cluster to obtain outlier detection results for each object data in any second cluster; and to update the multiple first clusters based on the outlier detection results of each object data in each second cluster to obtain multiple third clusters.
[0015] In one possible implementation, the update module is configured to, for any second cluster, in response to the existence of first object data in each object data of the any second cluster, determine the first cluster corresponding to the any second cluster from the plurality of first clusters, wherein the outlier detection result of the first object data is non-outlier object data; determine the first cluster corresponding to the any second cluster as a third cluster; and, in response to the first object data not belonging to the third cluster, add the first object data to the third cluster.
[0016] In one possible implementation, the update module is configured to, for any second cluster, in response to the existence of second object data in each object data of the second cluster, determine the first cluster to which a second object data belongs as a third cluster, and the outlier detection result of the second object data is outlier object data.
[0017] In one possible implementation, the update module is used to perform dimensionality reduction processing on the object data in any of the second clusters to obtain dimensionality-reduced object data; and to perform outlier detection processing on the dimensionality-reduced object data to obtain outlier detection results for the object data in any of the second clusters.
[0018] In one possible implementation, the update module is configured to determine a cross-tabulation based on the plurality of first clusters and the plurality of second clusters, wherein a row of data in the cross-tabulation represents the object data in a first cluster and a column of data in the cross-tabulation represents the object data in a second cluster; and determine the first cluster corresponding to any one of the second clusters from the plurality of first clusters based on the cross-tabulation.
[0019] In one possible implementation, the cross-tab includes multiple non-zero data, wherein the non-zero data represents the number of identical object data contained in the first cluster corresponding to the row containing the non-zero data and the second cluster corresponding to the column containing the non-zero data. The update module is used to determine the largest non-zero data from the non-zero data contained in the column corresponding to any second cluster in the cross table; and to determine the first cluster corresponding to the row containing the largest non-zero data as the first cluster corresponding to any second cluster.
[0020] In one possible implementation, the object data is the gene expression matrix of cells, the clustering result corresponding to the first cluster set is obtained by clustering the gene expression matrices of multiple cells based on the Leiden algorithm, and the clustering result corresponding to the second cluster set is obtained by clustering the gene expression matrices of the multiple cells based on the deep embedding single-cell clustering algorithm.
[0021] On the other hand, embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores at least one piece of program code, which is loaded and executed by the processor to enable the electronic device to implement any of the clustering processing methods described above.
[0022] On the other hand, a computer-readable storage medium is also provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the at least one piece of program code being loaded and executed by a processor to enable a computer to implement any of the clustering processing methods described above.
[0023] On the other hand, a computer program or computer program product is also provided, wherein the computer program or computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement any of the above-mentioned clustering processing methods.
[0024] The technical solution provided in this application has at least the following beneficial effects: In the technical solution provided in this application embodiment, at least one of the first cluster set and the second cluster set is a target cluster set. The target cluster set is obtained by updating the clustering results corresponding to the target cluster set at least once, thereby updating the clustering results corresponding to the target cluster set. Then, the first cluster set is updated based on the second cluster set to obtain a third cluster set. When the target condition is met, the third cluster set is used as the target clustering result. Furthermore, the clustering results corresponding to different cluster sets are obtained by clustering multiple object data based on different clustering algorithms. This achieves the improvement of the accuracy of the clustering results by merging the first and second clustering algorithms through multiple updates. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of the implementation environment of a clustering processing method provided in an embodiment of this application; Figure 2 This is a flowchart of a clustering processing method provided in an embodiment of this application; Figure 3 This is a clustering diagram of the Leiden algorithm provided in an embodiment of this application; Figure 4 This is a clustering diagram of a deep embedded single-cell clustering algorithm provided in an embodiment of this application; Figure 5 This is a flowchart of a cell data clustering processing method provided in an embodiment of this application; Figure 6 This is a schematic diagram of a dataset and clustering evaluation index provided in an embodiment of this application; Figure 7 This is a schematic diagram of a clustering evaluation index corresponding to a different method provided in the embodiments of this application; Figure 8 This is a schematic diagram of the clustering results of a macaque cell dataset provided in an embodiment of this application; Figure 9 This is a schematic diagram of the clustering results of a single-nucleus cell dataset provided in an embodiment of this application; Figure 10 This is a schematic diagram of the clustering results of a mouse cell dataset provided in an embodiment of this application; Figure 11 This is a schematic diagram of the clustering results of a pancreatic islet cell dataset provided in an embodiment of this application; Figure 12 This is a schematic diagram of the structure of a clustering processing device provided in an embodiment of this application; Figure 13 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application; Figure 14 This is a schematic diagram of the structure of a server provided in an embodiment of this application; Figure 15 This is a schematic diagram of the clustering results of a macaque cell dataset corresponding to the Leiden algorithm provided in an embodiment of this application; Figure 16 This is a schematic diagram of the clustering results of a macaque cell dataset corresponding to the DESC algorithm provided in an embodiment of this application; Figure 17 This is a schematic diagram of the clustering results of a macaque cell dataset corresponding to a method provided in this embodiment of the application; Figure 18 This is a schematic diagram of the clustering results of a macaque cell dataset corresponding to the SAFE method provided in this application embodiment; Figure 19 This is a schematic diagram of the actual clustering results of a macaque cell dataset provided in an embodiment of this application; Figure 20 This is a schematic diagram of the clustering results of a single-nucleus cell dataset corresponding to the Leiden algorithm provided in an embodiment of this application; Figure 21 This is a schematic diagram of the clustering results of a single-nucleus cell dataset corresponding to the DESC algorithm provided in an embodiment of this application; Figure 22 This is a schematic diagram of the clustering results of a single-nucleus cell dataset corresponding to a method provided in this embodiment of the application; Figure 23 This is a schematic diagram of the clustering results of a single-nucleus cell dataset corresponding to the SAFE method provided in this application embodiment; Figure 24 This is a schematic diagram of the actual clustering results of a single-nucleus cell dataset provided in an embodiment of this application; Figure 25 This is a schematic diagram of the clustering results of a mouse cell dataset corresponding to the Leiden algorithm provided in an embodiment of this application; Figure 26 This is a schematic diagram of the clustering results of a mouse cell dataset corresponding to the DESC algorithm provided in an embodiment of this application; Figure 27 This is a schematic diagram of the clustering results of a mouse cell dataset corresponding to a method provided in this embodiment of the application; Figure 28 This is a schematic diagram of the clustering results of a mouse cell dataset corresponding to the SAFE method provided in this application embodiment; Figure 29 This is a schematic diagram of the actual clustering results of a mouse cell dataset provided in an embodiment of this application; Figure 30 This is a schematic diagram of the clustering results of a pancreatic islet cell dataset corresponding to the Leiden algorithm provided in an embodiment of this application; Figure 31 This is a schematic diagram of the clustering results of a pancreatic islet cell dataset corresponding to a DESC algorithm provided in an embodiment of this application; Figure 32 This is a schematic diagram of the clustering results of a pancreatic islet cell dataset corresponding to a method provided in this embodiment of the application; Figure 33 This is a schematic diagram of the clustering results of a pancreatic islet cell dataset corresponding to the SAFE method provided in this application embodiment; Figure 34 This is a schematic diagram of the actual clustering results of a pancreatic islet cell dataset provided in an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0028] Figure 1 This is a schematic diagram illustrating the implementation environment of a clustering processing method provided in an embodiment of this application, such as... Figure 1 The implementation environment shown includes an electronic device 11, and the clustering processing method in this embodiment can be executed by the electronic device 11. Exemplarily, the electronic device 11 may include at least one of a terminal device or a server.
[0029] The terminal device can be at least one of a smartphone, game console, desktop computer, tablet computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, and laptop computer.
[0030] The server can be a single server, a server cluster consisting of multiple servers, or any of the following: a cloud computing platform or a virtualization center. This application embodiment does not limit this. The server can communicate with terminal devices via a wired or wireless network. The server can have functions such as data processing, data storage, and data transmission and reception, which are not limited in this application embodiment.
[0031] The clustering method provided in this application is based on artificial intelligence (AI) technology. AI is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making functions.
[0032] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.
[0033] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, smart customer service, vehicle networking, and intelligent transportation. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.
[0034] Based on the above implementation environment, this application provides a clustering processing method to... Figure 2 The flowchart shown in this embodiment of the application illustrates a clustering processing method. This method can be implemented by... Figure 1 The electronic device 11 in the middle performs the operation. For example... Figure 2 As shown, the method includes steps 201-203.
[0035] Step 201: Obtain the first cluster set and the second cluster set. The target cluster set in the first cluster set and the second cluster set is obtained by updating the clustering result corresponding to the target cluster set at least once. The target cluster set is at least one of the first cluster set and the second cluster set. The clustering result corresponding to different cluster sets is obtained by clustering multiple object data based on different clustering algorithms.
[0036] In this embodiment, the clustering result corresponding to the first cluster set is obtained by clustering multiple object data using a first clustering algorithm, and the clustering result corresponding to the second cluster set is obtained by clustering multiple object data using a second clustering algorithm. The first cluster set includes multiple first clusters, and the second cluster set includes multiple second clusters.
[0037] This application does not limit the first clustering algorithm or the object data. For example, the first clustering algorithm includes, but is not limited to, the Leiden algorithm, the Louvain algorithm, the state-of-the-art algorithm based on deep learning feature representation, the K-means clustering algorithm, and the Deep Embedding For Single-cell Clustering (DESC) algorithm. The object data includes, but is not limited to, cell data, point cloud data, video data, and music data.
[0038] In this embodiment of the application, multiple object data are clustered using a first clustering algorithm to obtain a first clustering result. This first clustering result includes multiple clusters, and each cluster includes at least one object data. The first clustering result is used as multiple first clusters, or the first clustering result is updated at least once, and the updated first clustering result is used as multiple first clusters.
[0039] This application does not limit the method of updating the first clustering result in this embodiment. For example, the first clustering result is updated through step 202 in this embodiment, and details can be found in the relevant description of step 202.
[0040] Among them, multiple second clusters are obtained from the second clustering results or by updating the second clustering results at least once. The second clustering results are obtained by clustering multiple object data based on the second clustering algorithm.
[0041] This application does not limit the second clustering algorithm. For example, the second clustering algorithm includes, but is not limited to, the Leiden algorithm, the Louvain algorithm, the SOTA algorithm based on deep learning feature representation, the K-means clustering algorithm, and the DESC algorithm. The second clustering algorithm is a different clustering algorithm from the first clustering algorithm.
[0042] In this embodiment of the application, a second clustering algorithm is used to cluster multiple object data to obtain a second clustering result. This second clustering result includes multiple clusters, and each cluster includes at least one object data. The second clustering result is used as multiple second clusters, or the second clustering result is updated at least once, and the updated second clustering result is used as multiple second clusters.
[0043] This application does not limit the method of updating the second clustering result in this embodiment. For example, the second clustering result is updated through step 202 in this embodiment, and details can be found in the relevant description of step 202.
[0044] It should be noted that the target cluster set is at least one of the first cluster set and the second cluster set, and the target cluster set is obtained by updating the clustering results corresponding to the target cluster set at least once. That is, when the target cluster set is only the first cluster set, the first cluster set is obtained by updating the first clustering result at least once, and the second cluster set is the second clustering result; when the target cluster set is only the second cluster set, the first cluster set is the first clustering result, and the second cluster set is obtained by updating the second clustering result at least once; when the target cluster set is both the first and second cluster sets, the first cluster set is obtained by updating the first clustering result at least once, and the second cluster set is obtained by updating the second clustering result at least once.
[0045] Optionally, the object data is the gene expression matrix of cells. The clustering result corresponding to the first cluster set is obtained by clustering the gene expression matrices of multiple cells based on the Leiden algorithm, and the clustering result corresponding to the second cluster set is obtained by clustering the gene expression matrices of multiple cells based on the deep embedding single-cell clustering algorithm.
[0046] In this embodiment, the object is a cell, and the object data (i.e., cell data) is the cell's gene expression matrix. The Leiden algorithm and the deep embedding single-cell clustering algorithm are used to cluster multiple cell data sets, respectively, to obtain a first clustering result and a second clustering result. The Leiden algorithm (see implementation A1) and the deep embedding single-cell clustering algorithm (see implementation A2) will be described below.
[0047] Implementation method A1 uses the Leiden algorithm to cluster multiple cell datasets. The Leiden algorithm obtains the first clustering result through multiple stages of clustering. Each stage of clustering includes moving cell processing and refining processing. Moving cell processing is the initial clustering process for multiple cell datasets, resulting in multiple original clusters for that stage. Each original cluster contains at least one cell dataset. Refining processing is the process of further clustering the multiple original clusters for that stage, resulting in multiple updated clusters for that stage. Each updated cluster contains at least one cell dataset.
[0048] Please see Figure 3 , Figure 3 This is a clustering diagram of the Leiden algorithm provided in an embodiment of this application, wherein, Figure 3 Only two stages of clustering processing are shown, namely Stage 1 and Stage 2. First, for every two cell data points in the multiple cell dataset, the weights between each pair of cell data points are determined, resulting in... Figure 3 As shown in (1), (1) includes multiple cell data and the weights between every two cell data.
[0049] For stage one, cell moving processing is performed on (1) to perform preliminary clustering of multiple cell data, resulting in multiple original clusters corresponding to stage one, such as Figure 3 As shown in (2). In (2), cell data of the same color represent cell data in the same original cluster, and cell data of different colors represent cell data in different original clusters. Then, (2) is refined to re-cluster the cell data in the same original cluster, resulting in multiple updated original clusters, such as Figure 3 As shown in (3), one of the original clusters in (3) contains cell data of different colors, indicating that during the refinement process, the original cluster in (2) was split into at least two clusters in (3). Then, a second-stage clustering process is performed based on the clustering results shown in (3).
[0050] Regarding Phase Two, such as Figure 3As shown in (4), (4) includes five clusters, which are the updated original clusters corresponding to stage one, i.e., the clustering results shown in (3). The lines connecting the clusters represent the weights between them. (4) is processed by moving cells to perform preliminary clustering on multiple cell data, resulting in multiple original clusters corresponding to stage two, such as... Figure 3 As shown in (5). In (5), clusters of the same color represent the same original cluster, and clusters of different colors represent different original clusters. Then, (5) is refined to re-cluster the cell data within the same original cluster, resulting in multiple updated original clusters, such as... Figure 3 As shown in (6). If one of the original clusters in (6) includes at least two clusters of the same color, it means that the original cluster was not grouped with other original clusters during the refining process. Then, the next stage (i.e., stage three) of clustering is performed based on the clustering results shown in (6), or the clustering results shown in (6) are used as the first clustering result.
[0051] As can be seen from the above description of the Leiden algorithm, in each stage of clustering, the Leiden algorithm first performs a cell-moving process to initially cluster all cell data, and then performs a refinement process to cluster all cell data again. Therefore, the Leiden algorithm can achieve global clustering of cell data and is a global clustering algorithm.
[0052] Implementation method A2 uses the DESC algorithm to cluster multiple cell datasets. DESC is a state-of-the-art (SOTA) algorithm based on deep learning feature representation. The DESC algorithm inputs each cell dataset into an autoencoder, which encodes the gene expression features of each cell. Based on these gene expression features, each cell dataset is assigned to a cluster, the probability of belonging to that cluster, and the batch number. Specifically, the DESC algorithm determines the cluster with the highest probability by identifying the probability of a cell belonging to a given cluster. The batch number represents the sampling batch of the cell dataset.
[0053] like Figure 4 As shown, Figure 4This is a schematic diagram of a clustering algorithm for the DESC algorithm provided in an embodiment of this application. First, the gene expression matrix of each cell is input to an autoencoder, which encodes the gene expression matrix of each cell to obtain the gene expression features of each cell. Then, clustering is performed based on the gene expression features of each cell to obtain the clustering results. When implementing the DESC algorithm based on a model, the model parameters are optimized based on the clustering results and a loss function to update the model. Using the updated model and the gene expression features of each cell, clustering is performed on the cell data to obtain the clustering results. The loss function is not limited.
[0054] Optionally, the loss function is Figure 4 The expression Loss = KL(P||Q) is shown, where Loss is the loss function, KL represents the KL divergence (Kullback-Leibler Divergence), also called relative entropy, P is the true probability distribution (i.e., the probability that cell data belongs to each cluster), and Q is the pseudo-distribution of P.
[0055] It should be noted that the model's output information includes, but is not limited to, clustering results. For example... Figure 4 As shown, the output information includes three parts. The first part is the clusters (i.e., the clustering results). Clusters numbered 0-5 represent 6 clusters, and each cluster contains at least one cell data point. In other words, each cluster is the cluster to which a given cell data point belongs. The second part is the probability of each cell data point. By determining the probability of a cell data point belonging to each cluster, the maximum probability of that cell data point is determined, and thus the probability of a cell data point within a cluster is determined by this maximum probability. The third part is the batch of cell data. Each cluster contains at least one batch of cell data.
[0056] As can be seen from the above description of the DESC algorithm, the DESC algorithm determines the clustering result of the gene expression matrix of a cell (i.e., cell data) based on the gene expression matrix of a cell. In this way, the clustering result of each cell data is determined, which has a strong clustering ability for individual samples and is a local clustering processing algorithm.
[0057] Step 202: Update the first cluster set based on the second cluster set to obtain the third cluster set.
[0058] In this embodiment, the third cluster set includes multiple third clusters. Each object data corresponds to one first cluster and one second cluster. Based on the correspondence between object data and the first and second clusters, multiple first clusters are updated based on multiple second clusters to obtain multiple third clusters.
[0059] One approach is to use the Coefficient of Variation (CV) technique to update multiple first clusters based on multiple second clusters; see implementation method B1 for details. Alternatively, outlier detection (OD) techniques can be used to update multiple first clusters based on multiple second clusters; see implementation method B2 for details.
[0060] Implementation method B1: The first cluster set includes multiple first clusters, the second cluster set includes multiple second clusters, and the third cluster set includes multiple third clusters. The first cluster set is updated based on the second cluster set to obtain the third cluster set. This includes: for any second cluster, determining the coefficient of variation of any second cluster based on the first cluster to which each object data belongs; the coefficient of variation of any second cluster is used to characterize the dispersion of each object data within the second cluster; and updating the multiple first clusters based on the coefficients of variation of each second cluster to obtain the multiple third clusters.
[0061] The coefficient of variation (CV), also known as the coefficient of dispersion, is a normalized measure of the dispersion of data distribution. Optionally, for any given second cluster, the first cluster corresponding to each object data point in that second cluster is counted, yielding the non-zero data points corresponding to that second cluster. Each non-zero data point represents the number of object data points in the second cluster corresponding to the first cluster.
[0062] For example, if a second cluster contains ten object data, of which 5 object data correspond to the first cluster 1, 2 object data correspond to the first cluster 2, and 3 object data correspond to the first cluster 3, then the second cluster has three non-zero data, namely 5, 2, and 3.
[0063] For any given second cluster among multiple second clusters, the standard deviation and mean of the second cluster are calculated based on each non-zero data point corresponding to that second cluster. The coefficient of variation of the second cluster is then determined based on its standard deviation and mean. In this way, the coefficient of variation of each second cluster can be calculated. The coefficient of variation of any given second cluster can be expressed by the formula shown below.
[0064]
[0065] in, Let be the coefficient of variation for any second cluster. Let be the standard deviation of any second cluster. is the average value of any second cluster.
[0066] It should be noted that for any second cluster, the number of data points in the second cluster corresponding to a first cluster may be non-zero or zero. When calculating the coefficient of variation of the second cluster, the sum of the number of non-zero data points and the number of zero data points is first calculated to obtain the number of data points in the second cluster. For example, if the second cluster has three non-zero data points and four zero data points, then the number of data points in the second cluster is 7. Then, based on the ratio of the sum of the non-zero data points in the second cluster to the number of data points in the second cluster, the average value of the second cluster is obtained. For example, if the sum of the three non-zero data points in the second cluster is 10, and the number of data points in the second cluster is 7, then the average value of the second cluster is 10 / 7.
[0067] Next, for any non-zero data point corresponding to the second cluster, first subtract the average value of the column from the non-zero data point to obtain the difference corresponding to the non-zero data point, then calculate the square of the difference corresponding to the non-zero data point. In this way, obtain the square of the difference corresponding to each non-zero data point corresponding to the second cluster. Calculate the sum of the squares of the differences corresponding to each non-zero data point, divide the sum of the squares by the number of data points in the second cluster, and take the square root of the result to obtain the standard deviation of the second cluster.
[0068] For example, one second cluster corresponds to a set of data: Each data point in this set represents the number of object data points in the second cluster corresponding to a first cluster. Based on this data set, the standard deviation of the second cluster can be calculated. The average value of the second cluster is The coefficient of variation of the second cluster is .
[0069] After obtaining the coefficient of variation of each second cluster, the first clusters are updated based on the coefficient of variation of each second cluster to obtain multiple third clusters.
[0070] Optionally, multiple first clusters are updated based on the coefficient of variation of each second cluster to obtain multiple third clusters, including: for any second cluster, in response to the coefficient of variation of any second cluster being greater than the target coefficient of variation, determining the first cluster corresponding to any second cluster from the multiple first clusters; determining the first cluster corresponding to any second cluster as a third cluster; and adding object data in any second cluster that does not belong to a third cluster to a third cluster.
[0071] This application does not limit the value of the target coefficient of variation. For example, the target coefficient of variation is set to 2 based on human experience.
[0072] For example, if the coefficient of variation of a second cluster is Target coefficient of variation Since 4.33 is greater than 2, it is necessary to determine the first cluster corresponding to the second cluster from multiple first clusters, determine the first cluster corresponding to the second cluster as a third cluster, and add the object data in the second cluster that does not belong to a third cluster to a third cluster.
[0073] In this embodiment of the application, for any second cluster, when the coefficient of variation of any second cluster is greater than the target coefficient of variation, the first cluster corresponding to any second cluster is determined from multiple first clusters.
[0074] Optionally, determining the first cluster corresponding to any second cluster from multiple first clusters includes: determining a cross-tabulation based on multiple first clusters and multiple second clusters, where a row of data in the cross-tabulation represents the data of each object in a first cluster, and a column of data in the cross-tabulation represents the data of each object in a second cluster; and determining the first cluster corresponding to any second cluster from multiple first clusters based on the cross-tabulation.
[0075] A cross table is a categorized summary table that includes several rows and several columns. In this embodiment, a cross table is determined based on multiple first clusters and multiple second clusters, where each row of the cross table corresponds to a first cluster and each column corresponds to a second cluster.
[0076] Optionally, a first cluster corresponds to a first cluster identifier, a second cluster corresponds to a second cluster identifier, and an object data includes an object identifier; determining a cross-tabulation based on multiple first clusters and multiple second clusters includes: determining the object identifier corresponding to each cluster identifier set based on the first cluster identifier of each first cluster, the object identifier of each object data contained in each first cluster, the second cluster identifier of each second cluster, and the object identifier of each object data contained in each second cluster, wherein a cluster identifier set includes one first cluster identifier and one second cluster identifier; and determining the cross-tabulation based on the number of object identifiers corresponding to each cluster identifier set.
[0077] The first cluster identifier and the second cluster identifier are both including, but not limited to, at least one of numbers, characters, symbols, etc. The object identifier of the object data is including, but not limited to, at least one of numbers, characters, symbols, etc. The first cluster identifier, the second cluster identifier, and the object identifier of the object data can be the same, different, or any two of the three can be the same, without any limitation.
[0078] For example, the first cluster identifier includes the numbers 0 to 11, the second cluster identifier includes the numbers 0 to 9, and the object identifier of the object data consists of the character S and numbers, including S1 to SN, where N is a positive integer greater than 1.
[0079] In this embodiment, the object identifier of an object data is unique and used to identify the object data. One object data corresponds to one first cluster and one second cluster. As shown in Tables 1 and 2 below, Table 1 is a correspondence table between the first cluster identifier and the object identifier of the object data provided in this embodiment, and Table 2 is a correspondence table between the second cluster identifier and the object identifier of the object data provided in this embodiment.
[0080] Table 1
[0081] Table 2
[0082] As shown in Tables 1 and 2, the object identifiers of the N object data are S1, S2, S3, S4...SN, where N is a positive integer. When clustering the N object data into multiple first clusters, object identifier S1 corresponds to first cluster identifier 1, object identifier S2 corresponds to first cluster identifier 0, object identifier S3 corresponds to first cluster identifier 10, object identifier S4 corresponds to first cluster identifier 10, and object identifier SN corresponds to first cluster identifier 8. Similarly, when clustering the N object data into multiple second clusters, object identifier S1 corresponds to second cluster identifier 9, object identifier S2 corresponds to second cluster identifier 0, object identifier S3 corresponds to second cluster identifier 0, object identifier S4 corresponds to second cluster identifier 3, and object identifier SN corresponds to second cluster identifier 5.
[0083] In this embodiment, based on the correspondence between each first cluster identifier and the object identifier of each object data, and the correspondence between each second cluster identifier and the object identifier of each object data, the object identifiers corresponding to each set of cluster identifiers for each object data are determined. The object identifiers of each object data corresponding to a set of cluster identifiers are the object identifiers of the same object data corresponding to the first and second cluster identifiers in that set; that is, the same object identifiers corresponding to the first and second cluster identifiers in that set. Then, based on the number of object identifiers corresponding to each object data for each set of cluster identifiers, a cross-tabulation is determined.
[0084] For example, based on Tables 1 and 2, it can be determined that there are 8389 object identifiers corresponding to the cluster identifier set {1, 1}, 4034 object identifiers corresponding to the cluster identifier set {1, 2}, and 1 object identifier corresponding to the cluster identifier set {1, 3}, etc., where 'a' in the cluster identifier set {a, b} is the first cluster identifier and 'b' is the second cluster identifier. The number of object identifiers corresponding to each cluster identifier set can be used to determine the cross-tabulation shown in Table 3. Table 3 is a schematic diagram of a cross-tabulation provided in an embodiment of this application.
[0085] Table 3
[0086] In the cross-tabulation table shown in Table 3, each row corresponds to a first cluster, with cluster identifiers ranging from 0 to 11, totaling 12 first clusters. Each column corresponds to a second cluster, with cluster identifiers ranging from 0 to 9, totaling ten second clusters. Table 3 shows that for the object data in cluster identifier 2 obtained after clustering multiple object data using the second clustering algorithm, when clustering multiple object data using the first clustering algorithm, the object data in cluster identifier 2 is scattered across cluster identifiers 1, 4, 5, and 10.
[0087] In this embodiment, a first cluster corresponding to each second cluster is determined from multiple first clusters based on a cross-tabulation. The cross-tabulation includes multiple non-zero data points, where each non-zero data point represents the number of identical object data points contained in the first cluster corresponding to the row containing the non-zero data and the second cluster corresponding to the column containing the non-zero data. Determining the first cluster corresponding to any second cluster from multiple first clusters based on the cross-tabulation includes: determining the largest non-zero data point from the non-zero data points contained in the column corresponding to any second cluster in the cross-tabulation; and determining the first cluster corresponding to the row containing the largest non-zero data point as the first cluster corresponding to any second cluster.
[0088] Any data in the cross-tabulation is either a target character or a non-zero data. In the embodiments of this application and the following embodiments, the target character is 0, an empty character (i.e., empty), or a special character (such as the symbol '&', the string 'None', etc.). Any non-zero data in the cross-tabulation represents the number of identical object data contained in the first cluster corresponding to the row where the data is located and the second cluster corresponding to the column where the data is located.
[0089] For any second cluster, the second cluster corresponds to a column of data in the cross-tabulation. From the non-zero data contained in the column corresponding to the second cluster in the cross-tabulation, the largest non-zero data is determined, and the first cluster corresponding to the row containing the largest non-zero data is determined as the first cluster corresponding to the second cluster.
[0090] In this embodiment of the application, the second cluster can be used as the auxiliary cluster result (ACR), and the first cluster can be used as the main cluster result (MCR). The main cluster result and the auxiliary cluster result satisfy the following formula.
[0091]
[0092] in, Let M be the number of columns, i.e., one second cluster. Assuming the cluster identifiers of the second clusters are from 0 to M (M is a positive integer), then the number of second clusters is M+1. The value of can be any number from 0 to M, as shown in Table 3. The value ranges from 0 to 9. For the first The first cluster corresponding to the row containing the largest non-zero data in the column, i.e., the first... The column corresponds to a clustering cluster (CM), which is the first cluster. INDEX is a function that returns the values in a table. For the first Each non-zero data in the column, For the first The largest non-zero data in the column.
[0093] For example, as shown in Table 4 below, Table 4 is the fourth column of Table 3 (i.e. the column with the second cluster identifier 2).
[0094] Table 4
[0095] Since the largest non-zero value in the column corresponding to the second cluster identifier 2 is 4034, and the row containing 4034 corresponds to the first cluster identifier 1, therefore... That is, the first cluster identifier 1 of the first cluster corresponding to the row containing the largest non-zero data in the second column. In other words, the second cluster identifier 2 (corresponding to a second cluster) corresponds to the first cluster identifier 1 (corresponding to a first cluster).
[0096] Based on the above principles, we can determine the following from Table 3: , , , , , , , , , .
[0097] After determining the first cluster corresponding to any second cluster, the first cluster corresponding to any second cluster is designated as a third cluster, and each object data in any second cluster belongs to this third cluster. Specifically, for any object data in a second cluster, if the object data belongs to the third cluster, the correspondence between the object data and the third cluster remains unchanged; if the object data does not belong to the third cluster, the object data is added to the third cluster to ensure that the object data corresponds to the third cluster.
[0098] For example, object data S15 corresponds to the first cluster identifier 7 and the second cluster identifier 2. Since the second cluster identifier 2 corresponds to the first cluster identifier 1, the first cluster corresponding to the first cluster identifier 1 is determined to be a third cluster. Object data S15 is then added to this third cluster, making object data S15 belong to this third cluster. In this way, the first cluster corresponding to each second cluster is determined to be a third cluster, and each piece of first object data in each second cluster belongs to the third cluster corresponding to that second cluster.
[0099] Optionally, multiple first clusters are updated based on the coefficient of variation of each second cluster to obtain multiple third clusters, including: for any second cluster, in response to the fact that the coefficient of variation of any second cluster is not greater than the target coefficient of variation, the first cluster to which each object data in any second cluster belongs is determined as the third cluster.
[0100] In this embodiment of the application, for any second cluster, when the coefficient of variation of the second cluster is not greater than the target coefficient of variation, for any object data in the second cluster, the first cluster corresponding to the object data is a third cluster.
[0101] For example, if the coefficient of variation of a second cluster is Target coefficient of variation Since 1.89 is not greater than 2, the first cluster 2 corresponding to one object data in the second cluster is a third cluster, and the first cluster 9 corresponding to another object data in the second cluster is also a third cluster.
[0102] In another possible implementation, the first cluster set includes multiple first clusters, the second cluster set includes multiple second clusters, and the third cluster set includes multiple third clusters. The first cluster set is updated based on the second cluster set to obtain the third cluster set, including: for any second cluster, outlier detection is performed on each object data within that second cluster to obtain outlier detection results for each object data within that second cluster; and the multiple first clusters are updated based on the outlier detection results for each object data within each second cluster to obtain multiple third clusters.
[0103] In this embodiment, an outlier detection (OD) algorithm is used to perform outlier detection processing on multiple object data sets, resulting in outlier detection results for each object data set. The outlier detection result for any object data set is either an outlier object data set or a non-outlier object data set. This embodiment does not limit the outlier detection algorithm used.
[0104] For example, outlier detection algorithms are based on Copula-based outlier detection (COPOD) algorithms. Copula is a statistical probability function used to model multidimensional cumulative distributions and also to model dependencies between multiple random variables (RVs).
[0105] In this embodiment, PyOD (a library for detecting outliers in data) of Python (a computer programming language) provides various outlier detection algorithms, including the COPOD algorithm. The COPOD algorithm has three advantages. The first advantage is that it does not require distance calculation between samples, resulting in fast execution. The second advantage is that it does not require parameter tuning and can be directly called. The third advantage is that its outlier detection performance is significantly better than other outlier detection algorithms.
[0106] Because the COPOD algorithm has the above three advantages, the embodiments of this application adopt the COPOD algorithm, which can conveniently and quickly perform outlier detection processing on multiple object data, and the outlier detection results of each object data are highly accurate.
[0107] In this embodiment of the application, when performing outlier detection processing on multiple object data, outlier detection processing can be performed on multiple original object data. For example, if the original object data is the gene expression matrix of cells, then outlier detection processing can be performed on the gene expression matrices of multiple cells.
[0108] Because the original object data has a high dimensionality, outlier detection is slow. Therefore, the original object data can be processed to improve the speed of outlier detection. Optionally, outlier detection processing can be performed on multiple object datasets to obtain outlier detection results for each object dataset. This includes: performing dimensionality reduction processing on each object dataset to obtain dimensionality-reduced object datasets; and performing outlier detection processing on each dimensionality-reduced object dataset to obtain outlier detection results for each object dataset.
[0109] For any given object data, dimensionality reduction is performed to decrease its size and volume, resulting in dimensionality-reduced object data. This process is repeated to obtain various dimensionality-reduced object data sets. Then, an outlier detection algorithm is used to detect outliers in each of these sets, yielding the outlier detection results. The outlier detection result for any given dimensionality-reduced object data set is the outlier detection result for the corresponding object data set.
[0110] It is understood that there are multiple ways to perform dimensionality reduction on any object data, and the embodiments of this application do not limit the dimensionality reduction method of object data.
[0111] Optionally, Principal Component Analysis (PCA) can be used to reduce the dimensionality of any object data to obtain dimensionality-reduced object data. For example, PCA can be used to reduce the dimensionality of the gene expression matrix of cells (which typically includes 20,000 to 30,000 data points) to 50 data points.
[0112] Optionally, dimensionality reduction can be performed on any object data using neural network technology to obtain dimensionality-reduced object data. For example, dimensionality reduction can be performed on the gene expression matrix of cells using a feature extraction network, reducing the amount of data from the original 20,000 to 30,000 data points to 32 data points.
[0113] In this embodiment of the application, after determining the outlier detection results of each object data in any second cluster, the multiple first clusters are updated based on the outlier detection results of each object data in each second cluster to obtain multiple third clusters.
[0114] Optionally, multiple first clusters are updated based on the outlier detection results of each object data in each second cluster to obtain multiple third clusters, including: for any second cluster, in response to the existence of first object data in each object data in any second cluster, the first cluster corresponding to any second cluster is determined from the multiple first clusters, and the outlier detection result of the first object data is non-outlier object data; the first cluster corresponding to any second cluster is determined as a third cluster; in response to the first object data not belonging to a third cluster, the first object data is added to a third cluster.
[0115] For any one of the multiple second clusters, if there is a first object data whose outlier detection result is not an outlier object data among the object data in each of the multiple first clusters, then the first cluster corresponding to the second cluster is determined from the multiple first clusters. Since the method of determining the first cluster corresponding to any one of the multiple second clusters from the multiple first clusters has been described above, it will not be repeated in the embodiments of this application.
[0116] After determining the first cluster corresponding to any second cluster, the first cluster corresponding to any second cluster is designated as a third cluster, and each first object data in any second cluster belongs to this third cluster. Specifically, for any first object data in a second cluster, if the first object data belongs to the third cluster, the correspondence between the first object data and the third cluster remains unchanged; if the first object data does not belong to the third cluster, the first object data is added to the third cluster so that the first object data corresponds to the third cluster.
[0117] Optionally, multiple first clusters are updated based on the outlier detection results of each object data in each second cluster to obtain multiple third clusters, including: for any second cluster, in response to the existence of second object data in each object data in any second cluster, the first cluster to which a second object data belongs is determined as a third cluster, and the outlier detection result of the second object data is the outlier object data.
[0118] In this embodiment of the application, for any second cluster, if there is a second object data in each object data of the second cluster that has an outlier detection result, then for any second object data in the second cluster, the first cluster corresponding to the second object data is a third cluster.
[0119] It should be noted that when updating the first clustering result, the first clustering result can be updated based on the second clustering result, and vice versa. For details, please refer to the description of step 202. The implementation principles of the two are similar and will not be repeated here.
[0120] Step 203: In response to meeting the target conditions, the third cluster set is taken as the target clustering result.
[0121] The embodiments of this application do not limit the target conditions.
[0122] Optionally, in response to satisfying the target condition, the third cluster set is taken as the target clustering result, including: in response to the third cluster set being the same as the first cluster set, the third cluster set is taken as the target clustering result.
[0123] The target condition is that the updated clusters are identical to the original clusters. In this embodiment, the updated clusters are identical to the original clusters, meaning that the multiple third clusters are identical to the multiple first clusters. When the condition that the multiple third clusters are identical to the multiple first clusters is met, the multiple third clusters are taken as the target clustering result.
[0124] Optionally, in response to meeting the target condition, the third cluster set is taken as the target clustering result, including: in response to the current update count reaching the target count, the third cluster set is taken as the target clustering result.
[0125] When multiple first clusters are the first clustering result, the first update count is 0. When multiple first clusters are the result of at least one update (denoted as N times, where N is a positive integer), the first update count is N. Since multiple first clusters were updated based on multiple second clusters in step 202, the first update count is incremented by 1 to obtain the second update count. The second update count is the current update count.
[0126] In this embodiment, the target condition is reaching a target number of updates. If the second update count reaches the target number, i.e., the second update count equals the target number, then multiple third clusters are used as the target clustering result. This embodiment does not limit the value of the target number of updates; for example, the target number is 10.
[0127] It should be noted that the target conditions can be other conditions besides the updated clusters being the same as the original clusters and the number of times the target is reached.
[0128] For example, a clustering evaluation index can be calculated based on multiple third clusters. This index is used to characterize the accuracy of the clustering results. When the clustering evaluation index reaches the target index, the multiple third clusters are taken as the target clustering result. In other words, the target condition can be that the clustering evaluation index obtained from multiple third clusters reaches the target index.
[0129] The embodiments of this application do not limit the calculation method of clustering evaluation indicators. Optionally, clustering evaluation indicators may include, but are not limited to, the Adjusted Rand Index (ARI) and Normalized Mutual Information (NMI).
[0130] This application does not limit the specific value of the target indicator. For example, the value of the target indicator is 0.95.
[0131] In one possible implementation, after updating the first cluster set based on the second cluster set to obtain the third cluster set, the method further includes: in response to not meeting the target condition, updating the third cluster set based on the second cluster set to obtain the fourth cluster set; and in response to meeting the target condition, using the fourth cluster set as the target clustering result.
[0132] In this embodiment, the fourth cluster set includes multiple fourth clusters. When the target condition is not met, multiple third clusters are updated based on multiple second clusters. Specifically, techniques related to the coefficient of variation can be used to update multiple third clusters based on multiple second clusters (see implementation B1 for details), or outlier detection techniques can be used to update multiple third clusters based on multiple second clusters (see implementation B2 for details). The implementation principles of both are similar and will not be elaborated further here.
[0133] After updating multiple third clusters based on multiple second clusters, multiple fourth clusters are obtained. If a fourth cluster satisfies the target condition (i.e., multiple fourth clusters are identical to multiple third clusters, or the third update count is obtained based on the second update count and reaches the target count), then the multiple fourth clusters are used as the target clustering result. If a fourth cluster does not satisfy the target condition, the multiple fourth clusters are updated based on multiple second clusters until the target condition is met, resulting in the target clustering result.
[0134] Optionally, updating the third cluster set based on the second cluster set to obtain the fourth cluster set includes: updating the second cluster set based on the first cluster set to obtain the fifth cluster set; and updating the third cluster set based on the fifth cluster set to obtain the fourth cluster set.
[0135] In this embodiment, the fifth cluster set includes multiple fifth clusters. When updating multiple third clusters based on multiple second clusters, the multiple second clusters are first updated based on multiple first clusters to obtain multiple fifth clusters. Specifically, techniques related to the coefficient of variation can be used to update multiple second clusters based on multiple first clusters (see implementation B1 for details), or outlier detection techniques can be used to update multiple second clusters based on multiple first clusters (see implementation B2 for details). The implementation principles of both are similar and will not be elaborated further here.
[0136] Subsequently, multiple third clusters are updated based on multiple fifth clusters to obtain multiple fourth clusters. This can be achieved using techniques related to the coefficient of variation (CV), as detailed in implementation method B1, or by using outlier detection techniques, as detailed in implementation method B2. The implementation principles of both methods are similar and will not be elaborated further here.
[0137] In this embodiment, the first cluster set is updated based on the second cluster set to obtain the third cluster set, meaning the second cluster set influences the first cluster set. Simultaneously, the second cluster set is updated based on the first cluster set to obtain the fifth cluster set, meaning the first cluster set again influences the second cluster set. Then, the third cluster set is updated based on the fifth cluster set to obtain the fourth cluster set. This process reduces the correlation between the first and second cluster sets during the update process, achieving a better fusion of the first and second cluster sets. Furthermore, since this embodiment performs at least one update according to steps 201 to 203 until the target condition is met, it achieves improved fusion of the first and second cluster sets through iterative updates, thereby improving the accuracy of the clustering results.
[0138] In the above method, at least one of the first cluster set and the second cluster set is the target cluster set. The target cluster set is obtained by updating the clustering results corresponding to the target cluster set at least once, thus updating the clustering results corresponding to the target cluster set. Then, the first cluster set is updated based on the second cluster set to obtain the third cluster set. When the target condition is met, the third cluster set is used as the target clustering result. Furthermore, the clustering results corresponding to different cluster sets are obtained by clustering multiple object data based on different clustering algorithms. This achieves the goal of improving the accuracy of the clustering results by merging the first and second clustering algorithms through multiple updates.
[0139] Taking the Leiden algorithm as the first clustering algorithm and the DESC algorithm as the second clustering algorithm as examples, the following explanation is provided. The Leiden algorithm is a global clustering algorithm capable of globally clustering cell data, but it can lead to inaccurate clustering results for local cell data. The DESC algorithm, on the other hand, is a local clustering algorithm with strong clustering capabilities for individual samples, but it does not consider the relationships between cell data, resulting in poor accuracy in the clustering results. The clustering method described in this application can determine the target clustering result based on both the Leiden and DESC algorithms, combining the advantages of the Leiden algorithm for global clustering of cell data with the strong clustering capability of the DESC algorithm for individual samples. This achieves complementarity between the Leiden and DESC algorithms, improving the accuracy of the clustering results.
[0140] The clustering processing method of this application embodiment has been described in detail above from the perspective of method steps. The following is a detailed explanation in conjunction with a scenario. The scenario of this application embodiment is a scenario where multiple cell datasets are clustered based on two different clustering algorithms. The multiple cell datasets in this application embodiment include a macaque cell dataset, a monocyte cell dataset, a mouse cell dataset, and a pancreatic islet cell dataset. Relevant information for these four cell datasets is shown in Table 5 below.
[0141] Table 5
[0142] As shown in Table 5, the rhesus monkey cell dataset includes 30,302 rhesus monkey retinal bipolar cells, with an actual clustering result of 12 clusters. The monocyte cell dataset includes 24,679 human peripheral blood mononuclear cells, with an actual clustering result of 8 clusters. The mouse cell dataset includes 13,783 mouse cerebral cortex cells, with an actual clustering result of 8 clusters. The pancreatic islet cell dataset includes 6,321 human pancreatic cancer islet cells, with an actual clustering result of 13 clusters.
[0143] For any one of the following cell datasets—macaque cell dataset, mononuclear cell dataset, mouse cell dataset, and pancreatic islet cell dataset—clustering processing can be performed on the cell dataset based on the clustering processing method of the embodiments of this application. For example... Figure 5 As shown, Figure 5 This is a flowchart of a cell data clustering processing method provided in an embodiment of this application, wherein the cell data in the cell dataset is the gene expression matrix of the cells.
[0144] First, the gene expression matrix of the cells is preprocessed. On the one hand, this preprocessing reduces the dimensionality of the gene expression matrix, yielding dimensionality-reduced object data. On the other hand, clustering is performed based on the preprocessed gene expression matrix. In this embodiment, the Leiden algorithm is used to cluster the gene expression matrices of multiple preprocessed cells, resulting in multiple first clusters. A deep embedding single-cell clustering algorithm is then used to cluster the gene expression matrices of multiple preprocessed cells, resulting in multiple second clusters.
[0145] Then, the first update process is performed. In this embodiment, a cross-tabulation is obtained based on multiple first clusters and multiple second clusters. One column of data in the cross-tabulation represents the cell data in a second cluster, and one row of data in the cross-tabulation represents the cell data in a first cluster.
[0146] In this embodiment, multiple first clusters are updated column-by-column based on multiple second clusters to obtain multiple updated first clusters. Then, it is determined whether the multiple first clusters are the same as the multiple updated first clusters. If they are the same, the multiple first clusters are used as the target clustering result. If they are not the same, the multiple second clusters are updated row-by-row based on the multiple first clusters to obtain multiple updated second clusters. Then, the multiple updated first clusters are used as the multiple first clusters for the next update process, and the multiple updated second clusters are used as the multiple second clusters for the next update process, and then a second update process is performed. The second update process is similar to the first update process; for details, please refer to the relevant description of the first update process, which will not be repeated here.
[0147] It should be noted that when updating multiple first clusters column-by-column based on multiple second clusters, correlation techniques using the coefficient of variation or outlier detection techniques can be used. Specifically, outlier detection techniques can be applied to the dimensionality-reduced object data for this column-by-column update. Similarly, when updating multiple second clusters row-by-row based on multiple first clusters, correlation techniques using the coefficient of variation or outlier detection techniques can be used. Again, outlier detection techniques can be applied to the dimensionality-reduced object data for this row-by-row update.
[0148] It should be noted that, Figure 5The clustering processing method shown is implemented in the same way as steps 201 to 203, as can be seen in the relevant descriptions of steps 201 to 203, and will not be repeated here.
[0149] In this embodiment of the application, it can be done according to Figure 5 The clustering method shown performs multiple updates on any given cell dataset and calculates a clustering evaluation metric for each update, representing the "multiple updated first clusters". This evaluation metric can be the Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), or the "proportion of identical samples before and after the update". The "proportion of identical samples before and after the update" refers to the percentage of cell data in the dataset whose first cluster remains unchanged between the updates.
[0150] like Figure 6 As shown, Figure 6 This is a schematic diagram of a dataset and clustering evaluation index provided in an embodiment of this application. Figure 6 The dataset includes four subplots (a) to (d), where the x-axis represents the number of updates and the y-axis represents the actual data. Specifically, (a) shows the clustering evaluation metrics for the macaque cell dataset, (b) shows the clustering evaluation metrics for the monocyte cell dataset, (c) shows the clustering evaluation metrics for the mouse cell dataset, and (d) shows the clustering evaluation metrics for the pancreatic islet cell dataset.
[0151] Each subplot in (a) to (d) includes a trend line for the adjusted Rand index, a trend line for normalized mutual information, and a trend line for the "proportion of identical samples before and after the update." From (a) to (d), it can be seen that as the number of updates increases, the adjusted Rand index first increases and then levels off, as does the normalized mutual information, and the "proportion of identical samples before and after the update" also first increases and then levels off. For the adjusted Rand index, normalized mutual information, and the "proportion of identical samples before and after the update," larger values indicate more accurate clustering results. Figure 6 It can be concluded that the more updates are performed, the more accurate the clustering results become.
[0152] As shown in (a), the adjusted Rand index, normalized mutual information, and the proportion of identical samples before and after the update are not significantly different for the second and third update processes. As shown in (b), the adjusted Rand index, normalized mutual information, and the proportion of identical samples before and after the update are not significantly different for the third and fourth update processes. As shown in (c), the adjusted Rand index, normalized mutual information, and the proportion of identical samples before and after the update are not significantly different for the fourth and fifth update processes. As shown in (d), the adjusted Rand index, normalized mutual information, and the proportion of identical samples before and after the update are not significantly different for the third and fourth update processes. Therefore, the target number of updates can be four or five. In other words, the multiple updated first clusters obtained from the fourth or fifth update process can be used as the target clustering result.
[0153] Alternatively, other methods can be used to cluster multiple first clusters and multiple second clusters. For example, another method could be the Single-cell Aggregated From Ensemble Clustering (SAFE-Clustering) method (hereinafter referred to as the SAFE method). The SAFE method concatenates multiple first clusters and multiple second clusters into a statistical table, and then re-clusters them based on a graph partitioning approach to obtain the target clustering result. Essentially, it achieves re-clustering by analyzing the neighborhood relationships between cell data.
[0154] In this embodiment of the application, for each cell dataset in the macaque cell dataset, monocyte cell dataset, mouse cell dataset, and pancreatic islet cell dataset, clustering can be performed on the cell dataset based on the Leiden algorithm to obtain clustering results (i.e., the multiple first clusters mentioned above), and clustering can be performed on the cell dataset based on the DESC algorithm to obtain clustering results (i.e., the multiple second clusters mentioned above). Then, based on... Figure 5 The clustering processing method shown (hereinafter referred to as the method of this application embodiment) performs clustering processing on multiple first clusters and multiple second clusters to obtain clustering results (i.e. the target clustering results mentioned above), and performs clustering processing on multiple first clusters and multiple second clusters based on the SAFE method to obtain clustering results.
[0155] Using the Leiden algorithm, DESC algorithm, the method of this embodiment, and SAFE method, four clustering results were obtained for the rhesus monkey cell dataset, the monocyte cell dataset, the mouse cell dataset, and the pancreatic islet cell dataset, respectively. Then, the adjusted Rand index and normalized mutual information of each clustering result were calculated. Compared with the Leiden algorithm, DESC algorithm, and SAFE method, the method of this embodiment improved the adjusted Rand index by 95.8%, 73.2%, and 77.6%, respectively. Compared with the Leiden algorithm, DESC algorithm, and SAFE method, the normalized mutual information of this embodiment was improved by 15.8%, 12.2%, and 15.9%, respectively.
[0156] like Figure 7 As shown, Figure 7 This is a schematic diagram illustrating a clustering evaluation index corresponding to different methods provided in the embodiments of this application. Figure 7 It is evident that for each cell dataset in the macaque cell dataset, monocyte cell dataset, mouse cell dataset, and pancreatic islet cell dataset, the adjusted Rand index and normalized mutual information corresponding to the method in this embodiment are higher than those corresponding to the Leiden algorithm, higher than those corresponding to the DESC algorithm, and higher than those corresponding to the SAFE method. Therefore, the clustering results obtained by the method in this embodiment are more accurate than those obtained by the Leiden, DESC, and SAFE algorithms.
[0157] This application also provides clustering result diagrams obtained by clustering a macaque cell dataset using the Leiden algorithm, the DESC algorithm, the method of this application embodiment, and the SAFE method, respectively, and provides the actual clustering results of the macaque cell dataset. Figure 8 As shown, Figure 8 This is a schematic diagram of the clustering results of a macaque cell dataset provided in an embodiment of this application. Figure 8 This includes the clustering results of the macaque cell dataset corresponding to the Leiden algorithm (the corresponding effect diagram is shown in Figure 1). Figure 15 The clustering results of the macaque cell dataset corresponding to the DESC algorithm are shown in the figure below. Figure 16 As shown), the clustering results of the macaque cell dataset corresponding to the method of this application embodiment (the corresponding effect diagram is shown in Figure 1). Figure 17 The clustering results of the rhesus cell dataset corresponding to the SAFE method are shown in the figure below. Figure 18(as shown) and the actual clustering results of the macaque cell dataset (the corresponding effect diagram is shown in the figure). Figure 19 As shown in the figure, the numbers in the figure represent the cluster identifiers of the clusters. Figure 8 It is evident that the clustering results of the method in this embodiment are closer to the actual clustering results of the macaque cell dataset, while the clustering results of the Leiden algorithm, DESC algorithm, and SAFE method are significantly different from the actual clustering results of the macaque cell dataset, indicating that the clustering results of the method in this embodiment are more accurate.
[0158] This application also provides clustering result diagrams obtained by clustering a mononuclear cell dataset using the Leiden algorithm, the DESC algorithm, the method of this application embodiment, and the SAFE method, and provides the actual clustering results of the mononuclear cell dataset. Figure 9 As shown, Figure 9 This is a schematic diagram of the clustering results of a single-nucleus cell dataset provided in an embodiment of this application. Figure 9 This includes the clustering results of the single-nucleus cell dataset corresponding to the Leiden algorithm (the corresponding effect diagram is shown in Figure 1). Figure 20 The clustering results of the single-nucleus cell dataset corresponding to the DESC algorithm (as shown in the figure) Figure 21 As shown), the clustering results of the single-nuclear cell dataset corresponding to the method of this application embodiment (the corresponding effect diagram is shown in Figure 1). Figure 22 The clustering results of the single-nucleus cell dataset corresponding to the SAFE method are shown in the figure below. Figure 23 (as shown) and the actual clustering results of the single-nucleus cell dataset (the corresponding effect diagram is shown in Figure 1). Figure 24 As shown in the figure, the numbers in the figure represent the cluster identifiers of the clusters. Figure 9 It is evident that the clustering results of the method in this embodiment are closer to the actual clustering results of the mononuclear cell dataset, while the clustering results of the Leiden algorithm, DESC algorithm, and SAFE method are significantly different from the actual clustering results of the mononuclear cell dataset, indicating that the clustering results of the method in this embodiment are more accurate.
[0159] This application also provides clustering result diagrams obtained by clustering a mouse cell dataset using the Leiden algorithm, the DESC algorithm, the method of this application embodiment, and the SAFE method, and provides the actual clustering results of the mouse cell dataset. Figure 10 As shown, Figure 10 This is a schematic diagram of the clustering results of a mouse cell dataset provided in an embodiment of this application. Figure 10This includes the clustering results of the mouse cell dataset corresponding to the Leiden algorithm (the corresponding effect diagram is shown in Figure 1). Figure 25 The clustering results of the mouse cell dataset corresponding to the DESC algorithm (as shown in the figure) Figure 26 As shown), the clustering results of the mouse cell dataset corresponding to the method of this embodiment of the application (the corresponding effect diagram is shown in Figure 1). Figure 27 (As shown), the clustering results of the mouse cell dataset corresponding to the SAFE method (the corresponding effect diagram is shown in Figure 1). Figure 28 (as shown) and the actual clustering results of the mouse cell dataset (the corresponding effect diagram is shown in Figure 1). Figure 29 As shown in the figure, the numbers in the figure represent the cluster identifiers of the clusters. Figure 10 It is evident that the clustering results of the method in this embodiment are closer to the actual clustering results of the mouse cell dataset, while the clustering results of the Leiden algorithm, DESC algorithm, and SAFE method are significantly different from the actual clustering results of the mouse cell dataset, indicating that the clustering results of the method in this embodiment are more accurate.
[0160] This application also provides clustering result diagrams obtained by clustering pancreatic islet cell datasets using the Leiden algorithm, DESC algorithm, the method of this application embodiment, and SAFE method, respectively, and provides the actual clustering results of the pancreatic islet cell dataset. Figure 11 As shown, Figure 11 This is a schematic diagram of the clustering results of a pancreatic islet cell dataset provided in an embodiment of this application. Figure 11 This includes the clustering results of the pancreatic islet cell dataset corresponding to the Leiden algorithm (the corresponding effect diagram is shown in Figure 1). Figure 30 The clustering results of the pancreatic islet cell dataset corresponding to the DESC algorithm are shown in the figure below. Figure 31 As shown), the clustering results of the pancreatic islet cell dataset corresponding to the method in this embodiment of the application (the corresponding effect diagram is shown in Figure 1). Figure 32 The clustering results of the pancreatic islet cell dataset corresponding to the SAFE method are shown in the figure below. Figure 33 (as shown) and the actual clustering results of the pancreatic islet cell dataset (the corresponding effect diagram is shown in Figure 1). Figure 34 As shown in the figure, the numbers in the figure represent the cluster identifiers of the clusters. Figure 11 It is evident that the clustering results of the method in this embodiment are closer to the actual clustering results of the islet cell dataset, while the clustering results of the Leiden algorithm, DESC algorithm, and SAFE method are significantly different from the actual clustering results of the islet cell dataset. This indicates that the clustering results of the method in this embodiment are more accurate.
[0161] Figure 12 The diagram shown is a structural schematic of a clustering processing device provided in an embodiment of this application. Figure 12 As shown, the device includes: The acquisition module 1201 is used to acquire a first cluster set and a second cluster set. The target cluster set in the first cluster set and the second cluster set is obtained by updating the clustering result corresponding to the target cluster set at least once. The target cluster set is at least one of the first cluster set and the second cluster set. The clustering results corresponding to different cluster sets are obtained by clustering multiple object data based on different clustering algorithms. The update module 1202 is used to update the first cluster set based on the second cluster set to obtain the third cluster set; The determination module 1203 is used to determine the third cluster set as the target clustering result in response to the satisfaction of the target conditions.
[0162] In one possible implementation, the update module 1202 is further configured to update the third cluster set based on the second cluster set in response to the failure to meet the target condition, thereby obtaining a fourth cluster set; The determination module 1203 is also used to take the fourth cluster set as the target clustering result in response to the satisfaction of the target conditions.
[0163] In one possible implementation, the update module 1202 is used to update the second cluster set based on the first cluster set to obtain the fifth cluster set; and to update the third cluster set based on the fifth cluster set to obtain the fourth cluster set.
[0164] In one possible implementation, the determining module 1203 is configured to take the third cluster set as the target clustering result if the third cluster set is the same as the first cluster set.
[0165] In one possible implementation, the determining module 1203 is used to determine the third cluster set as the target clustering result in response to the current update count reaching the target count.
[0166] In one possible implementation, the first cluster set includes multiple first clusters, the second cluster set includes multiple second clusters, and the third cluster set includes multiple third clusters; The update module 1202 is used to determine the coefficient of variation of any second cluster based on the first cluster to which each object data in the second cluster belongs. The coefficient of variation of any second cluster is used to characterize the dispersion of each object data in the second cluster. Based on the coefficient of variation of each second cluster, multiple first clusters are updated to obtain multiple third clusters.
[0167] In one possible implementation, the update module 1202 is configured to, for any second cluster, in response to the coefficient of variation of any second cluster being greater than a target coefficient of variation, determine the first cluster corresponding to any second cluster from a plurality of first clusters; determine the first cluster corresponding to any second cluster as a third cluster; and add object data in any second cluster that does not belong to a third cluster to a third cluster.
[0168] In one possible implementation, the update module 1202 is used to determine the first cluster to which each object data in any second cluster belongs as the third cluster, in response to the fact that the coefficient of variation of any second cluster is not greater than the target coefficient of variation, for any second cluster.
[0169] In one possible implementation, the first cluster set includes multiple first clusters, the second cluster set includes multiple second clusters, and the third cluster set includes multiple third clusters; The update module 1202 is used to perform outlier detection processing on each object data in any second cluster for any second cluster, and obtain the outlier detection results of each object data in any second cluster; and to update multiple first clusters based on the outlier detection results of each object data in each second cluster to obtain multiple third clusters.
[0170] In one possible implementation, the update module 1202 is configured to, for any second cluster, in response to the existence of first object data in each object data of any second cluster, determine the first cluster corresponding to any second cluster from multiple first clusters, and the outlier detection result of the first object data is non-outlier object data; determine the first cluster corresponding to any second cluster as a third cluster; and in response to the first object data not belonging to a third cluster, add the first object data to a third cluster.
[0171] In one possible implementation, the update module 1202 is used to determine, for any second cluster, a first cluster to which a second object data belongs as a third cluster in response to the existence of second object data in each object data in any second cluster, and the outlier detection result of the second object data is outlier object data.
[0172] In one possible implementation, the update module 1202 is used to perform dimensionality reduction processing on the object data of each object in any second cluster to obtain the dimensionality-reduced object data; and to perform outlier detection processing on the dimensionality-reduced object data to obtain the outlier detection results of the object data of each object in any second cluster.
[0173] In one possible implementation, the update module 1202 is used to determine a cross-tabulation based on multiple first clusters and multiple second clusters, wherein a row of data in the cross-tabulation represents the data of each object in a first cluster, and a column of data in the cross-tabulation represents the data of each object in a second cluster; and to determine the first cluster corresponding to any second cluster from the multiple first clusters based on the cross-tabulation.
[0174] In one possible implementation, the crosstab includes multiple non-zero data, where the non-zero data represents the number of identical object data contained in the first cluster corresponding to the row containing the non-zero data and the second cluster corresponding to the column containing the non-zero data. The update module 1202 is used to determine the largest non-zero data from the non-zero data contained in the column corresponding to any second cluster in the cross table; and to determine the first cluster corresponding to the row containing the largest non-zero data as the first cluster corresponding to any second cluster.
[0175] In one possible implementation, the object data is the gene expression matrix of cells. The clustering result corresponding to the first cluster set is obtained by clustering the gene expression matrices of multiple cells based on the Leiden algorithm. The clustering result corresponding to the second cluster set is obtained by clustering the gene expression matrices of multiple cells based on the deep embedding single-cell clustering algorithm.
[0176] In the aforementioned device, at least one of the first cluster set and the second cluster set is a target cluster set. The target cluster set is obtained by updating the clustering results corresponding to the target cluster set at least once, thereby updating the clustering results corresponding to the target cluster set. Subsequently, the first cluster set is updated based on the second cluster set to obtain a third cluster set. When the target condition is met, the third cluster set is used as the target clustering result. Furthermore, the clustering results corresponding to different cluster sets are obtained by clustering multiple object data based on different clustering algorithms. This achieves the goal of improving the accuracy of clustering results by merging the first and second clustering algorithms through multiple updates.
[0177] It should be understood that the above Figure 12 The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.
[0178] Figure 13 A structural block diagram of a terminal device 1300 provided in an exemplary embodiment of this application is shown. The terminal device 1300 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, laptop computer, or desktop computer. The terminal device 1300 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0179] Typically, terminal device 1300 includes a processor 1301 and a memory 1302.
[0180] Processor 1301 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1301 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1301 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1301 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0181] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1302 are used to store at least one instruction, which is executed by the processor 1301 to implement the clustering processing method provided in the method embodiments of this application.
[0182] In some embodiments, the terminal device 1300 may also optionally include a peripheral device interface 1303 and at least one peripheral device. The processor 1301, memory 1302, and peripheral device interface 1303 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1304, a display screen 1305, a camera assembly 1306, an audio circuit 1307, and a power supply 1309.
[0183] Peripheral device interface 1303 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1301 and memory 1302. In some embodiments, processor 1301, memory 1302 and peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1301, memory 1302 and peripheral device interface 1303 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0184] The radio frequency (RF) circuit 1304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1304 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1304 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1304 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0185] Display screen 1305 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1305 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1301 for processing. In this case, display screen 1305 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1305, disposed on the front panel of terminal device 1300; in other embodiments, there may be at least two display screens 1305, disposed on different surfaces of terminal device 1300 or in a folded design; in still other embodiments, display screen 1305 may be a flexible display screen, disposed on a curved or folded surface of terminal device 1300. Furthermore, display screen 1305 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1305 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0186] The camera assembly 1306 is used to acquire images or videos. Optionally, the camera assembly 1306 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1306 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0187] The audio circuit 1307 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1301 for processing, or input to the radio frequency circuit 1304 to achieve voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal device 1300. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1301 or the radio frequency circuit 1304 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1307 may also include a headphone jack.
[0188] Power supply 1309 is used to supply power to the various components in terminal device 1300. Power supply 1309 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1309 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0189] In some embodiments, the terminal device 1300 further includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: an acceleration sensor 1311, a gyroscope sensor 1312, a pressure sensor 1313, an optical sensor 1315, and a proximity sensor 1316.
[0190] Accelerometer 1311 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal device 1300. For example, accelerometer 1311 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1301 can control display screen 1305 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1311. Accelerometer 1311 can also be used for games or for acquiring user motion data.
[0191] The gyroscope sensor 1312 can detect the orientation and rotation angle of the terminal device 1300. The gyroscope sensor 1312 can work in conjunction with the accelerometer sensor 1311 to collect 3D motion data from the user on the terminal device 1300. Based on the data collected by the gyroscope sensor 1312, the processor 1301 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0192] The pressure sensor 1313 can be disposed on the side bezel of the terminal device 1300 and / or on the lower layer of the display screen 1305. When the pressure sensor 1313 is disposed on the side bezel of the terminal device 1300, it can detect the user's grip signal on the terminal device 1300, and the processor 1301 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1313. When the pressure sensor 1313 is disposed on the lower layer of the display screen 1305, the processor 1301 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1305. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0193] The optical sensor 1315 is used to collect ambient light intensity. In one embodiment, the processor 1301 can control the display brightness of the display screen 1305 based on the ambient light intensity collected by the optical sensor 1315. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1305 is increased; when the ambient light intensity is low, the display brightness of the display screen 1305 is decreased. In another embodiment, the processor 1301 can also dynamically adjust the shooting parameters of the camera assembly 1306 based on the ambient light intensity collected by the optical sensor 1315.
[0194] The proximity sensor 1316, also known as a distance sensor, is typically located on the front panel of the terminal device 1300. The proximity sensor 1316 is used to detect the distance between the user and the front of the terminal device 1300. In one embodiment, when the proximity sensor 1316 detects that the distance between the user and the front of the terminal device 1300 is gradually decreasing, the processor 1301 controls the display screen 1305 to switch from a screen-on state to a screen-off state; when the proximity sensor 1316 detects that the distance between the user and the front of the terminal device 1300 is gradually increasing, the processor 1301 controls the display screen 1305 to switch from a screen-off state to a screen-on state.
[0195] Those skilled in the art will understand that Figure 13 The structure shown does not constitute a limitation on the terminal device 1300, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0196] Figure 14This is a schematic diagram of the server structure provided in the embodiments of this application. The server 1400 can vary considerably due to different configurations or performance. It may include one or more processors 1401 and one or more memories 1402. The one or more memories 1402 store at least one line of program code, which is loaded and executed by the one or more processors 1401 to implement the clustering processing methods provided in the various method embodiments described above. For example, the processor 1401 is a CPU. Of course, the server 1400 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1400 may also include other components for implementing device functions, which will not be elaborated here.
[0197] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one piece of program code that is loaded and executed by a processor to enable an electronic device to implement any of the clustering processing methods described above.
[0198] Optionally, the aforementioned computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0199] In an exemplary embodiment, a computer program or computer program product is also provided, which stores at least one computer instruction that is loaded and executed by a processor to enable the computer to implement any of the clustering processing methods described above.
[0200] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0201] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0202] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A clustering processing method, characterized in that, The method includes: Obtain a first cluster set and a second cluster set. The target cluster set in the first cluster set and the second cluster set is obtained by updating the clustering result corresponding to the target cluster set at least once. The target cluster set is at least one of the first cluster set and the second cluster set. The clustering result corresponding to different cluster sets is obtained by clustering multiple object data based on different clustering algorithms. The object data is the gene expression matrix of cells. The first cluster set is updated based on the second cluster set to obtain the third cluster set; In response to meeting the target conditions, the third cluster set is taken as the target clustering result; Wherein, the first cluster set includes multiple first clusters, the second cluster set includes multiple second clusters, and the third cluster set includes multiple third clusters; the step of updating the first cluster set based on the second cluster set to obtain the third cluster set includes: Based on the first cluster to which each object data in any second cluster belongs, obtain each non-zero data corresponding to the any second cluster, wherein the non-zero data represents the number of object data in the any second cluster corresponding to a first cluster; Based on each non-zero data corresponding to any second cluster, calculate the standard deviation and mean of any second cluster, and determine the coefficient of variation of any second cluster based on the standard deviation and the mean. The coefficient of variation of any second cluster is used to characterize the dispersion of each object data in any second cluster. The plurality of first clusters are updated based on the coefficient of variation of each second cluster to obtain the plurality of third clusters.
2. The method according to claim 1, characterized in that, After updating the first cluster set based on the second cluster set to obtain the third cluster set, the process further includes: In response to the failure to meet the target condition, the third cluster set is updated based on the second cluster set to obtain a fourth cluster set; In response to the satisfaction of the target condition, the fourth cluster set is taken as the target clustering result.
3. The method according to claim 2, characterized in that, The step of updating the third cluster set based on the second cluster set to obtain the fourth cluster set includes: The second cluster set is updated based on the first cluster set to obtain the fifth cluster set; The third cluster set is updated based on the fifth cluster set to obtain the fourth cluster set.
4. The method according to claim 1, characterized in that, The step of using the third cluster set as the target clustering result in response to the satisfaction of the target condition includes: If the third cluster set is the same as the first cluster set before the update, then the third cluster set is taken as the target clustering result.
5. The method according to claim 1, characterized in that, The step of using the third cluster set as the target clustering result in response to the satisfaction of the target condition includes: If the current number of updates reaches the target number, then the third cluster set is taken as the target clustering result.
6. The method according to claim 1, characterized in that, The process of updating the plurality of first clusters based on the coefficient of variation of each second cluster to obtain the plurality of third clusters includes: For any second cluster, in response to the fact that the coefficient of variation of any second cluster is greater than the target coefficient of variation, the first cluster corresponding to any second cluster is determined from the plurality of first clusters; The first cluster corresponding to any second cluster is determined to be a third cluster; Add the object data that does not belong to the third cluster from any of the second clusters to the third cluster.
7. The method according to claim 1, characterized in that, The process of updating the plurality of first clusters based on the coefficient of variation of each second cluster to obtain the plurality of third clusters includes: For any second cluster, in response to the fact that the coefficient of variation of any second cluster is not greater than the target coefficient of variation, the first cluster to which each object data in any second cluster belongs is determined as the third cluster.
8. The method according to any one of claims 1 to 5, characterized in that, The step of updating the first cluster set based on the second cluster set to obtain the third cluster set further includes: For any second cluster, outlier detection processing is performed on each object data in the second cluster to obtain the outlier detection results for each object data in the second cluster. Based on the outlier detection results of each object data in each second cluster, the multiple first clusters are updated to obtain multiple third clusters.
9. The method according to claim 8, characterized in that, The outlier detection results based on the object data in each of the second clusters are used to update the multiple first clusters to obtain multiple third clusters, including: For any second cluster, in response to the existence of first object data in each object data in any second cluster, the first cluster corresponding to any second cluster is determined from the plurality of first clusters, and the outlier detection result of the first object data is non-outlier object data. The first cluster corresponding to any second cluster is determined to be a third cluster; In response to the first object data not belonging to the third cluster, the first object data is added to the third cluster.
10. The method according to claim 8, characterized in that, The outlier detection results based on the object data in each of the second clusters are used to update the multiple first clusters to obtain multiple third clusters, including: For any second cluster, in response to the existence of second object data in each object data in any second cluster, the first cluster to which a second object data belongs is determined as a third cluster, and the outlier detection result of the second object data is the outlier object data.
11. The method according to claim 8, characterized in that, The outlier detection process performed on the object data in any of the second clusters to obtain the outlier detection results for each object data in any of the second clusters includes: Dimensionality reduction is performed on the object data in any of the second clusters to obtain the dimensionality-reduced object data. Outlier detection processing is performed on the data of each dimensionality-reduced object to obtain the outlier detection results of each object data in any second cluster.
12. The method according to claim 6 or 9, characterized in that, Determining the first cluster corresponding to any one of the second clusters from the plurality of first clusters includes: A cross-tabulation is determined based on the plurality of first clusters and the plurality of second clusters. A row of data in the cross-tabulation represents the data of each object in a first cluster, and a column of data in the cross-tabulation represents the data of each object in a second cluster. Based on the cross-tabulation, the first cluster corresponding to any one of the second clusters is determined from the plurality of first clusters.
13. The method according to claim 12, characterized in that, The cross-tab includes multiple non-zero data points, where each non-zero data point represents the number of identical object data points contained in the first cluster corresponding to the row containing the non-zero data point and the second cluster corresponding to the column containing the non-zero data point. The step of determining the first cluster corresponding to any one of the second clusters from the plurality of first clusters based on the cross-tabulation includes: From the non-zero data contained in the column corresponding to any second cluster in the cross table, determine the largest non-zero data; The first cluster corresponding to the row containing the largest non-zero data is determined as the first cluster corresponding to any second cluster.
14. The method according to any one of claims 1 to 5, characterized in that, The clustering result corresponding to the first cluster set is obtained by clustering the gene expression matrix of multiple cells based on the Leiden algorithm, and the clustering result corresponding to the second cluster set is obtained by clustering the gene expression matrix of the multiple cells based on the deep embedding single-cell clustering algorithm.
15. A clustering processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire a first cluster set and a second cluster set. The target cluster set in the first cluster set and the second cluster set is obtained by updating the clustering result corresponding to the target cluster set at least once. The target cluster set is at least one of the first cluster set and the second cluster set. The clustering result corresponding to different cluster sets is obtained by clustering multiple object data based on different clustering algorithms. The object data is the gene expression matrix of cells. The update module is used to update the first cluster set based on the second cluster set to obtain a third cluster set; A determination module is used to, in response to satisfying the target condition, take the third cluster set as the target clustering result; Wherein, the first cluster set includes multiple first clusters, the second cluster set includes multiple second clusters, and the third cluster set includes multiple third clusters; the step of updating the first cluster set based on the second cluster set to obtain the third cluster set includes: Based on the first cluster to which each object data in any second cluster belongs, obtain each non-zero data corresponding to the any second cluster, wherein the non-zero data represents the number of object data in the any second cluster corresponding to a first cluster; Based on each non-zero data corresponding to any second cluster, calculate the standard deviation and mean of any second cluster, and determine the coefficient of variation of any second cluster based on the standard deviation and the mean. The coefficient of variation of any second cluster is used to characterize the dispersion of each object data in any second cluster. The plurality of first clusters are updated based on the coefficient of variation of each second cluster to obtain the plurality of third clusters.
16. The apparatus according to claim 15, characterized in that, The update module is further configured to update the third cluster set based on the second cluster set in response to the failure to meet the target condition, thereby obtaining a fourth cluster set; The determining module is further configured to, in response to satisfying the target condition, use the fourth cluster set as the target clustering result.
17. The apparatus according to claim 16, characterized in that, The update module is used to update the second cluster set based on the first cluster set to obtain a fifth cluster set; The third cluster set is updated based on the fifth cluster set to obtain the fourth cluster set.
18. The apparatus according to claim 15, characterized in that, The determining module is configured to, in response to the fact that the third cluster set is the same as the first cluster set before the update, take the third cluster set as the target clustering result.
19. The apparatus according to claim 15, characterized in that, The determining module is configured to take the third cluster set as the target clustering result if the current update count reaches the target count.
20. The apparatus according to claim 15, characterized in that, The update module is configured to, for any second cluster, in response to the coefficient of variation of the second cluster being greater than a target coefficient of variation, determine the first cluster corresponding to the second cluster from the plurality of first clusters; determine the first cluster corresponding to the second cluster as a third cluster; and add object data in the second cluster that does not belong to the third cluster to the third cluster.
21. The apparatus according to claim 15, characterized in that, The update module is configured to, for any second cluster, determine the first cluster to which each object data in the second cluster belongs as the third cluster in response to the fact that the coefficient of variation of the second cluster is not greater than the target coefficient of variation.
22. The apparatus according to any one of claims 15 to 19, characterized in that, The step of updating the first cluster set based on the second cluster set to obtain the third cluster set further includes: For any second cluster, outlier detection processing is performed on each object data in the second cluster to obtain outlier detection results for each object data in the second cluster; based on the outlier detection results for each object data in each second cluster, the multiple first clusters are updated to obtain multiple third clusters.
23. The apparatus according to claim 22, characterized in that, The update module is configured to, for any second cluster, in response to the existence of first object data in each object data in any second cluster, determine the first cluster corresponding to any second cluster from the plurality of first clusters, and the outlier detection result of the first object data is non-outlier object data. The first cluster corresponding to any second cluster is determined to be a third cluster; in response to the first object data not belonging to the third cluster, the first object data is added to the third cluster.
24. The apparatus according to claim 22, characterized in that, The update module is used to determine, for any second cluster, a first cluster to which a second object data belongs as a third cluster in response to the existence of second object data in each object data in the second cluster, and the outlier detection result of the second object data is outlier object data.
25. The apparatus according to claim 22, characterized in that, The update module is used to perform dimensionality reduction processing on the object data in any of the second clusters to obtain the dimensionality-reduced object data; and to perform outlier detection processing on the dimensionality-reduced object data to obtain the outlier detection results of the object data in any of the second clusters.
26. The apparatus according to claim 20 or 23, characterized in that, The update module is used to determine a cross-tabulation based on the plurality of first clusters and the plurality of second clusters, wherein a row of data in the cross-tabulation represents the data of each object in a first cluster, and a column of data in the cross-tabulation represents the data of each object in a second cluster; and to determine the first cluster corresponding to any one of the second clusters from the plurality of first clusters based on the cross-tabulation.
27. The apparatus according to claim 26, characterized in that, The cross-tab includes multiple non-zero data points, where each non-zero data point represents the number of identical object data points contained in the first cluster corresponding to the row containing the non-zero data point and the second cluster corresponding to the column containing the non-zero data point. The update module is used to determine the largest non-zero data from the non-zero data contained in the column corresponding to any second cluster in the cross table; The first cluster corresponding to the row containing the largest non-zero data is determined as the first cluster corresponding to any second cluster.
28. The apparatus according to any one of claims 15 to 19, characterized in that, The clustering result corresponding to the first cluster set is obtained by clustering the gene expression matrix of multiple cells based on the Leiden algorithm, and the clustering result corresponding to the second cluster set is obtained by clustering the gene expression matrix of the multiple cells based on the deep embedding single-cell clustering algorithm.
29. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one piece of program code, which is loaded and executed by the processor to enable the electronic device to implement the clustering processing method as described in any one of claims 1 to 14.
30. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to enable the computer to implement the clustering processing method as described in any one of claims 1 to 14.
31. A computer program product, characterized in that, The computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement the clustering processing method as described in any one of claims 1 to 14.
Citation Information
Patent Citations
Clustering quality improvement method
JP2014063343A
Improving data clustering stability
US8463784B1
