A method and system for identifying spatially clustered ions in mass spectrometry imaging data
By preprocessing, reducing dimensions, and dividing image blocks into mass spectrometry imaging data, constructing sampling probabilities for downsampling and calculating correlation coefficients, the problem of low efficiency and low accuracy of the Mantel Test method in mass spectrometry imaging data is solved, achieving more efficient and accurate spatial cluster ion identification and expanding the application scope.
Patent Information
- Application Number
- CN202411538584.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing Mantel Test method is inefficient and inaccurate in identifying spatially clustered ions in mass spectrometry imaging data, making it difficult to adapt to the complexity and high dimensionality of mass spectrometry imaging data.
By preprocessing, reducing the dimension, randomly permuting the pixel positions, and dividing the image into blocks, sampling probabilities are constructed for downsampling, and correlation coefficients and spatial clustering scores are calculated to screen out biologically significant ion images.
It improves the efficiency and accuracy of mass spectrometry imaging data analysis, enabling more accurate identification of spatially clustered ions and reducing computation time. It is also applicable to other spatial imaging data such as spatial transcriptomics and spatial proteomics.
Smart Images

Figure CN119400275B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of mass spectrometry imaging processing technology, and particularly relates to a method and system for identifying spatially clustered ions in mass spectrometry imaging data. BACKGROUND
[0002] Mass spectrometry imaging (MSI) is a new biological detection technology developed in the early of this century. Compared with traditional gas chromatography-mass spectrometry and liquid chromatography-mass spectrometry techniques, MSI technology does not require homogenization of biological tissues, and can provide spatial location information that other mass spectrometry techniques cannot obtain while preserving the integrity of biological tissues. During data acquisition, MSI technology can analyze lipids, polysaccharides, amino acids, oligonucleotides, polypeptides, metabolites, and proteins in situ in biological tissues, and obtain spatial distribution and relative abundance information of these molecules in tissue samples. This capability makes MSI technology widely used in spatial heterogeneity analysis of biological tissues.
[0003] Spatially clustered ions refer to ions with a clear spatial structure in the tissue space. According to spatially clustered ions, the interaction relationship of metabolic processes can be analyzed, and they are important research objects of MSI data analysis. Through spatially clustered ion identification, researchers can effectively identify and eliminate spatial noise or non-specific signals, thereby significantly reducing the complexity of data analysis. In addition, this analysis can help identify molecular markers related to specific pathological states or physiological processes, which is of great significance to the study of tissue heterogeneity. Therefore, spatially clustered ion identification not only improves the efficiency of MSI data analysis, but also plays an important role in the field of medical research.
[0004] In statistics, the existence of spatially clustered ions is usually manifested as a strong correlation between their spatial position matrix and intensity distribution matrix. Traditional correlation coefficients are only suitable for analyzing the correlation between variables within a single data matrix, and are not sufficient for correlation analysis between two independent matrices. The Mantel Test analysis method proposed by Nathan Mantel, a biostatistician at the National Institutes of Health in the United States in 1967, provides a solution. This method first calculates the distance matrix of the two data matrices, then flattens the distance matrix into a one-dimensional array and calculates the correlation between the two arrays. To verify the significance of this correlation, Mantel Test uses permutation test: by randomly permuting the columns or rows of the matrix multiple times, the correlation is recalculated, and the actual data correlation is compared with the correlation distribution obtained after random permutation. If the actual correlation is significantly higher than the random permutation result, it indicates that there is a significant correlation between the two matrices. Using this method, the correlation between the spatial position matrix and the intensity distribution matrix can be effectively evaluated.
[0005] Although the Mantel Test analysis method provides an effective statistical tool for correlation analysis between two matrices, it is not designed specifically for MSI data. MSI data has the characteristics of low signal-to-noise ratio and high dimensionality, which makes it difficult to directly use the Mantel Test for MSI data to identify spatially clustered ions, resulting in low time efficiency and low accuracy. Therefore, it is urgent to develop a new method that can reflect the spatial correlation of MSI data and adapt to its complexity and high efficiency of data processing. SUMMARY
[0006] To solve the above problems, the present application provides a method for identifying spatially clustered ions in mass spectrometry imaging data, which improves the analysis efficiency and accuracy of mass spectrometry imaging data and further promotes the application of mass spectrometry imaging technology in biomedical research.
[0007] In one aspect, a method for identifying spatially clustered ions in mass spectrometry imaging data is provided, comprising the following steps:
[0008] S1, preprocessing the mass spectrometry imaging data to obtain an original ion image set; dimensionality reduction of the original ion image set to obtain an embedded ion image set;
[0009] S2, performing position random permutation on the pixels of each ion image in the original ion image set to obtain a randomized ion image set;
[0010] S3, dividing all ion images in the original ion image set, all ion images in the embedded ion image set and all ion images in the randomized ion image set into image blocks in the same way to obtain an original ion image block set, an embedded ion image block set and a randomized ion image block set; when dividing the image blocks, each ion image is divided into image blocks of the same size and number;
[0011] S4, constructing a sampling probability based on the embedded ion image block set, and using the sampling probability to downsample the pixel points of each ion image block in the original ion image block set and the randomized ion image block set to obtain an original ion image downsampled set and a randomized ion image downsampled set;
[0012] S5, constructing a correlation coefficient of a single image block of a single ion image in the original ion image downsampled set; constructing a correlation coefficient of an image block at the same position as the single ion image in the original ion image downsampled set in the randomized ion image downsampled set; and constructing a spatial clustering score of the single ion image based on the two correlation coefficients;
[0013] S6, repeating step S5, calculating the spatial clustering score of all ion images in the original ion image down-sampling set and the randomized ion image down-sampling set, screening ion images greater than a preset threshold, and obtaining a screened ion image set.
[0014] Preferably, the mass spectrometry imaging data is pre-processed, specifically including:
[0015] Spectrum peak alignment, aligning ion spectrum peaks of each pixel of the mass spectrometry imaging data with reference peaks, and correcting mass-to-charge ratio drift of each ion peak; the reference peak is a spectrum peak having the highest correlation with other ion peaks;
[0016] Spectrum peak extraction, retaining spectrum peaks meeting a set intensity and being at local maximum; the set intensity is determined based on noise intensity; the noise intensity is determined by a median absolute deviation method;
[0017] Image standardization operation.
[0018] Preferably, in S2, the positions of pixels of each ion image in the original ion image set are randomly replaced to obtain a randomized ion image set, and the specific steps are as follows:
[0019] S21, using a clustering method to divide the original ion image set into a background region and a tissue region;
[0020] S22, extracting pixels of the tissue region in the ion images of the original ion image set, and performing position random replacement, while keeping the number of pixels of each ion image unchanged;
[0021] S23, repeating step S22 until position random replacement of all ion images is completed, and a randomized ion image set is obtained.
[0022] Preferably, in S3, a sliding window method is used to divide all ion images in the original ion image set, the embedded ion image set and the randomized ion image set into image blocks.
[0023] Preferably, in S4, the sampling probability is constructed based on the embedded ion image block set, specifically as follows:
[0024] The standard deviation of the kth image block in the embedded ion image block set is obtained as follows:
[0025]
[0026] wherein j represents the jth embedded ion image, j=(1, 2,.., n); n represents the embedding dimension; e j,k represents the kth image block of the jth ion image in the embedded image block set; σ represents the standard deviation; K represents the total number of image blocks in a single ion image;
[0027] The sampling probability of the k-th image patch in the ion image patch set is constructed based on the standard deviation, as follows:
[0028]
[0029] Preferably, in S4, the number of sampling points for downsampling is expressed as follows:
[0030] S k =w 2 ×ρ k
[0031] Where w represents the number of pixels in the sliding window; S k This represents the number of sampling points in the k-th image patch.
[0032] Preferably, in S5, the correlation coefficient of a single image patch of a single ion image in the original ion image downsampling set is constructed; the correlation coefficient of the image patch at the same position of a single ion image in the randomized ion image downsampling set and the original ion image downsampling set is constructed, specifically as follows:
[0033] Calculate the i-th ion image and the k-th image patch m of the original ion image downsampled set M. i,k The signal strength difference between any two sampling points a and b and spatial distance And calculate the correlation coefficient between the signal strength difference at the sampling points and the spatial distance, expressed as:
[0034]
[0035] in, This represents the correlation coefficient between the signal intensity difference and spatial distance of the sampling points of the k-th image block in the i-th ion image in the original ion image downsampling set M; i = (1, 2, ..., N), where N represents the number of ion images; cor represents the Spearman correlation coefficient calculation function; m i,k,a m i,k Signal strength value at sampling point a; m i,k,b m i,k Signal strength value at sampling point b; x a y represents the x-coordinate of a; a The ordinate of a; x b The x-coordinate of b, y b The ordinate of b represents the coordinate of b.
[0036] Two sampling points c and d of the randomized ion image down-sampling set; c matches the spatial position of a in the image block, and d matches the spatial position of b in the image block; the correlation coefficient between the signal intensity difference and the spatial distance of the sampling points in the kth image block of the ith ion image of the randomized ion image down-sampling set R is calculated, denoted as:
[0037]
[0038] wherein, r i,k,c represents the signal intensity value of the c sampling point in r i,k ; r i,k,d represents the signal intensity value of the d sampling point in r i,k ; x c represents the horizontal coordinate of c; y c represents the vertical coordinate of c; x d represents the horizontal coordinate of d; y d represents the vertical coordinate of d.
[0039] Preferably, the spatial clustering score of the ith ion image is the sum of the absolute values of the correlation coefficient differences of all image blocks in the original ion image down-sampling set M and the randomized ion image down-sampling set R, denoted as:
[0040]
[0041] wherein, || represents the absolute value; K represents the total number of image blocks in a single ion image.
[0042] On the other hand, a system for identifying spatially clustered ions in mass spectrometry imaging data comprises the following:
[0043] A data preprocessing module for preprocessing mass spectrometry imaging data to obtain an original ion image set; dimensionality reduction is performed on the original ion image set to obtain an embedded ion image set;
[0044] A pixel position random permutation module for randomly permuting the positions of the pixels of each ion image in the original ion image set to obtain a randomized ion image set;
[0045] An image block division module for dividing all ion images in the original ion image set, all ion images in the embedded ion image set and all ion images in the randomized ion image set in the same way to obtain an original ion image block set, an embedded ion image block set and a randomized ion image block set; when performing image block division, each ion image is divided into image blocks of the same size and number;
[0046] The downsampling module is configured to construct a sampling probability based on the embedded ion image block set, and to perform downsampling on the pixel points of each ion image block in the original ion image block set and the randomized ion image block set respectively using the sampling probability, so as to obtain an original ion image downsampling set and a randomized ion image downsampling set.
[0047] The spatial clustering score construction module is configured to construct a correlation coefficient of a single image block of a single ion image in the original ion image downsampling set, and to construct a correlation coefficient of an image block at the same position as the single ion image in the randomized ion image downsampling set, and to construct a spatial clustering score of the single ion image based on the two correlation coefficients.
[0048] The ion image screening module is configured to repeatedly execute the spatial clustering score construction module to calculate the spatial clustering scores of all ion images in the original ion image downsampling set and the randomized ion image downsampling set, and to screen ion images greater than a preset threshold to obtain a screened ion image set.
[0049] Compared with the prior art, the present application has the following beneficial effects:
[0050] (1) The present application uses the correlation between the signal intensity difference of the pixels in the mass spectrometry imaging ion image and their spatial distance as a measure of the spatial clustering degree, which fully extracts the spatial distribution characteristics of the signal intensity.
[0051] (2) The present application performs dimensionality reduction on the mass spectrometry imaging data, which not only concentrates the information of the mass spectrometry imaging data, but also reduces the amount of calculation data and improves the calculation efficiency; at the same time, it can also identify the spatial clustering ions in the local region for different tissue regions.
[0052] (3) The method for identifying spatial clustering ions in mass spectrometry imaging data of the present application has wide applicability, which is not only suitable for the analysis of mass spectrometry imaging data, but also suitable for other spatial imaging data, including spatial transcriptomics and spatial proteomics data. BRIEF DESCRIPTION OF DRAWINGS
[0053] The present application will be further described in detail below with reference to the accompanying drawings;
[0054] Figure 1 The flowchart of the method for identifying spatial clustering ions in mass spectrometry imaging data of the embodiment of the present application;
[0055] Figure 2 The framework diagram of the method for identifying spatial clustering ions in mass spectrometry imaging data of the embodiment of the present application;
[0056] Figure 3The method for identifying spatially clustered ions in mass spectrometry imaging data of the embodiment of the present application is used for mass spectrometry imaging data of a rat brain; wherein the cluster score threshold is 1.732;
[0057] Figure 4 The method for identifying spatially clustered ions in mass spectrometry imaging data of the embodiment of the present application is used for mass spectrometry imaging data of a rat brain, and the comparison result of the identification situation with the Mantel Test method;
[0058] Figure 5 The method for identifying spatially clustered ions in mass spectrometry imaging data of the embodiment of the present application is used for mass spectrometry imaging data of a rat brain, and the comparison result of the time consumption with the Mantel Test method;
[0059] Figure 6 The structural block diagram of the system for identifying spatially clustered ions in mass spectrometry imaging data of the embodiment of the present application. DETAILED DESCRIPTION
[0060] The present application is further described below through a specific embodiment.
[0061] Referring to Figure 1 and Figure 2 , a method for identifying spatially clustered ions in mass spectrometry imaging data includes the following steps:
[0062] S1, pre-processing the mass spectrometry imaging data to obtain an original ion image set; dimension reduction is performed on the original ion image set to obtain an embedded ion image set.
[0063] The MSI data is pre-processed by peak alignment, peak extraction and image standardization to obtain pre-processed MSI data M X×Y×N , wherein X and Y are the number of horizontal and vertical pixel points of the ion image, respectively, and N is the number of ions; and the MSI data M X×Y×N is dimensionally reduced to obtain a low-dimensional embedded image E X×Y×n , and n is the embedding dimension. The pre-processed MSI data matrix M X×Y×N and the low-dimensional embedded MSI data matrix E X×Y×n respectively represent the form of the ion image set, which are respectively: the original ion image set M0={m i ,i=1,2,…,N} and the embedded ion image set E0={e j ,j=1,2,…,n};
[0064] Exemplarily, the mass spectrometry imaging data pre-processing of the embodiment is as follows:
[0065] Peak alignment: aligning the ion peaks of each pixel of MSI data with reference peaks, correcting the mass-to-charge ratio drift of each ion peak. Among them, the peak with the highest correlation with other ion peaks in the spectrum peak is selected as the reference peak;
[0066] Peak extraction: the peaks that meet the following two conditions are retained to realize peak extraction: first, the intensity of the peak is more than twice the noise intensity, wherein the noise intensity is determined by the median absolute deviation method; second, within a 10 ppm window, the peak is at a local maximum;
[0067] Image standardization: in order to prevent the influence of abnormally high expression signal values on the overall picture, set the pixel value greater than the 95th percentile to the 95th percentile value, and do maximum and minimum value normalization. The final preprocessed MSI data matrix M 75×100×2165 is 2165 75x100 ion images, that is, the original ion image set M0={m i ,i=1,2,...,2165}, wherein each ion image is 75x100 pixels.
[0068] Exemplarily, the dimension reduction of the embodiment is as follows:
[0069] The MSI data is dimensionally reduced using the Python script UMAP package to obtain the low-dimensional embedded MSI data matrix E 75×100×3 , that is, the embedded ion image set E0={e j ,j=1,2,...,3}, wherein the hyperparameters used by the algorithm are n_neighbors=10, n_components=3, and metric='cosine'.
[0070] S2, randomly permuting the positions of the pixels of each ion image in the original ion image set to obtain a randomized ion image set.
[0071] S21, using a clustering method to divide the original ion image set M0 into a background region and a tissue region, and obtaining the spatial position of the tissue region;
[0072] S22, extracting the pixels of the tissue region in the ion image and randomly permuting the positions, while keeping the number of pixels of each ion image unchanged;
[0073] S23, repeating the above steps until the position randomization of all ion images is completed, to obtain the randomized MSI data matrix R X×Y×N , or the randomized ion image set R0={r i ,i=1,2,...,N}.
[0074] Exemplarily, the ion image space randomization of the embodiment is as follows:
[0075] The original ion image set M0 was segmented into background and tissue regions using the K-means clustering method in the Scikit-learn package of Python scripts, and the spatial location of the tissue regions was obtained.
[0076] Taking i=1 as an example, extract the pixels of the tissue region in the ion image m1;
[0077] The random.shuffle function in the numpy package of Python scripts is used to randomly permutate the positions of the pixels extracted in step S21, while keeping the number of pixels in each ion image unchanged;
[0078] Repeat the steps of extracting pixels from tissue regions and performing random position permutations until all ion images have undergone random position permutations, resulting in a randomized MSI data matrix R. 75×100×2165 That is, the randomized ion image set R = {(r i ), i = 1, 2, ..., 2165}.
[0079] S3, divide all ion images in the original ion image set, all ion images in the embedded ion image set, and all ion images in the randomized ion image set into image blocks in the same way to obtain the original ion image block set, the embedded ion image block set, and the randomized ion image block set; when dividing the image blocks, the size and number of image blocks for each ion image are the same.
[0080] Using the sliding window method, all ion images in the original ion image set M0, the randomized ion image set R0, and the embedded ion image set E0 are simultaneously divided into K image blocks, resulting in image block sets: M1 = {m i,k ,i=1,2,…,N;k=1,2,…,K}, R1={r i,k ,i=1,2,…,N;k=1,2,…,K} and E1={e j,k ,j=1,2,…,n;k=1,2,…,K}.
[0081] For example, the ion image block division in this embodiment is as follows:
[0082] Using the sliding window method, all ion images in the original ion image set M0, the randomized ion image set R0, and the embedded ion image set E0 are simultaneously divided into 3 rows and 4 columns of image blocks, i.e., 12 image blocks, resulting in image block sets:
[0083] M1={m i,k ,i=1,2,…,2165;k=1,2,…,12}
[0084] R1={ri,k i = 1, 2, …, 2165; k = 1, 2, …, 12
[0085] E1 = {e j,k j = 1, 2, …, 3; k = 1, 2, …, 12}.
[0086] S4, based on the embedded ion image block set construction sampling probability, using the sampling probability of the original ion image block set and the random ion image block set in each ion image block pixel points are respectively down-sampling, get the original ion image down-sampling set and random ion image down-sampling set.
[0087] The standard deviation of each image block in the embedded ion image block set E1 is calculated And the proportion of the standard deviation of the image block k As the sampling probability of the image block k, the pixel points of each image block in the original ion image block set M1 and the random ion image block set R1 are randomly down-sampled, and the down-sampled data set is obtained:
[0088] M = {m i,k,s i = 1, 2, …, N; k = 1, 2, …, K; s = 1, 2, …, S k}
[0089] R = {r i,k,s i = 1, 2, …, N; k = 1, 2, …, K; s = 1, 2, …, S k}
[0090] Wherein, S k is the sampling point number of the kth image block, and the specific calculation formula is: S k = w 2 × ρ k , wherein, w is the pixel point number of the sliding window.
[0091] Exemplary, the image block pixel down-sampling of the embodiment is as follows:
[0092] The standard deviation σ of each image block in the embedded ion image block set E1 is calculated k , the specific calculation formula is:
[0093] The proportion of the standard deviation of the image block k As the sampling probability of the image block k, the pixel points of each image block in the original ion image block set M1 and the random ion image block set R1 are randomly down-sampled, and the down-sampled data set is obtained:
[0094] M = {m i,k,s i = 1, 2, …, 2165; k = 1, 2, …, 12; s = 1, 2, …, S k}
[0095] R = {r i,k,s , i = 1, 2, …, 2165; k = 1, 2, …, 12; s = 1, 2, …, S k}
[0096] where S k = w 2 × p k , w is 20 in this embodiment.
[0097] S5, constructing the correlation coefficient of a single image block of a single ion image in the original ion image down-sampling set; constructing the correlation coefficient of an image block at the same position as the single ion image in the original ion image down-sampling set in the randomized ion image down-sampling set; and constructing the spatial clustering score of the single ion image based on the two correlation coefficients.
[0098] Let the correlation coefficient between the intensity difference and the spatial distance of the sampling pixels in the kth image block of the ith ion image in the original ion image down-sampling set M and the randomized ion image down-sampling set R be and The spatial clustering score of the ith ion image is defined as the sum of the absolute values of the correlation coefficient differences of all image blocks of the ith ion image in the original ion image down-sampling set M and the randomized ion image down-sampling set R, i.e., The specific steps are as follows:
[0099] S51, calculating the signal intensity difference i,k and the spatial distance of any two sampling points a and b in the kth image block m of the ith ion image in the original ion image down-sampling set M, and calculating the correlation coefficient between the signal intensity difference and the spatial distance of the sampling points:
[0100]
[0101] where cor(·) is the Spearman correlation coefficient calculation function, and The specific calculation formula is:
[0102]
[0103] where m i,k,a represents the signal intensity value of the a sampling point in m i,k , m i,k,b represents the signal intensity value of the b sampling point in m i,k , (x a , y brespectively represent the horizontal and vertical coordinates of a, (x b ,y b ) respectively represent the horizontal and vertical coordinates of b;
[0104] S52, two sampling points c, d of the randomized ion image down-sampling set are randomized; c matches the spatial position of a in the image block, and d matches the spatial position of b in the image block. Similarly, the signal intensity difference between any two sampling points a, b of the kth image block r i,k of the ith ion image of the randomized ion image down-sampling set R is calculated, and the correlation coefficient between the signal intensity difference and the spatial distance of the sampling points is represented as:
[0105]
[0106] And The specific calculation formula is:
[0107]
[0108] Wherein, r i,k,c represents the signal intensity value of the c sampling point in r i,k , r i,k,d represents the signal intensity value of the d sampling point in r i,k , (x c ,y c ) represents the horizontal and vertical coordinates of c, (x d ,y d ) represents the horizontal and vertical coordinates of d;
[0109] S53, the spatial clustering score of the ith ion image is calculated as: the sum of the absolute values of the correlation coefficient differences of all image blocks m i and r i in the original ion image down-sampling set M and the randomized ion image set R, that is:
[0110]
[0111] Wherein, the higher the clustering score g i , the more obvious the spatial structure of the ion image, and the more biologically meaningful.
[0112] For example, the ion image spatial clustering degree of the embodiment is specifically as follows:
[0113] Taking i=1, k=1 as an example, the signal intensity difference 1,1 and the spatial distance between any two sampling points a, b of the first ion image of the first image block m of the original ion image down-sampling set M are calculated, and the correlation coefficient between the signal intensity difference and the spatial distance of the sampling points is calculated.
[0114]
[0115] wherein cor(·) is a Spearman correlation coefficient calculation function, and The specific calculation formula of is:
[0116]
[0117] wherein m 1,1,a represents the signal intensity value of the a sampling point in m 1,1 , n 1,1,b represents the signal intensity value of the b sampling point in m 1,1 , (x a , y a ) represents the horizontal and vertical coordinates of a, and (x b , y b ) represents the horizontal and vertical coordinates of b.
[0118] Similarly, the signal intensity difference and the spatial distance between the sampling points in the first image block r 1,1 of the first ion image of the randomized ion image down-sampling set R are calculated, and the correlation coefficient between the signal intensity difference and the spatial distance is calculated.
[0119]
[0120] and The specific calculation formula of is:
[0121]
[0122] wherein r 1,1,c represents the signal intensity value of the c sampling point in r i,1 , r 1,1,d represents the signal intensity value of the d sampling point in r 1,1 , (x c , y c ) represents the horizontal and vertical coordinates of a, and (x d , y d ) represents the horizontal and vertical coordinates of d.
[0123] The correlation coefficients between the signal intensity difference and the spatial distance of different k values are calculated, and the spatial clustering score of the first ion image is calculated as the sum of the absolute values of the difference of the correlation coefficients of all image blocks of m1 in the original ion image down-sampling set M and r1 in the randomized ion image down-sampling set R, that is:
[0124] S6, repeating step S5, calculating the spatial clustering scores of all ion images in the original ion image down-sampling set and the randomized ion image down-sampling set, screening ion images greater than a preset threshold, and obtaining a screened ion image set.
[0125] Calculating the spatial clustering scores G = {g i , i = 1, 2, …, N} of all ion images, and sorting the ion images according to their clustering scores from high to low. According to actual problems, a clustering score threshold is set, ion images greater than the set threshold are retained, ion images with biological significance are screened, and a screened ion image set is obtained.
[0126] Exemplarily, the ion image screening of the embodiment is as follows:
[0127] The spatial clustering score of a single ion image in step S5 is repeated for all ion images until the spatial clustering scores G = {g i , i = 1, 2, …, 2165} of all ion images are obtained.
[0128] The spatial clustering scores G of all ion images are sorted from large to small, and the bit sequence of each ion image in the original ion image set M is obtained.
[0129] According to actual problems, the clustering score threshold is set to 1.732, ion images with a spatial clustering score greater than 1.732 are retained, and the number of screened spatial clustering ions is 42.
[0130] According to the embodiment of the present application, spatial clustering ion recognition is performed on MSI data of a rat brain, and the screened ions exhibit obvious spatial clustering characteristics. Figure 3 The ion results with a spatial clustering score greater than 1.732 in the MSI data of a rat brain are shown. The results show that the embodiment of the present application can objectively and effectively recognize spatial clustering ion images. Figure 4 and Figure 5 The comparison results of the embodiment of the present application and the Mantel Test method in recognition accuracy and time consumption are shown. The results show that the Mantel Test method makes an error in identifying non-clustering ions. For example, the spatial clustering score of m / z 1339.10, which has obvious spatial clustering characteristics, is calculated to be small, and it is misjudged as a spatial random ion. In contrast, the embodiment of the present application can more accurately and quickly determine spatial clustering ions. This is due to the image block pixel number simplification strategy proposed in the embodiment of the present application, thereby improving the efficiency of analysis.
[0131] In summary, the embodiment of the present application improves the Mantel Test analysis method proposed by predecessors according to the assumption that the intensity distribution and spatial position of spatially clustered ions should have strong correlation, and develops a new method for identifying spatially clustered ions in MSI data. The results show that the embodiment of the present application reduces the detection time while improving the detection efficiency. The embodiment of the present application provides researchers with an objective spatial aggregation ion screening method, and further expands the application of MSI technology in biomedical research.
[0132] The embodiment of the present application uses the correlation between the signal intensity difference of pixels in the MSI ion image and their spatial distance as a measure of spatial clustering degree, and fully extracts the spatial distribution characteristics of signal intensity.
[0133] The embodiment of the present application reduces the dimension of mass spectrometry imaging data, which not only concentrates the information of MSI data, but also reduces the calculation data and improves the calculation efficiency; at the same time, it can also identify the spatially clustered ions in the local area for different tissue regions.
[0134] It is worth mentioning that the method for identifying spatially clustered ions in mass spectrometry imaging data of the embodiment of the present application is not only suitable for the analysis of mass spectrometry imaging data, but also suitable for other spatial imaging data, such as spatial transcriptomics and spatial proteomics data, which is not limited by the embodiment.
[0135] Referring to Figure 6 The present application also discloses a system for identifying spatially clustered ions in mass spectrometry imaging data, comprising:
[0136] The data preprocessing module 601 is used for preprocessing the mass spectrometry imaging data to obtain a set of original ion images; and reducing the dimension of the set of original ion images to obtain a set of embedded ion images;
[0137] The pixel position random permutation module 602 is used for randomly permuting the positions of pixels of each ion image in the set of original ion images to obtain a set of randomized ion images;
[0138] The image block division module 603 is used for dividing all ion images in the set of original ion images, all ion images in the set of embedded ion images and all ion images in the set of randomized ion images in the same way to obtain a set of original ion image blocks, a set of embedded ion image blocks and a set of randomized ion image blocks; when dividing the image blocks, the size and number of image blocks of each ion image are the same;
[0139] The downsampling module 604 is configured to construct a sampling probability based on the embedded ion image block set, and use the sampling probability to downsample pixel points of each ion image block in the original ion image block set and the randomized ion image block set respectively, to obtain an original ion image downsampled set and a randomized ion image downsampled set.
[0140] The spatial cluster score construction module 605 is configured to construct a correlation coefficient of a single image block of a single ion image in the original ion image downsampled set, construct a correlation coefficient of an image block at the same position as the single ion image in the original ion image downsampled set in the randomized ion image downsampled set, and construct a spatial cluster score of the single ion image based on the two correlation coefficients.
[0141] The ion image screening module 606 is configured to repeatedly execute the spatial cluster score construction module, calculate spatial cluster scores of all ion images in the original ion image downsampled set and the randomized ion image downsampled set, screen ion images greater than a preset threshold, and obtain a screened ion image set.
[0142] A specific implementation of a system for identifying spatially clustered ions in mass spectrometry imaging data is the same as a method for identifying spatially clustered ions in mass spectrometry imaging data, and the embodiment will not be repeated.
[0143] The above is only a specific implementation of the present application, but the design concept of the present application is not limited thereto, and any non-essential modification of the present application using this concept shall be deemed to be an infringement of the protection scope of the present application.
Claims
1. A method for identifying spatially clustered ions in mass spectrometry imaging data, characterized in that, The method comprises the following steps: S1, preprocessing mass spectrometry imaging data to obtain an original ion image set; dimension reduction is performed on the original ion image set to obtain an embedded ion image set; S2, performing position random permutation on the pixels of each ion image in the original ion image set to obtain a randomized ion image set; S3, dividing all ion images in the original ion image set, all ion images in the embedded ion image set and all ion images in the randomized ion image set into image blocks in the same way to obtain an original ion image block set, an embedded ion image block set and a randomized ion image block set; when performing image block division, each ion image is divided into image blocks of the same size and number; S4, constructing a sampling probability based on the embedded ion image block set, and using the sampling probability to down-sample the pixel points of each ion image block in the original ion image block set and the randomized ion image block set to obtain an original ion image down-sampling set and a randomized ion image down-sampling set; S5, constructing a correlation coefficient of a single image block of a single ion image in the original ion image down-sampling set; constructing a correlation coefficient of an image block at the same position as the single ion image in the original ion image down-sampling set in the randomized ion image down-sampling set; and constructing a spatial clustering score of the single ion image based on the two correlation coefficients; S6, repeating step S5 to calculate the spatial clustering scores of all ion images in the original ion image down-sampling set and the randomized ion image down-sampling set, and screening ion images greater than a preset threshold to obtain a screened ion image set; In S5, the correlation coefficient of a single image block of a single ion image in the original ion image down-sampling set is constructed; the correlation coefficient of an image block at the same position as the single ion image in the original ion image down-sampling set in the randomized ion image down-sampling set is constructed, and the specific steps are as follows: calculating the signal intensity difference between any two sampling points a, b i,k of the i-th ion image of the M down-sampled set of original ion images and the spatial distance and calculating the correlation coefficient between the signal intensity difference and the spatial distance of the sampling points, denoted as: wherein, represents the correlation coefficient between the signal intensity difference and the spatial distance of the sampling points of the kth image block in the ith ion image in the original ion image down-sampling set M; i = (1, 2,.., N), N represents the number of ion images; cor represents the Spearman correlation coefficient calculation function; m i,k,a represents the signal intensity value of the a sampling point in m i,k i,k,b represents the signal intensity value of the a sampling point in m i,k a represents the horizontal coordinate of a; y a represents the vertical coordinate of a; x b represents the horizontal coordinate of b; y b represents the vertical coordinate of b; The two sampling points of the randomized ion image down-sampling set are c and d; the spatial positions of c and a in the image block match, and the spatial positions of d and b in the image block match; the correlation coefficient between the signal intensity difference and the spatial distance of the sampling points in the kth image block of the ith ion image of the randomized ion image down-sampling set R is calculated, and is denoted as: wherein r i,k,c represents the signal intensity value at the r i,k th sample point in c; r i,k,d represents the signal intensity value at the r i,k th sample point in d; x c represents the abscissa of c; y c represents the ordinate of c; x d represents the abscissa of d; y d represents the ordinate of d; The spatial clustering score of the ith ion image is the sum of the absolute values of the correlation coefficient differences of all image blocks in the original ion image down-sampling set M and the randomized ion image down-sampling set R, and is denoted as: Wherein, || represents the absolute value; K represents the total number of image blocks in a single ion image.
2. The method for identifying spatially clustered ions in mass spectrometry imaging data according to claim 1, characterized in that, The preprocessing of the mass spectrometry imaging data specifically comprises: Spectrum peak alignment, aligning the ion spectrum peaks of each pixel of the mass spectrometry imaging data with reference peaks to correct the mass-to-charge ratio drift of each ion peak; the reference peak is the spectrum peak with the highest correlation with other ion peaks; Spectrum peak extraction, retaining the spectrum peaks meeting the set intensity and being at local maximum; the set intensity is determined based on the noise intensity; the noise intensity is determined by the median absolute deviation method; Image standardization operation.
3. The method for identifying spatially clustered ions in mass spectrometry imaging data according to claim 1, wherein, In S2, the pixels of each ion image in the original ion image set are subjected to position random permutation to obtain a randomized ion image set, and the specific steps are as follows: S21, using a clustering method to segment the original ion image set into background regions and tissue regions; S22, extracting the pixels of the tissue regions in the ion images of the original ion image set and performing position random permutation, while keeping the number of pixels of each ion image unchanged; S23, repeating step S22 until the position random permutation of all ion images is completed, to obtain a randomized ion image set.
4. The method for identifying spatially clustered ions in mass spectrometry imaging data of claim 1, wherein, In S3, a sliding window method is used to divide the ion image blocks in the original ion image set, the embedded ion image set and the randomized ion image set.
5. The method for identifying spatially clustered ions in mass spectrometry imaging data of claim 1, wherein, In S4, the sampling probability is constructed based on the embedded ion image block set, specifically as follows: The standard deviation of the kth image block in the embedded ion image block set is obtained as follows: where j denotes the jth embedded ion image, j = (1, 2,.., n); n denotes the embedding dimension; e j,k denotes the kth image patch of the jth ion image in the set of embedded image patches; σ denotes the standard deviation; K denotes the total number of image patches in a single ion image; The sampling probability of the kth image block in the ion image block set is constructed based on the standard deviation as follows:
6. The method for identifying spatially clustered ions in mass spectrometry imaging data according to claim 5, characterized in that, In S4, the number of sampling points of the down-sampling is represented as: S k = w 2 x p k wherein w represents the number of pixel points of the sliding window; S k represents the number of sampling points of the kth image block.
7. A system for identifying spatially clustered ions in mass spectrometry imaging data using the method of any one of claims 1-6 for identifying spatially clustered ions in mass spectrometry imaging data, comprising the following: a data preprocessing module for preprocessing the mass spectrometry imaging data to obtain an original ion image set, and performing dimension reduction on the original ion image set to obtain an embedded ion image set; a pixel position random permutation module for performing position random permutation on the pixels of each ion image in the original ion image set to obtain a randomized ion image set; an image block division module for dividing all ion images in the original ion image set, all ion images in the embedded ion image set and all ion images in the randomized ion image set in the same way to obtain an original ion image block set, an embedded ion image block set and a randomized ion image block set, wherein the size and number of image blocks divided from each ion image are the same; a down-sampling module for constructing a sampling probability based on the embedded ion image block set, and using the sampling probability to down-sample the pixel points of each ion image block in the original ion image block set and the randomized ion image block set to obtain an original ion image down-sampling set and a randomized ion image down-sampling set; a spatial clustering score construction module for constructing a correlation coefficient of a single image block of a single ion image in the original ion image down-sampling set, constructing a correlation coefficient of an image block at the same position as the single ion image in the original ion image down-sampling set in the randomized ion image down-sampling set, and constructing a spatial clustering score of the single ion image based on the two correlation coefficients; an ion image screening module for repeatedly executing the spatial clustering score construction module to calculate the spatial clustering scores of all ion images in the original ion image down-sampling set and the randomized ion image down-sampling set, and screening ion images greater than a preset threshold to obtain a screened ion image set.
Citation Information
Patent Citations
Spectrometric analysis
CN107646089A
Method for identifying immune-related microorganisms in colorectal cancer based on multiple omics characteristics
CN115472214A