Mass spectrometry imaging method, device and electronic equipment for spatial region typing
By extracting feature vectors and clustering adjustments from the pixels in mass spectrometry images, the problem of inaccurate spatial region classification in mass spectrometry images is solved, achieving more accurate biological tissue region division and supporting more reliable omics analysis.
Patent Information
- Application Number
- CN202211431340.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-11-14
AI Technical Summary
The spatial region typing results in the existing mass spectrometry imaging images are inaccurate, which affects subsequent omics analysis.
By extracting the feature vector of metabolic detection results from each pixel in the mass spectrometry imaging image, clustering algorithms are used to generate clusters, and the clustering of unclassified pixels is adjusted by the distance and similarity of surrounding pixels. The classification results are optimized by combining dimensionality reduction and graph clustering algorithms.
It improves the accuracy of clustering, generates spatial typing and classification results with low noise and consistent with the morphology of real biological tissues, and enhances the reliability of omics analysis.
Smart Images

Figure CN115797926B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular, the present application relates to a mass spectrometry imaging graph spatial region typing method and device, electronic equipment and storage medium. BACKGROUND
[0002] Mass spectrometry analysis technology is one of the frontiers of precision instrument analysis field, and has been rapidly developed in the field of clinical detection in recent years. It can replace the conventional method in many fields such as biochemistry, immunology, drug metabolism, microbiology, pathological diagnosis and molecule, for example, compared with gene sequencing, mass spectrometry is suitable for detection of various molecules, including biological macromolecules such as nucleic acids and polypeptides, and biological small molecules such as metabolites, hormones and vitamins, as well as trace inorganic elements, which can realize the simultaneous qualitative and quantitative analysis of thousands of markers.
[0003] In the mass spectrometry imaging graph, a single pixel point is close to a single cell, and each cell includes multiple metabolite ions. The mass spectrometry imaging graph is an image composed of different ion layer data stacked together, and each ion layer data includes the signal intensity of a metabolite ion in each cell of the biological sample. The original data of the mass spectrometry imaging graph constitutes the data basis for spatial metabolomics data analysis. In the corresponding data analysis, the tissue-specific spatial region needs to be automatically divided according to a certain method, and the subsequent omics analysis can be carried out according to the division result. However, the current typing result is not accurate, which affects the subsequent omics analysis. SUMMARY
[0004] The embodiments of the present application provide a mass spectrometry imaging graph spatial region typing method, device, electronic equipment, computer readable storage medium and computer program product, which can solve the above problems of the prior art. The technical solution is as follows:
[0005] According to one aspect of the embodiments of the present application, a mass spectrometry imaging graph spatial region typing method is provided, each pixel point in the mass spectrometry imaging graph is used to represent the metabolic detection result of a single cell in a biological sample, and the metabolic detection result includes the signal intensity of at least one metabolite ion. The method comprises:
[0006] According to the metabolic detection result of the pixel point, a feature vector of the pixel point is obtained;
[0007] According to the feature vectors of the pixel points, the pixel points are clustered to obtain a plurality of clustering clusters, and each clustering cluster includes at least one pixel point;
[0008] Pixels whose clusters are not yet determined are taken as target pixels. The cluster to which the target pixel belongs is determined based on the distance and compositional similarity between the target pixel and other pixels within a preset range, as well as the clusters to which the other pixels belong.
[0009] The spatial region classification result is determined based on the cluster to which each pixel belongs.
[0010] As an optional embodiment, the cluster to which the target pixel belongs is determined based on the distance and compositional similarity between the target pixel and other pixels within a preset range, as well as the cluster to which the other pixels belong, including:
[0011] Sort the distances between the target pixel and each other pixel to determine the sorting result of each other pixel;
[0012] The corresponding weights are obtained based on the sorting results of the other pixels, and the weights are proportional to the sorting results. The correlation between the other pixels and the target pixel is obtained based on the weights of the other pixels and their composition similarity.
[0013] The cluster in which the target pixel belongs is determined based on the cluster in which the other pixels with the highest correlation belong.
[0014] As an optional embodiment, the feature vector of the pixel is obtained based on the metabolic detection result of the pixel, including:
[0015] Based on the signal intensity of the metabolite ions in each cell, the distribution of the signal intensity of the metabolite ions is determined. The signal intensity of the metabolite ions is then clipped based on the distribution. The clipped signal intensity is then normalized to obtain the updated signal intensity of the metabolite ions.
[0016] The updated signal intensity of each metabolite ion corresponding to the pixel is used as the initial feature vector of the pixel. The initial feature vector is then subjected to dimensionality reduction processing to obtain the feature vector of the pixel. The feature vector is used to characterize the difference in metabolite ion composition between the pixel and other pixels.
[0017] As an optional embodiment, the composition similarity is the similarity between the types of metabolite ions contained in the target pixel and other pixels, or the similarity between the feature vectors of the target pixel and other pixels.
[0018] As an optional embodiment, the distribution of the signal intensity of the metabolite ions is determined based on their signal intensity in each cell, and the signal intensity of the metabolite ions is trimmed according to the distribution, including:
[0019] For each metabolite ion, the data is divided into equal-width bins based on the signal intensity of the metabolite ion in each cell. Each bin is used to count the proportion of cells within a certain signal intensity range to the total number of cells.
[0020] Based on the proportions of each sub-compartment, an upper limit for the signal intensity of the metabolite ions is determined, and the signal intensity of the metabolite ions is then trimmed according to the upper limit.
[0021] As an optional embodiment, the pixels are clustered based on their feature vectors to obtain multiple clusters, including:
[0022] Determine the similarity between the feature vectors of each pair of pixels;
[0023] A similarity matrix is obtained based on the similarity between the feature vectors of each pair of pixels. The elements in the similarity matrix are used to characterize the similarity between the feature vectors of each pair of pixels.
[0024] Elements in the similarity matrix with similarity greater than a similarity threshold are taken as target elements. A relationship network graph is constructed based on the target elements. Two nodes with a connection relationship in the relationship network graph are used to represent two pixels in a target element.
[0025] The nodes in the relational network graph are clustered according to a preset graph clustering algorithm.
[0026] As an optional embodiment, the upper limit of the signal intensity of the metabolite ions is determined according to the proportion corresponding to each sub-compartment, including:
[0027] Based on the signal strength range from small to large, the proportions corresponding to each sub-box are accumulated. When the accumulated value reaches a preset value, the minimum signal strength in the sub-box corresponding to the last accumulated proportion is taken as the upper limit value.
[0028] As an optional embodiment, the spatial region classification result is determined based on the cluster to which each pixel belongs after traversal, including:
[0029] The feature vectors of each pixel are reduced to three-dimensional feature vectors, and the position of the pixel in the three-dimensional virtual space is determined based on the three-dimensional feature vectors.
[0030] Determine the display style of each cluster in the three-dimensional virtual space;
[0031] Based on the position of each pixel in the three-dimensional space system and the display style corresponding to the cluster to which the pixel belongs, a three-dimensional rendering is drawn as the spatial region classification result.
[0032] According to another aspect of the present application, a spatial region classification device for a mass spectrometry imaging image is provided, wherein each pixel in the mass spectrometry imaging image is used to characterize the metabolic detection result of a single cell in a biological sample, the metabolic detection result including the signal intensity of at least one metabolite ion, and the device includes:
[0033] The feature vector extraction module is used to obtain the feature vector of the pixel based on the metabolic detection results of the pixel.
[0034] The clustering module is used to cluster each pixel according to the feature vector of each pixel to obtain multiple clusters, and each cluster includes at least one pixel.
[0035] The filling module is used to take pixels whose clusters are not determined as target pixels, and determine the cluster to which the target pixel belongs based on the distance and composition similarity between the target pixel and other pixels within a preset range, as well as the clusters to which the other pixels belong.
[0036] The classification module is used to determine the spatial region classification result based on the cluster to which each pixel belongs.
[0037] According to another aspect of the present application, an electronic device is provided, the electronic device including a memory, a processor and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the steps of the spatial region classification method of the mass spectrometry imaging map provided in the above aspect.
[0038] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the spatial region classification method for mass spectrometry imaging provided in the above aspect are implemented.
[0039] According to one aspect of the embodiments of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the spatial region classification method for mass spectrometry imaging provided in the above aspect.
[0040] The beneficial effects of the technical solutions provided in this application are:
[0041] According to the metabolic detection results of the pixels, the feature vectors of the pixels are obtained. Based on the feature vectors of each pixel, the pixels are clustered to obtain multiple clusters. Since there are some unclassifiable pixels in the clustering process, the cluster of the target pixel is determined by the clusters of other pixels within a preset range around it and the clusters and composition similarity between other pixels and the target pixel. This can enhance the accuracy of clustering and produce spatial classification results with low noise and consistent with the real biological tissue morphology. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0043] Figure 1 This is a schematic diagram of the system architecture for implementing the spatial region classification method of mass spectrometry imaging provided in the embodiments of this application;
[0044] Figure 2 A schematic flowchart illustrating a spatial region classification method for mass spectrometry imaging provided in an embodiment of this application;
[0045] Figure 3 A schematic diagram illustrating a dimension reduction method provided in an embodiment of this application;
[0046] Figure 4 This is a flowchart illustrating a spatial region classification method according to another embodiment of this application;
[0047] Figure 5 This is a schematic diagram of the structure of a spatial region classification device provided in an embodiment of this application;
[0048] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0050] Those skilled in the art will understand that, unless otherwise stated, the singular forms “a,” “an,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.”
[0051] 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.
[0052] First, let's introduce and explain several terms used in this application:
[0053] A mass spectrum is generated when metabolite ions with different mass-to-charge ratios (m / z) are separated by a mass analyzer, detected and recorded by a detector, and then represented as a mass spectrum after computer processing. In the mass spectrum, the horizontal axis represents the mass-to-charge ratio of the metabolite ions, with the mass-to-charge ratio increasing from left to right. For ions with a single charge, the value on the horizontal axis represents the mass of the metabolite ion; the vertical axis represents the signal intensity of the ion current.
[0054] In spatial metabolomics, mass spectrometry imaging involves scanning cells on a biological tissue slice according to a specific spatial arrangement. Each cell is scanned to obtain a mass spectrum. Each mass spectrum corresponds to a pixel on a two-dimensional plane in a mass spectrometry imaging dataset. The collection of scanned mass spectra with spatial order coordinate information is arranged on a two-dimensional plane according to the spatial coordinate information, generating mass spectrometry imaging data in spatial metabolomics.
[0055] Dimensionality reduction is the process of transforming a high-dimensional dataset into a comparable low-dimensional space. Common dimensionality reduction methods include principal component analysis, independent component analysis, factor analysis, and linear discriminant analysis.
[0056] Clustering is the process of dividing a collection of physical or abstract objects into multiple classes composed of similar objects. A cluster generated by clustering is a set of data objects that are similar to objects in the same cluster and different from objects in other clusters.
[0057] Spatial region classification is the process of segmenting a biological organ or tissue slice image plane based on certain data differences to divide the biological organ or tissue into different types of biological tissue regions.
[0058] The spatial region classification method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in this application are intended to solve the above-mentioned technical problems of the prior art.
[0059] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0060] Figure 1 This is a schematic diagram of the system architecture for implementing a spatial region classification method for mass spectrometry imaging provided in this application embodiment. Specifically, it can be applied to medical analysis scenarios. The system includes: a terminal 101, a mass spectrometer 102, and a network server 103. The user performs mass spectrometry analysis on the biological sample to be analyzed through the mass spectrometer 102. The mass spectrometer sends the mass spectrometry analysis result, i.e., the mass spectrometry imaging image, to the terminal 101. The terminal 101 sends the mass spectrometry imaging image to the server 103. The server 103 obtains the spatial region classification result according to the spatial region classification method for mass spectrometry imaging provided in this application embodiment. The server 103 returns the spatial region classification result to the terminal 101, which then displays it to the user.
[0061] This application provides a spatial region classification method for mass spectrometry imaging, such as... Figure 2 As shown, the method includes S101 to S105.
[0062] S101. Based on the metabolic detection results of the pixel, obtain the feature vector of the pixel.
[0063] Since the metabolic detection results include the signal intensity of at least one metabolite ion, the embodiments of this application can count all metabolite ions present in the mass spectrometry imaging image, and then use the signal intensity of the metabolite ion as the feature value of the feature vector corresponding to each metabolite ion, thereby obtaining the feature vector of the pixel.
[0064] S102. Based on the feature vector of each pixel, cluster each pixel to obtain multiple clusters, each cluster including at least one pixel.
[0065] After obtaining the feature vectors of each pixel in this embodiment, clustering can be performed based on the low-dimensional feature vectors. This embodiment does not limit the specific clustering method; for example, graph clustering can be used. Specifically, the row data in the reduced-dimensional matrix is used as the data object, and pairwise cosine similarity calculations are performed between rows to obtain a similarity matrix. After deleting elements below a certain threshold from the similarity matrix, the remaining elements can generate a network graph. In the network graph, the pixels in the mass spectrometry imaging data, i.e., the rows in the original matrix, are network nodes. The clustering results of the pixels are obtained by processing the entire network graph data based on a certain network community detection algorithm.
[0066] In one embodiment, after clustering, this application embodiment can further traverse all pixels. For each traversed pixel, the cluster of the pixel is updated according to the cluster of other pixels within a preset range around the pixel, until the cluster of all pixels no longer needs to be updated.
[0067] It is important to note that the clustering results determined by clustering algorithms may be relatively coarse, containing some scattered, noisy pixels distributed in neighboring regions with unclear cluster categories. Therefore, this embodiment of the application updates the cluster of each pixel to the cluster of all other pixels within a preset radius that the pixel belongs to. It should be understood that the cluster of pixels may change as the traversal progresses. This embodiment of the application can first traverse the pixels in row order, and then in column order, until the cluster of all pixels no longer needs to be updated. At this point, the cluster of each pixel is truly determined. This solution corrects the classification information of unclassified background pixels and misclassified noise pixels generated by the clustering method based on the information of surrounding pixels, and merges small regions with low distribution density into complete organizational structure regions, which can effectively merge misclassified noise pixels into the correct clusters.
[0068] S103. Take the pixel that has not been assigned to a cluster as the target pixel, and determine the cluster to which the target pixel belongs based on the distance and composition similarity between the target pixel and other pixels within a preset range, as well as the cluster to which the other pixels belong.
[0069] Clustering algorithms cannot guarantee that all pixels will be clustered, and there will still be a small number of unclassified pixels. For pixels whose clusters are not determined, this application takes them as target pixels. For each target pixel, the cluster to which the target pixel belongs is determined based on the clusters of other pixels within a preset range around it and the clusters and composition similarity of other pixels with the target pixel, which can enhance the accuracy of clustering.
[0070] The compositional similarity of the embodiments of this application can be characterized by the similarity of the types of metabolite ions included in the pixel. For example, a target pixel includes three types of metabolite ions, A, B, and C, while another pixel includes four types of metabolite ions, A, B, C, and D. The similarity between the two is 75%.
[0071] S104. Determine the spatial region classification result based on the cluster to which each pixel belongs.
[0072] After determining the cluster to which each pixel belongs, each pixel in the mass spectrometry imaging image can be rendered based on a pre-set display style for each cluster, thereby obtaining a spatial region classification result. In one embodiment, different colors can be set for different clusters. For each pixel in the mass spectrometry imaging image, the pixel is rendered according to the color of the cluster it belongs to. The final size of the control region classification result is consistent with that of the mass spectrometry imaging image. Figure 1 Although they are identical, because each pixel has color, users can intuitively see the differences between regions in a biological sample.
[0073] According to the metabolic detection results of the pixels, the feature vectors of the pixels are obtained. Based on the feature vectors of each pixel, the pixels are clustered to obtain multiple clusters. Since there are some unclassifiable pixels in the clustering process, the cluster of the target pixel is determined by the clusters of other pixels within a preset range around it and the clusters and composition similarity between other pixels and the target pixel. This can enhance the accuracy of clustering and produce spatial classification results with low noise and consistent with the real biological tissue morphology.
[0074] Based on the above embodiments, as an optional embodiment, the cluster in which the target pixel belongs is determined according to the distance and compositional similarity between the target pixel and other pixels within a preset range, as well as the cluster in which the other pixels belong, including:
[0075] S201. Sort the distances between the target pixel and each other pixel, and determine the sorting result of each other pixel;
[0076] S202. Obtain the corresponding weights based on the sorting results of the other pixels, wherein the weights are proportional to the sorting results. Obtain the correlation between the other pixels and the target pixel based on the weights of the other pixels and their composition similarity.
[0077] S203. Determine the cluster in which the target pixel belongs based on the cluster in which the other pixels with the highest correlation belong.
[0078] In this embodiment of the application, for a target pixel, the distances between the target pixel and other pixels are first sorted to determine the sorting results of the other pixels. It should be understood that the eight pixels within one unit distance of a central pixel are all within one unit distance of the central pixel, so the sorting results of these eight pixels are consistent and are ranked as 1. There are a total of 16 other pixels within two unit distances of the central pixel, and the sorting results of these 16 pixels are consistent and are ranked as 2.
[0079] After determining the sorting result, this application can determine the corresponding weight. This application can use the reciprocal of the sorting result as the weight. For example, if the sorting result is 2, the weight is 1 / 2. The weight of other pixels that are farther away from the target pixel is lower, and the impact on the clustering of the target pixel is smaller.
[0080] In this embodiment, the similarity of the components is weighted by weights to obtain the correlation between the other pixels and the target pixel. Specifically, the correlation can be determined by the formula: (1 / rank(D))*cos, where D represents the distance between the target pixel and other pixels, rank(D) represents the ranking result of the distance, and cos represents the similarity of the components.
[0081] In one embodiment, the cluster containing the other pixels with the highest correlation can be used as the cluster containing the target pixel.
[0082] In one embodiment, the correlation can be sorted in descending order. If the total number of other pixels is K, take the first K / 2 of the other pixels in the queue and use the cluster with the largest proportion among these other pixels as the cluster of the target pixel. This embodiment utilizes the clustering information of more other pixels, thus the cluster of the target pixel is more accurate.
[0083] Based on the above embodiments, as an optional embodiment, the feature vector of the pixel is obtained according to the metabolic detection result of the pixel, including:
[0084] S301. Based on the signal intensity of the metabolite ions in each cell, determine the distribution of the signal intensity of the metabolite ions, trim the signal intensity of the metabolite ions according to the distribution, and normalize the trimmed signal intensity to obtain the updated signal intensity of the metabolite ions.
[0085] S302. The updated signal intensity of each metabolite ion corresponding to the pixel is used as the initial feature vector of the pixel. The initial feature vector is subjected to dimensionality reduction processing to obtain the feature vector of the pixel. The feature vector is used to characterize the difference in metabolite ion composition between the pixel and other pixels.
[0086] It should be understood that each metabolite ion in the embodiments of this application has a unique mass-to-charge ratio. Since a metabolite ion can exist in multiple cells, this application can statistically analyze the signal intensity of each metabolite ion in each cell and determine the distribution of the signal intensity of the metabolite ion. Then, based on the distribution, abnormal signals that are too high or too low can be identified, so that the cropped signal intensity can represent the signal distribution characteristics of most pixels.
[0087] The embodiments of this application can count the number of pixels in different signal intensity ranges to characterize the distribution of metabolite ions. Alternatively, after counting the number of pixels in different signal intensity ranges, further processing can be performed, and the processing results can be used to characterize the distribution of metabolite ions. The embodiments of this application do not impose specific limitations.
[0088] After signal intensity clipping, the embodiments of this application can perform signal intensity normalization, for example, based on the total peak area normalization method. In one embodiment, for a metabolite ion, the signal intensity of the metabolite ion in each row of pixels of the mass spectrometry image can be normalized, and finally all signal intensities distributed in the range of 100 to 1e8 signal intensity are normalized to the range [0,1].
[0089] Through the above steps, the metabolic detection result represented by each pixel includes the normalized signal intensity (i.e., the updated signal intensity) of each metabolite ion. The updated signal intensity of a metabolite ion is used as a feature of one dimension of the pixel. Therefore, the dimension of the initial feature vector of a pixel is equal to the number of all metabolite ions. Generally, the dimension of the initial feature vector is usually above 10,000, which is high-dimensional data. If cluster analysis is directly performed on the pixels using the initial feature vector, overfitting is likely to occur. Therefore, this embodiment considers dimensionality reduction of the initial feature vector.
[0090] Understandably, if a certain metabolite ion does not appear in a pixel, the feature value of the corresponding dimension of that metabolite ion at that pixel is a preset value, such as 0. For example, if there are 10,000 metabolite ions in a mass spectrometry image, and a certain pixel contains 700 of them, then the initial feature vector of that pixel has 10,000 dimensions, of which 9,300 dimensions have preset feature values, and the 700 dimensions have updated signal intensities for the corresponding 700 metabolite ions. It can be seen that the initial feature vector is relatively sparse.
[0091] The embodiments of this application do not specifically limit the specific method of dimensionality reduction. For example, it can be uniform manifold approximation and projection (UMAP), principal component analysis (PCA), or t-distributed stochastic neighbor embedding (t-SNE), etc.
[0092] The dimensionality-reduced feature vectors in this application embodiment are used to characterize the differences in metabolite ion composition between pixels and other pixels. The feature value of each dimension no longer simply characterizes the signal intensity of a metabolite ion. The number of dimensions is greatly reduced. In one embodiment, this application can reduce the dimension from 10,000 dimensions to 400 dimensions.
[0093] Please see Figure 3 The figure illustrates an illustrative diagram of dimensionality reduction in an embodiment of this application. As shown, mz1, mz2, ..., mzi represent i kinds of metabolite ions, and pixel1, pixel2, ..., pixelj represent j pixels in the mass spectrometry image. Before dimensionality reduction, the signal intensities of all metabolite ions in all pixels can form an original matrix, where each element represents the signal intensity of a metabolite ion in a pixel. This original matrix is a sparse matrix. After dimensionality reduction, the columns of the matrix no longer correspond to metabolite ions, but are updated to dim1, dim2, ..., dim800, that is, 800-dimensional feature values. Although each column represents a different meaning, it can still be used for clustering between pixels.
[0094] The spatial region classification method in this application prunes the signal intensity of metabolite ions and normalizes the pruned signal intensity to obtain updated signal intensity of metabolite ions. This not only solves the problem of abnormal signal intensity but also eliminates the order-of-magnitude difference. The updated signal intensity of each metabolite ion corresponding to a pixel is used as the initial feature vector of the pixel. The initial feature vector is then dimensionality-reduced to obtain the feature vector of the pixel. This lays the foundation for subsequent clustering to avoid overfitting and effectively improves the accuracy of clustering.
[0095] Based on the above embodiments, as an optional embodiment, the composition similarity is the similarity between the types of metabolite ions contained in the target pixel and other pixels, or the similarity between the feature vectors of the target pixel and other pixels. It should be noted that the feature vectors in this embodiment refer to the feature vectors after dimensionality reduction.
[0096] Based on the above embodiments, as an optional embodiment, the distribution of metabolite ion signal intensities is determined according to the signal intensities of metabolite ions in each cell, and the signal intensities of metabolite ions are trimmed according to the distribution, including:
[0097] For each metabolite ion, the data is binned with equal width according to the signal intensity of the metabolite ion in each cell. Each bin is used to count the proportion of cells with a signal intensity range to the total number of cells.
[0098] Based on the proportions of each sub-compartment, the upper limit of the signal intensity of metabolite ions is determined, and the signal intensity of metabolite ions is then trimmed according to the upper limit.
[0099] For each metabolite ion, this embodiment of the application can set multiple bins according to the distribution range of the signal intensity of the metabolite ion in each cell. For example, if the distribution range of the signal intensity is 10 to 10000, then the sub-interval of 0 to 1000 can be set as the first bin, the sub-interval of 1001 to 2000 as the second bin, ..., and the sub-interval of 9001 to 10000 as the last bin. After setting the bins, the sub-distribution range of which bin the signal intensity of the metabolite ion in each cell belongs to is counted. After counting the bins to which the signal intensity of the metabolite ion in all cells belongs, the proportion of cells in each bin to the total number of cells can be counted. According to the order of the sub-distribution ranges corresponding to each bin from small to large, the proportions corresponding to each bin are accumulated. According to a preset distribution probability threshold, such as 0.65, the upper limit value of the signal intensity corresponding to the bin when the probability is accumulated to 0.65 is obtained. All signal intensities higher than the upper limit value are clipped to below the upper limit value.
[0100] Based on the above embodiments, as an optional embodiment, the upper limit of the signal intensity of metabolite ions is determined according to the proportion corresponding to each sub-compartment, including:
[0101] Based on the signal strength range from small to large, the proportions corresponding to each sub-box are accumulated. When the accumulated value reaches the preset value, the minimum value of the original signal value in the sub-box corresponding to the last accumulated proportion is taken as the upper limit value.
[0102] For example, if there are six bins (bins 1-6), with the sub-distribution intervals corresponding to bins 1-6 gradually increasing, and the proportion of bin 1 is 15%, bin 2 is 18%, bin 3 is 19%, bin 4 is 23%, bin 5 is 15%, and bin 6 is 10%, and the preset value is 65%, starting from the proportion of bin 1, the accumulated proportion reaches 52% when accumulating to bin 3, which is still below the preset value. After accumulating to bin 4, the accumulated proportion reaches 75%, exceeding 65%. Therefore, bin 4 is chosen as the bin corresponding to the last accumulated proportion, and the minimum signal intensity in bin 4 is used as the upper limit. Assuming the upper limit for a certain metabolite ion is 10000, if the signal intensity of this metabolite ion in a cell is 9000, no adjustment is needed; if the signal intensity of this metabolite ion in a cell is 11000, it needs to be updated to 10000.
[0103] Based on the above embodiments, as an optional embodiment, the pixels are clustered according to their feature vectors to obtain multiple clusters, including:
[0104] S401. Determine the similarity between the feature vectors of any two pixels;
[0105] S402. Based on the similarity between the feature vectors of two pairs of pixels, obtain a similarity matrix. The elements in the similarity matrix are used to represent the similarity between the feature vectors of two pairs of pixels.
[0106] S403. Take the elements in the similarity matrix whose similarity is greater than the similarity threshold as the target elements, and construct a relationship network graph based on the target elements. Two nodes with a connection relationship in the relationship network graph are used to represent two pixels in a target element.
[0107] S404. Cluster the nodes in the relational network graph according to the preset graph clustering algorithm.
[0108] This application does not specifically limit the method for calculating the similarity between feature vectors. For example, cosine similarity, Euclidean distance, Mahalanobis distance, etc., can be used. It should be noted that in one embodiment, this application uses cosine similarity to measure the pixel points between feature vectors. Using cosine similarity can effectively reduce misjudgments caused by using Jaccard similarity.
[0109] After obtaining the similarity between the feature vectors of each pair of pixels, the similarity matrix can be obtained. It can be understood that if the total number of pixels is N, then the size of the similarity matrix is N*N. The elements in the similarity matrix are used to represent the similarity between the feature vectors of each pair of pixels.
[0110] After obtaining the similarity matrix, this embodiment of the application can filter each element in the similarity matrix based on a preset similarity threshold, selecting target elements from the similarity matrix that are greater than the threshold. Each target element corresponds to two pixels, and a relationship network graph can be established based on all pixels corresponding to all target elements. Nodes in the relationship network graph are pixels in the target elements, and each node also records the coordinates of the corresponding pixel. Two nodes with a connection relationship indicate that their similarity is greater than the preset threshold, and the edge connecting the two nodes records the similarity between the two nodes.
[0111] The embodiments of this application do not specifically limit the graph clustering algorithm, such as the Louvain algorithm or other graph node community clustering algorithms.
[0112] Based on the above embodiments, as an optional embodiment, the spatial region classification result is determined according to the cluster to which each pixel belongs after traversal, including:
[0113] S501. Reduce the feature vector of each pixel to a three-dimensional feature vector, and determine the position of the pixel in the three-dimensional virtual space based on the three-dimensional feature vector;
[0114] S502. Determine the display style of each cluster in the three-dimensional virtual space;
[0115] S503. Based on the position of each pixel in the three-dimensional space system and the display style corresponding to the cluster to which the pixel belongs, draw a three-dimensional rendering as the spatial region classification result.
[0116] The spatial region classification result obtained by the above embodiments of this application is a two-dimensional image. The cell represented by each pixel in this two-dimensional image is the same as the cell represented by the same pixel in the original mass spectrometry image. At this time, the user sees an image after different regions of the biological sample have been classified. However, the embodiments of this application further reduce the feature vector of the pixel to three dimensions, that is, a three-dimensional feature vector. Since the coordinate system of the three-dimensional virtual space is a three-dimensional coordinate system, the embodiments of this application can correspond each dimension of the three-dimensional feature vector to a coordinate axis in the three-dimensional coordinate system, thereby determining the unique position of each three-dimensional feature vector in the three-dimensional virtual space.
[0117] It should be understood that in the dimensionality-reduced scatter plot, the position of a point is directly related to the difference between the data point and other data points. The greater the difference between two data points, the farther apart they are; conversely, the higher the similarity between two data points, the closer they are to each other.
[0118] Based on the above embodiments, as an optional embodiment, the clustering of a pixel is updated according to the clustering of other pixels within a preset range around the pixel, including:
[0119] Identify a preset number of reference pixels with the highest similarity within a preset range around a given pixel;
[0120] Analyze the cluster to which each reference pixel belongs, and update the cluster to which the pixel belongs by counting the most times.
[0121] In this embodiment of the application, for the currently traversed pixel, the K (K is a positive integer) reference pixels with the highest similarity within a preset range can be determined from the similarity results obtained in the previous steps. Then, the clusters in which these K reference pixels belong are counted, and the cluster in which the pixel belongs is updated with the cluster that is counted the most times.
[0122] Please see Figure 4 The figure illustrates a flowchart of a spatial region classification method according to another embodiment of this application, as shown in the figure, which includes:
[0123] S601. For each metabolite ion, data is binned with equal width according to the signal intensity of the metabolite ion in each cell. Each bin is used to count the proportion of cells within a certain signal intensity range to the total number of cells.
[0124] S602. Determine the upper limit of the signal intensity of metabolite ions according to the proportion of each sub-box, and trim the signal intensity of metabolite ions according to the upper limit.
[0125] S603. Normalize the clipped signal intensity to obtain the updated signal intensity of metabolite ions.
[0126] S604. Take the updated signal intensity of each metabolite ion corresponding to the pixel as the initial feature vector of the pixel, and perform dimensionality reduction processing on the initial feature vector to obtain the feature vector of the pixel.
[0127] S605. Determine the similarity between the feature vectors of any two pixels;
[0128] S606. Based on the similarity between the feature vectors of two pairs of pixels, obtain a similarity matrix. The elements in the similarity matrix are used to represent the similarity between the feature vectors of two pairs of pixels.
[0129] S607. Take the elements in the similarity matrix whose similarity is greater than the similarity threshold as the target elements, and construct a relationship network graph based on the target elements. Two nodes with a connection relationship in the relationship network graph are used to represent two pixels in a target element.
[0130] S608. Cluster the nodes in the relational network graph according to the preset graph clustering algorithm;
[0131] S609. Traverse all pixels. For each traversed pixel, determine the reference pixels with the highest similarity within a preset range around the pixel, and the preset number of such reference pixels.
[0132] S610. Calculate the cluster of each reference pixel, update the cluster of the pixel with the most counts to the cluster of the pixel, update the cluster of the pixel until the cluster of the pixel no longer needs to be updated.
[0133] S611. Take the pixels whose clusters are not determined as target pixels, sort the distances between the target pixels and other pixels, and determine the sorting results of the other pixels.
[0134] S612. Obtain the corresponding weights based on the sorting results of other pixels. The weights are proportional to the sorting results. Obtain the correlation between the other pixels and the target pixel based on the weights of the other pixels and their composition similarity.
[0135] S613. Determine the cluster where the target pixel belongs based on the clusters of the other pixels with the highest correlation.
[0136] S614. Reduce the dimensionality of the feature vector of each pixel to a three-dimensional feature vector, and determine the position of the pixel in the three-dimensional virtual space based on the three-dimensional feature vector;
[0137] S615. Determine the display style of each cluster in the three-dimensional virtual space. Based on the position of each pixel in the three-dimensional space system and the display style corresponding to the cluster to which the pixel belongs, draw a three-dimensional rendering as the spatial region classification result.
[0138] This application provides a spatial region classification device for mass spectrometry imaging. Each pixel in the mass spectrometry imaging is used to characterize the metabolic detection results of a single cell in a biological sample. The metabolic detection results include the signal intensity of at least one metabolite ion, such as... Figure 5 As shown, the device may include a feature vector extraction module 501, a clustering module 502, a filling module 503, and a fractal module 504, specifically:
[0139] The feature vector extraction module 501 is used to obtain the feature vector of the pixel based on the metabolic detection result of the pixel.
[0140] Clustering module 502 is used to cluster each pixel according to the feature vector of each pixel to obtain multiple clusters, each cluster including at least one pixel.
[0141] The filling module 503 is used to take pixels whose clusters are not determined as target pixels, and determine the cluster to which the target pixel belongs based on the distance and composition similarity between the target pixel and other pixels within a preset range, as well as the clusters to which the other pixels belong.
[0142] The classification module 504 is used to determine the spatial region classification result based on the cluster to which each pixel belongs.
[0143] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0144] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of a spatial region classification method for mass spectrometry imaging. Compared with related technologies, this method can achieve the following: obtaining the feature vector of a pixel based on the metabolic detection results of the pixel; clustering the pixels based on the feature vector of each pixel to obtain multiple clusters; since some pixels cannot be classified during the clustering process, the cluster of the target pixel is determined by the clusters of other pixels within a preset range around it and the clustering and composition similarity between other pixels and the target pixel, which can enhance the accuracy of clustering and produce spatial classification results with low noise and consistent with the real biological tissue morphology.
[0145] In one alternative embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.
[0146] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0147] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0148] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0149] The memory 4003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 4001. The processor 4001 executes the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0150] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.
[0151] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0152] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.
[0153] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0154] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A method for spatial region classification of mass spectrometry imaging, characterized in that, Each pixel in the mass spectrometry imaging image is used to characterize the metabolic detection result of a single cell in a biological sample, the metabolic detection result including the signal intensity of at least one metabolite ion, and the method includes: Based on the metabolic detection results of the pixel, the feature vector of the pixel is obtained; Based on the feature vector of each pixel, the pixels are clustered to obtain multiple clusters, and each cluster includes at least one pixel. Pixels whose clusters are not yet determined are taken as target pixels. The cluster to which the target pixel belongs is determined based on the distance and compositional similarity between the target pixel and other pixels within a preset range, as well as the clusters to which the other pixels belong. The spatial region classification result is determined based on the cluster to which each pixel belongs; The step of determining the cluster to which the target pixel belongs based on the distance and compositional similarity between the target pixel and other pixels within a preset range, as well as the cluster to which the other pixels belong, includes: Sort the distances between the target pixel and each other pixel to determine the sorting result of each other pixel; The corresponding weights are obtained based on the sorting results of the other pixels, and the weights are proportional to the sorting results. The correlation between the other pixels and the target pixel is obtained based on the weights of the other pixels and the composition similarity. The composition similarity is the similarity between the types of metabolite ions contained in the target pixel and other pixels or the similarity between the feature vectors of the target pixel and other pixels. The cluster in which the target pixel belongs is determined based on the cluster in which the other pixels with the highest correlation belong.
2. The method according to claim 1, characterized in that, The step of obtaining the feature vector of the pixel based on the metabolic detection result of the pixel includes: Based on the signal intensity of the metabolite ions in each cell, the distribution of the signal intensity of the metabolite ions is determined. The signal intensity of the metabolite ions is then clipped based on the distribution. The clipped signal intensity is then normalized to obtain the updated signal intensity of the metabolite ions. The updated signal intensity of each metabolite ion corresponding to the pixel is used as the initial feature vector of the pixel. The initial feature vector is then subjected to dimensionality reduction processing to obtain the feature vector of the pixel. The feature vector is used to characterize the difference in metabolite ion composition between the pixel and other pixels.
3. The method according to claim 2, characterized in that, The step of determining the distribution of the signal intensity of the metabolite ions based on their signal intensity in each cell, and then cropping the signal intensity of the metabolite ions based on this distribution, includes: For each metabolite ion, the data is divided into equal-width bins based on the signal intensity of the metabolite ion in each cell. Each bin is used to count the proportion of cells within a certain signal intensity range to the total number of cells. Based on the proportions of each sub-compartment, an upper limit for the signal intensity of the metabolite ions is determined, and the signal intensity of the metabolite ions is then trimmed according to the upper limit.
4. The method according to claim 2, characterized in that, The step of clustering pixels based on their feature vectors to obtain multiple clusters includes: Determine the similarity between the feature vectors of each pair of pixels; A similarity matrix is obtained based on the similarity between the feature vectors of each pair of pixels. The elements in the similarity matrix are used to characterize the similarity between the feature vectors of each pair of pixels. Elements in the similarity matrix with similarity greater than a similarity threshold are taken as target elements. A relationship network graph is constructed based on the target elements. Two nodes with a connection relationship in the relationship network graph are used to represent two pixels in a target element. The nodes in the relational network graph are clustered according to a preset graph clustering algorithm.
5. The method according to claim 3, characterized in that, The step of determining the upper limit of the signal intensity of the metabolite ions based on the proportions corresponding to each sub-compartment includes: Based on the signal strength range from small to large, the proportions corresponding to each sub-box are accumulated. When the accumulated value reaches a preset value, the minimum signal strength in the sub-box corresponding to the last accumulated proportion is taken as the upper limit value.
6. The method according to claim 1, characterized in that, The step of determining the spatial region classification result based on the cluster of each pixel after traversal includes: The feature vectors of each pixel are reduced to three-dimensional feature vectors, and the position of the pixel in the three-dimensional virtual space is determined based on the three-dimensional feature vectors. Determine the display style of each cluster in the three-dimensional virtual space; Based on the position of each pixel in the three-dimensional space system and the display style corresponding to the cluster to which the pixel belongs, a three-dimensional rendering is drawn as the spatial region classification result.
7. A spatial region classification device for mass spectrometry imaging, characterized in that, Each pixel in the mass spectrometry imaging image is used to characterize the metabolic detection result of a single cell in a biological sample, the metabolic detection result including the signal intensity of at least one metabolite ion, and the device includes: The feature vector extraction module is used to obtain the feature vector of the pixel based on the metabolic detection results of the pixel. The clustering module is used to cluster each pixel according to the feature vector of each pixel to obtain multiple clusters, and each cluster includes at least one pixel. The filling module is used to take pixels whose clusters are not determined as target pixels, and determine the cluster to which the target pixel belongs based on the distance and composition similarity between the target pixel and other pixels within a preset range, as well as the clusters to which the other pixels belong. The classification module is used to determine the spatial region classification result based on the cluster to which each pixel belongs; Specifically, the filling module is used in the following applications: Sort the distances between the target pixel and each other pixel to determine the sorting result of each other pixel; The corresponding weights are obtained based on the sorting results of the other pixels, and the weights are proportional to the sorting results. The correlation between the other pixels and the target pixel is obtained based on the weights of the other pixels and the composition similarity. The composition similarity is the similarity between the types of metabolite ions contained in the target pixel and other pixels or the similarity between the feature vectors of the target pixel and other pixels. The cluster in which the target pixel belongs is determined based on the cluster in which the other pixels with the highest correlation belong.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the spatial region classification method for mass spectrometry imaging as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the spatial region classification method for mass spectrometry imaging as described in any one of claims 1-6.
Citation Information
Patent Citations
Interactive space segmentation method for mass spectrum imaging data
CN114494175A
System and method for analyzing tissue intra-operatively using mass spectrometry
US20160341712A1