Isotope peak identification method, device and readable medium based on mass spectrometry imaging data
By constructing an ion image representation model based on SimSiam contrast learning network, preprocessing and training the mass spectrometry imaging data, and isotope peak recognition combined with mass-to-charge ratio and peak intensity ratio, the problem of low isotope peak recognition accuracy in the prior art is solved, and higher recognition performance and reliability of molecular annotation are achieved.
Patent Information
- Application Number
- CN202311030777.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-08-16
AI Technical Summary
The existing mass spectrometry imaging technology has problems such as high data accuracy requirements, insufficient spectral resolution and neglecting spatial distribution information in isotope peak recognition, resulting in low accuracy of isotope peak recognition.
The ion image representation model based on SimSiam contrast learning network is adopted, and the mass spectrometry imaging data is preprocessed and trained through the twin encoder, prediction mapper and dimensional reduction module. It combines mass-to-charge ratio and peak intensity ratio for isotope peak recognition. The mass spectrometry imaging data is processed using the data enhancement method, and the spatial distribution characteristics of ions are extracted and the low-dimensional representation is performed.
It improves the recognition accuracy of isotope peaks, provides higher recognition performance, and lays an important preliminary foundation for subsequent molecular annotation and biostatistic analysis.
Smart Images

Figure CN117274639B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mass spectrometry imaging (MSI) molecular annotation, and in particular to an isotope peak identification method, device and readable medium based on mass spectrometry imaging data. Background Art
[0002] Mass spectrometry imaging (MSI), a novel molecular imaging technique developed from mass spectrometry, is label-free, high-throughput, and information-rich. In recent years, it has been widely used in non-targeted spatial metabolomics. By obtaining molecular information and their spatial distribution from biological tissues, MSI can qualitatively, quantitatively, and locate molecules within them. It is widely used in the study of complex disease mechanisms, drug development, medical diagnostics, and systems biology.
[0003] Qualitative analysis is a prerequisite for functional analysis and also a major challenge in mass spectrometry. MSI data contain numerous isotope peaks, adduct ion peaks, polymers, and in-source cleavage fragments. Unlike liquid chromatography-mass spectrometry (LC-MS), MSI lacks chromatographic separation and cannot utilize retention time as auxiliary information for molecular annotation. Isotope peak identification is a crucial preliminary step in molecular annotation. By identifying monoisotopic peaks, redundant information in the mass spectra can be reduced, improving the reliability and accuracy of molecular annotation and ultimately leading to meaningful biological conclusions.
[0004] Currently, many isotope peak identification methods have been proposed for MSI. For example, the MetaSpace annotation platform uses theoretical isotope patterns to identify isotope peaks by measuring the similarity between experimental data and theoretical patterns, as well as the similarity between ion images. However, the method used by MetaSpace still has some limitations: on the one hand, this method requires the user's data to have high mass accuracy (<3ppm) and a spectral resolution higher than 70,000 (m / z 200). The lack of low-abundance ion information results in a small number of identified isotope peaks. On the other hand, when calculating ion image similarity, this method only uses the intensity relationship of ion signals and ignores spatial distribution information, resulting in large errors in the measurement of image similarity, which affects the effective identification of isotope peaks. Therefore, there is an urgent need to develop a more effective ion image similarity measurement method to improve the accuracy of isotope peak identification. Summary of the Invention
[0005] In response to the technical problems mentioned above, the purpose of the embodiments of this application is to propose an isotope peak identification method, device and readable medium based on mass spectrometry imaging data to solve the technical problems mentioned in the above background technology section, and to achieve low-dimensional representation of ion images in MSI data and improve the accuracy of isotope identification.
[0006] In a first aspect, the present invention provides a method for isotope peak identification based on mass spectrometry imaging data, comprising the following steps:
[0007] Acquiring mass spectrometry imaging data, preprocessing the mass spectrometry imaging data, and obtaining a mass spectrometry imaging ion image data matrix;
[0008] An ion image representation model based on the SimSiam contrastive learning network is constructed and trained. The ion image representation model includes a twin encoder, a prediction mapper, and a dimension reduction module. The twin encoder includes a first encoder module and a second encoder module that share weights. The first encoder module and the second encoder module are respectively connected to the prediction mapper, and the dimension reduction module is connected to the first encoder module. The twin encoder and the prediction mapper are trained to obtain a trained ion image representation model.
[0009] Inputting the mass spectrometry imaging ion image data matrix into the trained ion image representation model, and inputting the mass spectrometry imaging ion image data matrix into the first encoder module and the dimension reduction module in sequence to obtain a low-dimensional representation matrix of the mass spectrometry imaging data;
[0010] An ion peak set is obtained according to mass spectrometry imaging data, and an isotope peak recognition algorithm is used based on the ion peak set and the low-dimensional representation matrix of the mass spectrometry imaging data to identify the isotope relationship between the ions.
[0011] Preferably, the mass spectrometry imaging data is preprocessed, specifically including:
[0012] The top-hat method was used to perform baseline correction on mass spectrometry imaging data to obtain baseline-corrected mass spectrometry imaging data;
[0013] The peak with the highest correlation with other ion peaks is used as the reference peak. The peak of each pixel in the baseline-corrected mass spectrometry imaging data is compared with the reference peak to perform peak alignment and correct the mass-to-charge ratio offset of each ion peak.
[0014] Retain peaks whose intensities are greater than a preset intensity and are local maxima within a preset window, and convert the spectrum peak of each pixel into a list containing only the mass-to-charge ratio and corresponding intensity of the location of the spectrum peak;
[0015] Merge the ion spectrum peaks of each pixel within the preset mass-to-charge ratio range and remove abnormal points;
[0016] The data of each pixel are normalized to the total ion count to obtain the mass spectrometry imaging ion image data matrix.
[0017] Preferably, the first encoder module and the second encoder module both use the ResNet18 model pre-trained on the ImageNet dataset as a base model.
[0018] Preferably, the prediction mapper includes a first fully connected layer, a batch normalization layer, a ReLU activation function layer and a second fully connected layer, and the dimensionality reduction module adopts an unsupervised dimensionality reduction method.
[0019] As a preference, the training data is a mass spectrometry imaging ion image dataset after data enhancement. Where N is the number of ion images, and data enhancement methods include color jittering, data filtering, random deletion, adding Poisson noise, and intensity-based random pixel deletion.
[0020] Preferably, the training process of the ion image representation model includes the following steps:
[0021] The training data is input into the ion image representation model in batches for training. In each batch, the first data augmented sample x1 and the second data augmented sample x2 of a certain ion image x are input into the ion image representation model for comparative learning. The first data augmented sample x1 and the second data augmented sample x2 are respectively input into the first encoder module and the second encoder module to obtain the first output h1 and the second output h2. The first output h1 is input into the prediction mapper to obtain the third output p1, and the second output h2 is gradient stopped. The second output g2 is input into the prediction mapper to obtain the fourth output p2, and the first output g1 is gradient stopped. The model parameters are iteratively updated to make the loss function Converge to the optimal value;
[0022] Loss Function The calculation formula is as follows:
[0023]
[0024] Where D(·) is the negative cosine similarity:
[0025]
[0026] Among them, ‖·‖2 is the L2 norm;
[0027] The twin encoder and prediction mapper are optimized separately using an adaptive moment estimation optimizer.
[0028] Preferably, an ion peak set is obtained according to mass spectrometry imaging data, and an isotope peak recognition algorithm is used based on the ion peak set and the low-dimensional representation matrix of the mass spectrometry imaging data to identify the isotope relationship between the ions, specifically including:
[0029] S41, sorting the ion peaks in the mass spectrometry imaging data from small to large according to the mass-to-charge ratio to obtain an ion peak set
[0030]
[0031] S42, calculate the distance matrix S between ion peaks based on the low-dimensional representation matrix of the mass spectrometry imaging data, using the following formula:
[0032]
[0033] Among them, the low-dimensional representation matrix of mass spectrometry imaging data is z i is the low-dimensional representation of the i-th ion image, s ij is the low-dimensional representation z of the i-th ion image in the low-dimensional representation matrix of mass spectrometry imaging data i and the low-dimensional representation z of the j-th ion image j The Euclidean distance of
[0034] S43, sequentially extract ions I from the ion peak set I i , where i=1,2,…,N, let I i As a candidate monoisotope peak (M), and according to the following two principles, other peaks I in the ion peak set I are selected. j Search I i (M+k) isotope peak, j>i, k=1,2,…,4;
[0035] Principle 1: If I i with I j Distance s ij <θ s ,θ s is the threshold, and I i with I j The mass-to-charge ratio and peak intensity ratio of satisfies the isotopic relationship of (M) to (M+k), then I j For I i (M+k) isotope peak;
[0036] Principle 2: If I is not found in ion peak set I i (M+l) isotope peak, l=1,2,3, then it is considered that I i The (M+l+1) isotope peak does not exist;
[0037] S44, Record I i and its isotope peaks, I i and its isotope peaks are removed from the ion peak set I, and steps S43-S44 are repeated until the ion peak set is an empty set.
[0038] In a second aspect, the present invention provides an isotope peak identification device based on mass spectrometry imaging data, comprising:
[0039] a preprocessing module configured to acquire mass spectrometry imaging data, preprocess the mass spectrometry imaging data, and obtain a mass spectrometry imaging ion image data matrix;
[0040] A model construction module is configured to construct and train an ion image representation model based on a SimSiam contrastive learning network, wherein the ion image representation model includes a twin encoder, a prediction mapper, and a dimension reduction module. The twin encoder includes a first encoder module and a second encoder module that share weights. The first encoder module and the second encoder module are respectively connected to the prediction mapper, and the dimension reduction module is connected to the first encoder module. The twin encoder and the prediction mapper are trained to obtain a trained ion image representation model.
[0041] an execution module configured to input the mass spectrometry imaging ion image data matrix into a trained ion image representation model, and the mass spectrometry imaging ion image data matrix is sequentially input into a first encoder module and a dimensionality reduction module to obtain a low-dimensional representation matrix of the mass spectrometry imaging data;
[0042] The identification module is configured to obtain an ion peak set according to the mass spectrometry imaging data, and use an isotope peak identification algorithm based on the ion peak set and the low-dimensional representation matrix of the mass spectrometry imaging data to identify the isotope relationship between the ions.
[0043] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] (1) The isotope peak recognition method based on mass spectrometry imaging data proposed in this paper takes into account the inherent characteristics of MSI data that are different from natural images. It uses prior knowledge to design a data enhancement method suitable for the MSI field, obtains an isotope ion image dataset, and is used to train the ion image representation model.
[0047] (2) The isotope peak recognition method based on mass spectrometry imaging data proposed in the present invention constructs an ion image representation model based on a comparative learning strategy. By designing auxiliary tasks, the model is forced to ignore surface information, learn the structural invariance of a series of data itself, and mine the spatial distribution characteristics of ions from large-scale unlabeled MSI data. Finally, the dimensionality reduction method is used to obtain an effective low-dimensional representation of the ions.
[0048] (3) The isotope peak recognition method based on mass spectrometry imaging data proposed in the present invention introduces low-dimensional representation of ions into the isotope peak recognition task, and combines mass-to-charge ratio and peak intensity ratio for isotope peak recognition. Compared with commonly used methods, it can achieve higher recognition performance and lay an important preliminary foundation for subsequent molecular annotation and biostatistical analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 is a diagram of an exemplary device architecture to which an embodiment of the present application may be applied;
[0051] Figure 2 Schematic diagram of the process of an isotope peak identification method based on mass spectrometry imaging data according to an embodiment of the present application;
[0052] Figure 3 A schematic diagram of an ion image representation model of an isotope peak identification method based on mass spectrometry imaging data according to an embodiment of the present application;
[0053] Figure 4 A comparison chart of the isotope peak identification results of the mass spectrometry imaging data-based isotope peak identification method of the embodiment of the present application and the MetaSpace method on the data set used in Example 1;
[0054] Figure 5 A comparison chart of the isotope peak identification results of the mass spectrometry imaging data-based isotope peak identification method of the embodiment of the present application and the MetaSpace method on the data set used in Example 2;
[0055] Figure 6 Schematic diagram of an isotope peak identification device based on mass spectrometry imaging data according to an embodiment of the present application;
[0056] Figure 7 It is a structural diagram of a computer device suitable for implementing the electronic device of the embodiment of the present application. DETAILED DESCRIPTION
[0057] To make the objectives, technical solutions, and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings. It is apparent that the embodiments described are only some, not all, of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort are intended to fall within the scope of protection of the present invention.
[0058] Figure 1 An exemplary device architecture 100 is shown to which an isotope peak identification method based on mass spectrometry imaging data or an isotope peak identification device based on mass spectrometry imaging data according to an embodiment of the present application can be applied.
[0059] like Figure 1 As shown, the device architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0060] Users can use terminal devices 101, 102, 103 to interact with server 105 via network 104 to receive or send messages, etc. Various applications, such as data processing applications and file processing applications, can be installed on terminal devices 101, 102, 103.
[0061] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or they can be implemented as a single software or software module. No specific limitations are given here.
[0062] The server 105 may be a server that provides various services, such as a background data processing server that processes files or data uploaded by the terminal devices 101, 102, and 103. The background data processing server may process the acquired files or data and generate processing results.
[0063] It should be noted that the isotope peak identification method based on mass spectrometry imaging data provided in the embodiment of the present application can be executed by the server 105, or by the terminal devices 101, 102, and 103. Accordingly, the isotope peak identification device based on mass spectrometry imaging data can be set in the server 105, or in the terminal devices 101, 102, and 103.
[0064] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the above description is merely illustrative. Any number of terminal devices, networks, and servers may be provided as needed. If the processed data does not need to be acquired remotely, the above-described apparatus architecture may not include a network, but only require servers or terminal devices.
[0065] Example 1
[0066] Figure 2 An isotope peak identification method based on mass spectrometry imaging data provided by an embodiment of the present application is shown, comprising the following steps:
[0067] S1, acquiring mass spectrometry imaging data, preprocessing the mass spectrometry imaging data, and obtaining a mass spectrometry imaging ion image data matrix.
[0068] In a specific embodiment, preprocessing the mass spectrometry imaging data specifically includes:
[0069] The top-hat method was used to perform baseline correction on mass spectrometry imaging data to obtain baseline-corrected mass spectrometry imaging data;
[0070] The peak with the highest correlation with other ion peaks is used as the reference peak. The peak of each pixel in the baseline-corrected mass spectrometry imaging data is compared with the reference peak to perform peak alignment and correct the mass-to-charge ratio offset of each ion peak.
[0071] Retain peaks whose intensities are greater than a preset intensity and are local maxima within a preset window, and convert the spectrum peak of each pixel into a list containing only the mass-to-charge ratio and corresponding intensity of the location of the spectrum peak;
[0072] Merge the ion spectrum peaks of each pixel within the preset mass-to-charge ratio range and remove abnormal points;
[0073] The data of each pixel are normalized to the total ion count to obtain the mass spectrometry imaging ion image data matrix.
[0074] Specifically, mass spectrometry imaging data (MSI data) are subjected to pre-processing such as baseline correction, peak alignment, peak extraction, peak merging, outlier removal and normalization to obtain mass spectrometry imaging ion image data matrix D. Specifically, the sample used in Example 1 of the present application is male rat brain slices, and timsTOF fleX MALDI-2 (U.S.) is used for data acquisition, with a spatial resolution of 50 μm. Software SCiLs Lab is utilized to export mass spectrometry imaging data as .imzML format files. Top-hat method is used to perform baseline correction on MSI data, removing the baseline effect caused by the different initial positions and kinetic energies of ions in the instrument. The peak with the highest correlation with other ion peaks is used as a reference peak, the peak of each pixel in the MSI data is compared with the reference peak, peak alignment is performed, and the mass-to-charge ratio offset of each ion peak is corrected. Retention intensity is greater than twice the noise intensity, and the peak is the local maximum within a 10ppm window, and noise is estimated by median absolute deviation. The peak values for each pixel in the MSI data were converted into a list containing only the mass-to-charge ratio and corresponding intensity at that peak location. Peak merging was performed using the R package 'MALDIquant' to merge ion peaks within a certain mass-to-charge ratio range for each pixel in the MSI data. To prevent abnormally high expression signal values from affecting the image, pixel values above the 1% percentile were set to the 1% percentile to remove outliers. The data for each pixel were normalized to the total ion count to generate the mass spectrometry imaging ion image data matrix D.
[0075] S2. Construct and train an ion image representation model based on the SimSiam contrastive learning network. The ion image representation model includes a twin encoder, a prediction mapper and a dimensionality reduction module. The twin encoder includes a first encoder module and a second encoder module that share weights. The first encoder module and the second encoder module are respectively connected to the prediction mapper, and the dimensionality reduction module is connected to the first encoder module. The twin encoder and the prediction mapper are trained to obtain a trained ion image representation model.
[0076] In a specific embodiment, both the first encoder module and the second encoder module use the ResNet18 model pre-trained on the ImageNet dataset as a base model.
[0077] In a specific embodiment, the prediction mapper includes a first fully connected layer, a batch normalization layer, a ReLU activation function layer and a second fully connected layer, and the dimension reduction module adopts an unsupervised dimension reduction method.
[0078] Specifically, refer to Figure 3 (a) Constructing an ion image representation model based on SimSiam contrastive learning network Ion Image Representation Model It includes a twin encoder, a prediction mapper, and a dimension reduction module. The dimension reduction module and the prediction mapper module are connected to the twin encoder module respectively. The twin encoder module contains two twin networks that share the same weights, namely the first encoder module and the second encoder module. Both use the lightweight model ResNet18 pre-trained on the ImageNet dataset as the base model. Figure 3 (b) The first and second encoder modules consist of a first convolutional layer with four 3×3 kernels and 64 channels, a second convolutional layer with four 3×3 kernels and 128 channels, a third convolutional layer with four 3×3 kernels and 256 channels, a fourth convolutional layer with four 3×3 kernels and 512 channels, and an average pooling layer. The prediction mapper consists of a fully connected layer (FC) with 1024 nodes, a batch normalization layer (BN), a ReLU layer, and a fully connected layer with 4096 nodes. The dimensionality reduction module uses unsupervised dimensionality reduction methods such as the uniform manifold approximation projection method.
[0079] In a specific embodiment, the training data is a mass spectrometry imaging ion image dataset after data enhancement. Where N is the number of ion images, and data enhancement methods include color jittering, data filtering, random deletion, adding Poisson noise, and intensity-based random pixel deletion.
[0080] Specifically, a certain amount of mass spectrometry imaging data is collected, and after the above preprocessing process, a mass spectrometry imaging ion image data matrix is obtained. Considering the characteristics of MSI data, data enhancement methods such as color jittering, data filtering, random pixel deletion, adding Poisson noise, and random pixel deletion based on intensity are designed to obtain the enhanced mass spectrometry imaging ion image dataset. Where N is the number of ion images.
[0081] Unlike natural images, ion images in mass spectrometry ion image datasets have the following key characteristics: First, ions are often expressed within the spatial range preset by the MSI instrument, so the differences between different ion images are much smaller than those between natural images; second, both MSI data and noise follow a Poisson distribution, rather than the Gaussian distribution noise often found in natural images; and third, MSI data exhibits intensity-based random missingness, specifically, pixels with lower expression intensity are more likely to be missing. Taking these characteristics of MSI data into account, we modified conventional data augmentation methods used for natural images and designed a data augmentation method that is adaptive to MSI domain knowledge:
[0082] (1) Remove geometric transformations that can cause significant damage to images, such as random rotation, random masking, Sobel operator, and random cropping.
[0083] (2) Poisson noise is added instead of Gaussian noise, and random pixel deletion is added instead of random masking;
[0084] (3) An additional data augmentation method, namely, intensity-based random pixel deletion, is added to randomly delete pixel intensities ranging from 5% to 95%.
[0085] In a specific embodiment, the training process of the ion image representation model includes the following steps:
[0086] The training data is input into the ion image representation model in batches for training. In each batch, the first data augmented sample x1 and the second data augmented sample x2 of a certain ion image x are input into the ion image representation model for comparative learning. The first data augmented sample x1 and the second data augmented sample x2 are respectively input into the first encoder module and the second encoder module to obtain the first output h1 and the second output g2. The first output h1 is input into the prediction mapper to obtain the third output p1, and the second output h2 is gradient stopped. The second output h2 is input into the prediction mapper to obtain the fourth output p2, and the first output h1 is gradient stopped. The model parameters are iteratively updated to make the loss function Converge to the optimal value;
[0087] Loss Function The calculation formula is as follows:
[0088]
[0089] Among them, D(·) is the negative cosine similarity:
[0090]
[0091] Among them, ‖·‖2 is the L2 norm;
[0092] The twin encoder and prediction mapper are optimized separately using an adaptive moment estimation optimizer.
[0093] Specifically, the mass spectrometry imaging ion image dataset T is used as training data and input into the ion image representation model in batches In each batch, a certain ion image x is augmented to obtain two data augmented samples x1 and x2, and x1 and x2 are input into the ion image representation model. Contrastive learning is performed in , x1 and x2 are input into the first encoder module and the second encoder module respectively, and the first output h1 and the second output h2 are obtained. Then the first output h1 is input into the prediction mapper to obtain the third output p1. The second output h2 is not input into the prediction mapper at this time, but the gradient is stopped and the first half of the loss function is calculated, that is, Similarly, the second output h2 is input into the prediction mapper to obtain the fourth output p2. The first output h1 is not input into the prediction mapper at this time, but the gradient is stopped to calculate the second half of the loss function, that is, Iteratively update the model parameters so that the loss function Converge to the optimal value. Optimize the corresponding loss function The model can effectively extract the spatial distribution characteristics of ions. The twin encoder and prediction mapper are trained separately using the adaptive moment estimation (ADAM) optimizer, with the learning rate set to 0.0003, the momentum parameters to 0.5 and 0.99 respectively, the network parameters initialized to the normal distribution N(0,0.02), and the number of iterations to 100. In order to prevent the model from collapsing and producing trivial solutions, the gradient stop operation is used in the optimization process, that is, the second encoder module on x2 is stopped in the loss function. receives no gradient from h2 in the first term, but receives gradient from p2 in the second term, and vice versa.
[0094] S3, inputting the mass spectrometry imaging ion image data matrix into the trained ion image representation model, and inputting the mass spectrometry imaging ion image data matrix into the first encoder module and the dimension reduction module in sequence to obtain a low-dimensional representation matrix of the mass spectrometry imaging data.
[0095] Specifically, the ion images in the mass spectrometry imaging ion image data matrix D are input one by one into the trained ion image representation model Ion image representation model The output h of the first encoder module is input into the dimension reduction module, and the high-dimensional hidden layer representation h (d = 512) is reduced to 20 dimensions using an unsupervised dimension reduction method. After normalization, the low-dimensional representation z of each ion image is obtained. i ,i=1,2,…,N, the low-dimensional representation matrix of MSI data
[0096] S4, obtaining an ion peak set according to the mass spectrometry imaging data, and using an isotope peak recognition algorithm based on the ion peak set and a low-dimensional representation matrix of the mass spectrometry imaging data to identify the isotope relationship between the ions.
[0097] In a specific embodiment, step S4 specifically includes:
[0098] S41, sorting the ion peaks in the mass spectrometry imaging data from small to large according to the mass-to-charge ratio to obtain an ion peak set
[0099] S42, calculate the distance matrix S between ion peaks based on the low-dimensional representation matrix of the mass spectrometry imaging data, using the following formula:
[0100]
[0101] Among them, the low-dimensional representation matrix of mass spectrometry imaging data is z i is the low-dimensional representation of the i-th ion image, s ij is the low-dimensional representation z of the i-th ion image in the low-dimensional representation matrix of mass spectrometry imaging data i and the low-dimensional representation z of the j-th ion image j The Euclidean distance of
[0102] S43, sequentially extract ions I from the ion peak set I i , where i=1,2,…,N, let I i As a candidate monoisotope peak (M), and according to the following two principles, other peaks I in the ion peak set I are selected. j Search I i (M+k) isotope peak, j>i, k=1,2,…,4;
[0103] Principle 1: If I i with I j Distance s ij <θ s ,θ s is the threshold, and I i with I j The mass-to-charge ratio and peak intensity ratio of satisfies the isotopic relationship of (M) to (M+k), then I j For I i (M+k) isotope peak;
[0104] Principle 2: If I is not found in ion peak set I i (M+l) isotope peak, l=1,2,3, then it is considered that I i The (M+l+1) isotope peak does not exist;
[0105] S44, Record I i and its isotope peaks, I i and its isotope peaks are removed from the ion peak set I, and steps S43-S44 are repeated until the ion peak set is an empty set.
[0106] Specifically, the distance between ion images is calculated using the low-dimensional representation matrix of mass spectrometry imaging data to measure the similarity between ion images. The isotopic relationship between ions is identified by combining the mass-to-charge ratio and the peak intensity ratio. The specific steps are as follows:
[0107] (1) Sort the ion peaks in the mass spectrometry imaging data from small to large according to the mass-to-charge ratio to obtain the ion peak set
[0108]
[0109] (2) Calculate the distance matrix between ion peaks using the low-dimensional representation matrix of mass spectrometry imaging data Among them, s ij is the low-dimensional representation z of the ion image i With z j The Euclidean distance of .
[0110] (3) Take out ions I from ion peak set I in sequence i (i=1,2,…,N), change I i As a candidate monoisotopic peak (M), and according to the following two principles, from I j (j>i) Search I i (M+k) isotope peak, k=1,2,…,4.
[0111] Principle 1: If I i with I j Distance s ij <θ s (θ s is the threshold, here it is 0.25), and I i with I j The mass-to-charge ratio and peak intensity ratio of satisfies the isotopic relationship of (M) to (M+k), then I j For I i (M+k) isotope peak;
[0112] Principle 2: If I is not found in set I i (M+l) isotope peak, l=1,2,3, then it is considered that I i The (M+l+1) isotope peak does not exist.
[0113] (4) Record I i and its isotope peaks. Then I i and its isotope peaks are removed from the ion peak set I. Return to step (3) until the ion peak set I is an empty set.
[0114] Figure 4The isotope peak identification results of the present invention and the MetaSpace method on the data set used in Example 1 are compared. It can be seen that compared with the present invention, MetaSpace has the problem of incorrectly grouping the isotopes of different molecules together. For example, MetaSpace identifies the ion of m / z 799.5434 as a monoisotope, and identifies m / z 800.5534, m / z 801.5568, and m / z 802.5593 as its isotope peaks, while the present invention correctly identifies m / z 800.5534 as a monoisotope and identifies its corresponding isotope peak. In negative ion mode and positive ion mode, the number of monoisotope peaks annotated by MetaSpace are 70 and 254 respectively, and the precision rates of the identification results are 52.86% and 37.01% respectively. The number of monoisotope peaks identified by the method of the present invention is 249 and 442, and the precision rates of 76.71% and 92.76% are obtained respectively.
[0115] Example 2
[0116] The samples used in Example 2 of this application were male rat brain slices, and data were acquired using AFADESI-MSI (China) with a spatial resolution of 100 μm. The subsequent data preprocessing, data enhancement, low-dimensional representation, and isotope peak identification algorithm were implemented in the same manner as in Example 1.
[0117] According to Example 2 of the present invention, isotope peak identification is performed on the rat brain MSI dataset. Figure 5 The isotope peak recognition results of the present invention and the MetaSpace method on the data set used in Example 2 are compared. Compared with the present invention, MetaSpace has fewer isotope peak recognitions. For example, for the ion of m / z 89.023, MetaSpace failed to recognize its isotope peak, while the present invention correctly identified the two isotope peaks of the ion. The results show that compared with the MetaSpace method, the present invention obtains a more effective ion similarity measurement method by introducing a comparative learning framework and isotope prior knowledge, thereby improving the accuracy of isotope peak recognition, verifying the effectiveness of the isotope recognition method for mass spectrometry imaging data provided by the present invention.
[0118] In summary, the present invention proposes an isotope peak identification method based on mass spectrometry imaging data. This method uses a data enhancement method that incorporates MSI domain knowledge to process mass spectrometry imaging data as a training set. An ion image representation model is used to convert mass spectrometry imaging ion images into a low-dimensional representation. The low-dimensional representation is used to calculate the distance between ion images to measure the similarity between ion images. The isotope peaks are identified by combining mass-to-charge ratio and peak intensity ratio. The ion image representation model used in the present invention improves the ability to extract MSI spatial information, obtains more accurate isotope peak identification results, and further advances molecular annotation research on MSI data.
[0119] The above steps S1-S4 do not represent the order of the steps, but are only step symbols.
[0120] Further references Figure 6 As an implementation of the methods shown in the above figures, the present application provides an embodiment of an isotope peak identification device based on mass spectrometry imaging data. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0121] The embodiment of the present application provides an isotope peak identification device based on mass spectrometry imaging data, characterized by comprising:
[0122] A preprocessing module 1 is configured to acquire mass spectrometry imaging data, preprocess the mass spectrometry imaging data, and obtain a mass spectrometry imaging ion image data matrix;
[0123] Model construction module 2 is configured to construct and train an ion image representation model based on a SimSiam contrastive learning network, wherein the ion image representation model includes a twin encoder, a prediction mapper, and a dimension reduction module. The twin encoder includes a first encoder module and a second encoder module that share weights. The first encoder module and the second encoder module are respectively connected to the prediction mapper, and the dimension reduction module is connected to the first encoder module. The twin encoder and the prediction mapper are trained to obtain a trained ion image representation model.
[0124] An execution module 3 is configured to input the mass spectrometry imaging ion image data matrix into the trained ion image representation model, and the mass spectrometry imaging ion image data matrix is sequentially input into the first encoder module and the dimensionality reduction module to obtain a low-dimensional representation matrix of the mass spectrometry imaging data;
[0125] The identification module 4 is configured to obtain an ion peak set according to the mass spectrometry imaging data, and identify the isotope relationship between ions using an isotope peak identification algorithm based on the ion peak set and the low-dimensional representation matrix of the mass spectrometry imaging data.
[0126] Reference below Figure 7, which shows an electronic device (eg Figure 1 A structural diagram of a computer device 700 (server or terminal device shown). Figure 7 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0127] like Figure 7 As shown, the computer device 700 includes a central processing unit (CPU) 701 and a graphics processing unit (GPU) 702, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 703 or the program loaded from the storage part 709 to the random access memory (RAM) 704. Various programs and data required for the operation of the device 700 are also stored in the RAM 704. The CPU 701, GPU 702, ROM 703 and RAM 704 are connected to each other via a bus 705. An input / output (I / O) interface 706 is also connected to the bus 705.
[0128] The following components are connected to the I / O interface 706: an input section 707 including a keyboard, a mouse, and the like; an output section 708 including a display such as a liquid crystal display (LCD), a speaker, and the like; a storage section 709 including a hard disk and the like; and a communication section 710 including a network interface card such as a LAN card or a modem. The communication section 710 performs communication processing via a network such as the Internet. A drive 711 may also be connected to the I / O interface 706 as needed. A removable medium 712, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, is installed in the drive 711 as needed, so that a computer program read therefrom can be installed into the storage section 709 as needed.
[0129] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication part 710, and / or installed from a removable medium 712. When the computer program is executed by the central processing unit (CPU) 701 and the graphics processing unit (GPU) 702, the above-mentioned functions defined in the method of the present application are executed.
[0130] It should be noted that the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable medium, or any combination thereof. Computer-readable media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, apparatuses, or components, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or component. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution apparatus, device, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, RF, or any suitable combination thereof.
[0131] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0132] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based device that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The modules involved in the embodiments described in this application may be implemented in software or hardware, and may also be set in a processor.
[0134] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is enabled to: obtain mass spectrometry imaging data, preprocess the mass spectrometry imaging data, and obtain a mass spectrometry imaging ion image data matrix; construct and train an ion image representation model based on the SimSiam contrast learning network, the ion image representation model includes a twin encoder, a prediction mapper and a dimension reduction module, the twin encoder includes a first encoder module and a second encoder module with two shared weights, the first encoder module and the second encoder module are respectively connected to the prediction mapper, and the dimension reduction module is connected to the first encoder module, the twin encoder and the prediction mapper are trained to obtain a trained ion image representation model; the mass spectrometry imaging ion image data matrix is input into the trained ion image representation model, and the mass spectrometry imaging ion image data matrix is input into the first encoder module and the dimension reduction module in turn to obtain a low-dimensional representation matrix of the mass spectrometry imaging data; an ion peak set is obtained according to the mass spectrometry imaging data, and an isotope peak recognition algorithm is used to identify the isotope relationship between ions based on the ion peak set and the low-dimensional representation matrix of the mass spectrometry imaging data.
[0135] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A method for isotope peak identification based on mass spectrometry imaging data, characterized in that: The following steps are involved: Acquiring mass spectrometry imaging data, and preprocessing the mass spectrometry imaging data to obtain a mass spectrometry imaging ion image data matrix; Constructing and training an ion image representation model based on a SimSiam contrastive learning network, the ion image representation model includes a twin encoder, a prediction mapper, and a dimensionality reduction module, the twin encoder includes a first encoder module and a second encoder module that share weights, the first encoder module and the second encoder module are respectively connected to the prediction mapper, and the dimensionality reduction module is connected to the first encoder module, the twin encoder and the prediction mapper are trained to obtain a trained ion image representation model; Inputting the mass spectrometry imaging ion image data matrix into the trained ion image representation model, and inputting the mass spectrometry imaging ion image data matrix into the first encoder module and the dimensionality reduction module in sequence to obtain a low-dimensional representation matrix of the mass spectrometry imaging data; Acquiring an ion peak set according to the mass spectrometry imaging data, and identifying the isotope relationship between ions using an isotope peak recognition algorithm based on the ion peak set and a low-dimensional representation matrix of the mass spectrometry imaging data, specifically comprising: S41, sorting the ion peaks in the mass spectrometry imaging data from small to large according to mass-to-charge ratio to obtain an ion peak set S42, calculating the distance matrix S between ion peaks based on the low-dimensional representation matrix of the mass spectrometry imaging data, using the following formula: Among them, the low-dimensional representation matrix of the mass spectrometry imaging data is z i is the low-dimensional representation of the i-th ion image, s ij is the low-dimensional representation z of the i-th ion image in the low-dimensional representation matrix of the mass spectrometry imaging data i and the low-dimensional representation z of the j-th ion image j The Euclidean distance of S43, sequentially extracting ions I from the ion peak set I i , where i=1,2,…,N, let I i As a candidate monoisotope peak (M), and according to the following two principles, other peaks I in the ion peak set I are selected. j Search I i (M+k) isotope peak, j>i, k=1,2,…,4; Principle 1: If l i with I j Distance s ij <θ s ,θ s is the threshold, and I i with I j The mass-to-charge ratio and peak intensity ratio of satisfies the isotopic relationship of (M) to (M+k), then I j For I i (M+k) isotope peak; Principle 2: If I is not found in the ion peak set I i (M+l) isotope peak, l=1,2,3, then it is considered that I i The (M+l+1) isotope peak does not exist; S44, Record I i and its isotope peaks, I i and its isotope peaks are removed from the ion peak set I, and steps S43-S44 are repeated until the ion peak set is an empty set.
2. The isotope peak identification method based on mass spectrometry imaging data according to claim 1, characterized in that: The preprocessing of the mass spectrometry imaging data specifically includes: Performing baseline correction on the mass spectrometry imaging data using a Top-hat method to obtain baseline-corrected mass spectrometry imaging data; The spectral peak with the highest correlation with other ion peaks is used as a reference peak, and the spectral peak of each pixel in the mass spectrometry imaging data after baseline correction is compared with the reference spectral peak to perform spectral peak alignment and correct the mass-to-charge ratio offset of each ion peak; Retain peaks whose intensities are greater than a preset intensity and are local maxima within a preset window, and convert the spectrum peak of each pixel into a list containing only the mass-to-charge ratio and corresponding intensity of the location of the spectrum peak; Merge the ion spectrum peaks of each pixel within the preset mass-to-charge ratio range and remove abnormal points; The data of each pixel are normalized to the total ion count to obtain the mass spectrometry imaging ion image data matrix.
3. The isotope peak identification method based on mass spectrometry imaging data according to claim 1, characterized in that: The first encoder module and the second encoder module both use the ResNet18 model pre-trained on the ImageNet dataset as the base model.
4. The isotope peak identification method based on mass spectrometry imaging data according to claim 1, characterized in that: The prediction mapper includes a first fully connected layer, a batch normalization layer, a ReLU activation function layer and a second fully connected layer, and the dimension reduction module adopts an unsupervised dimension reduction method.
5. The isotope peak identification method based on mass spectrometry imaging data according to claim 3, characterized in that: The training data used in the training process of the ion image representation model is the mass spectrometry imaging ion image dataset after data enhancement. Wherein, N is the number of ion images, and the data enhancement methods include color jittering, data filtering, random deletion, adding Poisson noise, and intensity-based random pixel deletion method.
6. The isotope peak identification method based on mass spectrometry imaging data according to claim 5, characterized in that: The training process of the ion image representation model includes the following steps: The training data is input into the ion image representation model in batches for training. In each batch, the first data enhancement sample and the second data enhancement sample of a certain ion image x are input into the ion image representation model for comparative learning. The first data enhancement sample and the second data enhancement sample are respectively input into the first encoder module and the second encoder module to obtain a first output h1 and a second output h2. The first output h1 is input into the prediction mapper to obtain a third output p1, and the second output h2 is gradient stopped. The second output h2 is input into the prediction mapper to obtain a fourth output p2, and the first output h1 is gradient stopped. The model parameters are iteratively updated so that the loss function Converge to the optimal value; The loss function The calculation formula is as follows: Among them, D(·) is the negative cosine similarity: Among them, ‖·‖2 is the L2 norm; The twin encoder and prediction mapper are optimized separately using an adaptive moment estimation optimizer.
7. An isotope peak identification device based on mass spectrometry imaging data, using the isotope peak identification method based on mass spectrometry imaging data according to any one of claims 1 to 6, characterized in that: include: a preprocessing module configured to acquire mass spectrometry imaging data, preprocess the mass spectrometry imaging data, and obtain a mass spectrometry imaging ion image data matrix; A model construction module is configured to construct and train an ion image representation model based on a SimSiam contrastive learning network, wherein the ion image representation model includes a twin encoder, a prediction mapper, and a dimensionality reduction module, wherein the twin encoder includes a first encoder module and a second encoder module that share weights, wherein the first encoder module and the second encoder module are respectively connected to the prediction mapper, and the dimensionality reduction module is connected to the first encoder module, wherein the twin encoder and the prediction mapper are trained to obtain a trained ion image representation model; an execution module configured to input the mass spectrometry imaging ion image data matrix into the trained ion image representation model, and input the mass spectrometry imaging ion image data matrix into the first encoder module and the dimensionality reduction module in sequence to obtain a low-dimensional representation matrix of the mass spectrometry imaging data; The identification module is configured to obtain an ion peak set according to the mass spectrometry imaging data, and identify the isotope relationship between ions using an isotope peak identification algorithm based on the ion peak set and a low-dimensional representation matrix of the mass spectrometry imaging data.
8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Disease type discrimination method based on pathology and living tissue clinical diagnosis big data
CN112863665A
Interactive space segmentation method for mass spectrum imaging data
CN114494175A