Mass spectrum image dimension reduction method for large mass spectrum library and application thereof

By fusing features from fully connected networks, cascaded convolutional layers, and Transformer layers, and combining the Murmurhash3 algorithm to map mass-to-charge ratio features, the problems of high computational resource consumption and relatively simple features in existing technologies are solved, enabling fast and accurate similar spectrum retrieval in large mass spectrum libraries.

CN119622322BActive Publication Date: 2025-11-25CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411674056.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-11-25
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

Existing technologies consume significant computational resources and rely on relatively simple features when searching for similar mass spectra, making it difficult to improve the accuracy of the search.

Method used

A fully connected network and cascaded convolutional layers are used to process precursor features, ion peak features and hash features of mass spectra. The Transformer layer is combined for feature fusion, and the Murmurhash3 algorithm is used to map mass-to-charge ratio features. Dimensionality reduction is performed through an embedder, and the Faiss index is used for fast similar spectrum retrieval.

Benefits of technology

It improves the efficiency and accuracy of mass spectrum retrieval, shortens search time, enhances feature effects, and improves the computational speed and accuracy of large mass spectrum libraries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119622322B_ABST
    Figure CN119622322B_ABST
Patent Text Reader

Abstract

The application belongs to the field of artificial intelligence and proteomics, and particularly relates to a mass spectrum chart dimension reduction method for a large mass spectrum chart library and application thereof, the method comprising processing precursor features by using a full connection network, processing ion peak features and hash features by using cascaded convolution layers and maximum pooling layers respectively; splicing the processed features together to input a full connection layer; taking the output features of the full connection layer, the precursor features, the ion peak features and the hash features as inputs of a Transform layer, obtaining an initial feature vector after processing of the Transform layer; splicing the initial feature vector and mass-to-charge ratio features of the mass spectrum chart to obtain a final dimension-reduced feature vector; the application realizes fast similar spectrum chart retrieval in a large mass spectrum chart library, improves the calculation speed of PTM / SAAV related knowledge discovery, improves the spectrum chart search speed, and shortens the spectrum chart search time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of artificial intelligence and proteomics, specifically relating to a method for dimensionality reduction of mass spectra for large mass spectra libraries and its applications. Background Technology

[0002] In 2018, the ANN-SoLo tool was introduced. ANN-SoLo uses an approximate nearest neighbor index (ANN) to compare only a limited number of the most relevant mass spectra within the library with the unknown query spectrum, thus accelerating the search for open modifications. It also proposed a feature hashing scheme to convert high-resolution mass spectra into low-dimensional vectors. The basic idea of ​​this feature hashing scheme is to map fragment ion bins to a limited number of hash bins using a hash function, thereby converting the sparse high-dimensional vector hash into a low-dimensional vector. The similarity between hash vectors can then be used to approximate the similarity between the original high-dimensional vectors. A crucial consideration in choosing a hash function is that it must be unbiased to minimize the number of hash collisions; therefore, they chose the MurmurHash3 algorithm, a popular non-cryptographic hash function that is essentially the same as a true random hash algorithm.

[0003] In 2022, Bittremieux et al. trained a deep neural network in a supervised manner to reduce the dimensionality of mass spectra based on previous peptide matching results. This network, called GLEAMS, embeds mass spectra into a low-dimensional space through supervised learning, where mass spectra generated from the same peptide are close to each other. They also applied GLEAMS for large-scale mass spectrometry clustering to identify unidentified neighboring mass spectra from the same peptide, and to explore the “dark” proteome of repeatedly observed but unidentified mass spectra. GLEAMS uses a convolutional neural network to extract features, a Siamese network for model training, and Euclidean distance to calculate the cross-entropy loss function. This method effectively extracts features, embedding nearly 5000 dimensions into a 32-dimensional feature space. Supported by the FAISS storage indexing system, the embedding mapping of the spectra was achieved, enabling rapid searching of similar spectra.

[0004] However, existing technologies for finding similar mass spectra, such as the existing GLEAMS model and the optimized DLEAMS model, require a lot of computational resources. In addition, existing technologies are basically based on the normalized dot product of the reference spectrum as a feature for the search, and the features are relatively simple when calculating similarity, which makes it difficult to improve the accuracy of the search. Summary of the Invention

[0005] To address the problems existing in the prior art and improve the efficiency and accuracy of mass spectrum retrieval, this invention proposes a mass spectrum dimensionality reduction method for large mass spectrum libraries. This method extracts precursor features, ion peak features, and hash features from the mass spectrum, and then inputs the acquired features into a constructed embedding unit for dimensionality reduction. The dimensionality reduction process includes the following steps:

[0006] The precursor features are processed using a fully connected network, and the ion peak features and hash features are processed using cascaded convolutional layers and max pooling layers, respectively.

[0007] The processed features are concatenated together and input into a fully connected layer;

[0008] The features, precursor features, ion peak features, and hash features of the fully connected layer are used as input to the Transformer layer. The Transformer layer processes these features to obtain the initial feature vector.

[0009] The initial feature vector is concatenated with the mass-to-charge ratio feature of the mass spectrum to obtain the final dimensionality-reduced feature vector.

[0010] Furthermore, the acquisition of the precursor features includes: performing Gray encoding on the precursor ion mass and mass-to-charge ratio of the mass spectrum, using one-hot encoding on the charge of the mass spectrum, and concatenating the Gray-encoded data and the one-hot-encoded data together as the precursor features.

[0011] Furthermore, the acquisition of the ion peak characteristics includes: normalizing and binning the ion peaks of the mass spectrum to obtain the ion peak characteristics.

[0012] Furthermore, the mass-to-charge ratio of the mass spectrum is mapped to hash features using the Murmurhash3 algorithm.

[0013] Furthermore, the feature processing steps of the Transformer layer include:

[0014] After processing the features of the fully connected layer's output through a linear layer, the multi-head attention mechanism, residual connection layer, and normalization layer are then used in sequence for further processing.

[0015] The processed features are concatenated with the precursor features, ion peak features, and hash features, and then mapped through a linear layer to obtain the features output by the Transformer layer.

[0016] Furthermore, the initial feature vector output by the Transformer layer is mapped to a 32-dimensional vector. The mass-to-charge ratio feature of the one-dimensional mass spectrum is weighted with a weight of 0.125 and then concatenated with the 32-dimensional vector to obtain a 33-dimensional vector.

[0017] Furthermore, the loss function used during the training process of the embedding unit is expressed as:

[0018]

[0019] Where L(W,label,E) a E b ) represents the loss function of the embedding unit, W represents the weight vector in the embedding unit, and label represents the mass spectrometry pair (E) during training. a E b The label ) when the mass spectrum is paired with (E) a E b When the mass spectra are similar, label = 1; when the mass spectra are similar (E... a E b When the mass spectra are dissimilar, label = 0; E a E b These represent two mass spectra; ||·||2 represents the calculation of the F2 norm.

[0020] This invention also proposes an application of a mass spectrum dimensionality reduction method for large mass spectrum libraries. The embedder described in this invention is used to perform dimensionality reduction processing on the mass spectra in the database. When a user inputs a mass spectrum to be retrieved, the embedder is used to perform dimensionality reduction processing on the mass spectrum to be retrieved, and the top N mass spectra in the database with the smallest Euclidean distance to the mass spectrum to be retrieved after dimensionality reduction are pushed to the user.

[0021] This invention utilizes a method of embedding spectral data into a low-dimensional space to achieve rapid similar spectrum retrieval in a large mass spectrum archive, thereby improving the computational speed of PTM / SAAV related knowledge discovery, increasing the speed of spectrum search, and significantly shortening the spectrum search time. In addition, this invention employs a Transformer layer for feature fusion, enhancing the feature effect and improving the accuracy of the original model. Attached Figure Description

[0022] Figure 1 This is a flowchart of a mass spectrum dimensionality reduction method for large mass spectrum libraries according to the present invention;

[0023] Figure 2 This is a model structure diagram of a mass spectrum dimensionality reduction method for a large mass spectrum library according to the present invention;

[0024] Figure 3 This is a flowchart of the Murmurhash3 algorithm according to an embodiment of the present invention;

[0025] Figure 4 This is a design diagram of the Transformer layer in an embodiment of the present invention;

[0026] Figure 5This is a flowchart of the spectral library retrieval method based on Faiss according to an embodiment of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] This invention proposes a mass spectrum dimensionality reduction method for large mass spectrum libraries. It extracts precursor features, ion peak features, and hash features from the mass spectrum, and then inputs the extracted features into a constructed embedding unit for dimensionality reduction. The dimensionality reduction process includes the following steps:

[0029] The precursor features are processed using a fully connected network, and the ion peak features and hash features are processed using cascaded convolutional layers and max pooling layers, respectively.

[0030] The processed features are concatenated together and input into a fully connected layer;

[0031] The features, precursor features, ion peak features, and hash features of the fully connected layer are used as input to the Transformer layer. The Transformer layer processes these features to obtain the initial feature vector.

[0032] The initial feature vector is concatenated with the mass-to-charge ratio feature of the mass spectrum to obtain the final dimensionality-reduced feature vector.

[0033] Based on the Dleamse deep embedding model, this invention uses the Faiss library's efficient similarity search and clustering framework to improve the feature extraction method of the reference spectrum, providing a mass spectrum dimensionality reduction model for large mass spectrum libraries, effectively improving the algorithm's timeliness and shortening the time for database clustering and insertion.

[0034] like Figure 1 As shown, the training structure of the Dleamse deep embedding model is built based on a Siamese network. The Siamese network connects two identical models by sharing weights. This invention applies the "Siamese" training structure to train the "spectral feature extraction model" (also known as the "spectral embedding model"). The construction idea of ​​the training structure is as follows:

[0035] S1. Using a Siamese network, two identical Embedders with shared weights are connected. Before using the Embedder, the input spectral data is encoded into a long vector by the same encoder. The long vector is used as the direct input to the Embedder. Then, after a series of convolution and pooling operations inside the Embedder, the long vector is passed through the Transformer layer and embedded into a new n-dimensional space. The real spectral data is represented by an n-dimensional feature vector.

[0036] S2. The Euclidean distance between the spectral vectors obtained through the Embedder is used to calculate the value of the contrastive loss function. The contrastive loss function penalizes the model weights that embed similar spectral pairs into distant points, thereby bringing the embedding points of similar spectral pairs closer together; at the same time, it penalizes the model weights that embed dissimilar spectral pairs into close points, thereby pushing the embedding points of dissimilar spectral pairs further apart.

[0037] Specifically, the Embedder architecture diagram is as follows: Figure 1 As shown, the embedder includes two identical deep learning-based spectral embedding models sharing weights, connected by a Siamese neural network. The internal structure of the spectral embedding model includes convolutional layers and max-pooling layers. For precursor feature data with few feature values, a simple fully connected network is used for feature extraction. For fragment ion data with many feature values, hash features and feature intensities are extracted using operations such as convolution and pooling. These three types of features—precursor features, hash features, and feature intensities—are integrated and connected, serving as input to the fully connected network. The output is 32-dimensional spectral data, which is then processed and transformed by the Embedder model to map it into a new low-dimensional space, forming a dimensionality-reduced incremental data feature vector.

[0038] The execution flow of the Embedder is as follows:

[0039] 101. Input the precursor features, feature strengths and hash features from the spectral data into two spectral embedding models respectively, and perform a series of convolution and pooling operations in the spectral embedding models to obtain three new feature vectors.

[0040] 102. Linearly connect the three features and input them into the Transformer layer. The input passes through the multi-head attention mechanism layer, the residual connection layer, and the normalization layer in sequence to obtain the fused and extracted feature vector. Then, linearly connect it with the original three features as the output.

[0041] 103. Embed the output feature vector into a new n-dimensional space (n is preferably 32 dimensions), and add a new one-dimensional mass-to-charge ratio data feature to obtain two spectral embedding models embedded into n-dimensional space respectively.

[0042] 104. Calculate the Euclidean distance between the embedded spectrum pairs, and calculate the loss function L based on the Euclidean distance and the label value. The formula for calculating the loss function L is as follows:

[0043]

[0044] Where L(W,label,E) a E b ) represents the loss function of the embedding unit, W represents the weight vector in the embedding unit, and label represents the mass spectrometry pair (E) during training. a E b The label ) when the mass spectrum is paired with (E) a E b When the mass spectra are similar, label = 1; when the mass spectra are similar (E... a E b When the mass spectra are dissimilar, label = 0; E a E b These represent two mass spectra; ||·||2 represents the calculation of the F2 norm.

[0045] Then, the `faiss index`'s write index method is called to perform an indexing operation on the 32-dimensional feature vector library of the spectral library, constructing and generating the spectral library index file (.index). Using the faiss index search interface, the spectral feature vectors to be identified are searched against the spectral library index file. The search strategy is based on the k-nearest neighbor algorithm; that is, for each "query spectral vector," the library spectral vector with the smallest Euclidean distance to the "query spectral vector" is searched and used as the search identification result. Finally, the original search identification results are filtered and subjected to FDR (False Discovery Rate) quality control. Through charge, precursor ion quality, and decoy library strategy FDR quality control, as well as contaminant screening, the original search identification results are filtered to obtain the final peptide identification results.

[0046] In one embodiment, the specific encoding method for the spectral data before inputting it into the spectral embedding model is as follows. The three types of features of the spectral data—parent ion features, ion peak binning features, and hash features of mass-to-charge ratio data—are encoded, and the specific encoding scheme is designed as follows:

[0047] 201. Encode part or all of the mass, mass-to-charge ratio and charge information of the parent ion; use 27-bit Gray code for the mass and mass-to-charge ratio of the parent ion, and use "one-hot" code of length 7 (representing charges 1+ to 7+ respectively) for the charge.

[0048] 202. Ion peaks are binned according to 0.02Th / bin or 1Th / bin. For ion peak characteristics, the ion peak intensities are first transformed by the square root and normalized. Then, ion peaks in the range of 50.5Th to 2500Th are binned, and the peak intensity of each bin is the sum of the peak intensities in all bins.

[0049] 203. The mass-to-charge ratio data is mapped to a hash vector using the Murmurhash3 algorithm, and then normalized. The normalization denominator is the sum of all mass-to-charge ratio data.

[0050] On the one hand, mass-to-charge ratio (MMR) data is the most important feature of mass spectrometry representation because the core objective of mass analysis is to identify and analyze molecules by determining their MMR. MMR allows for the identification of molecules in a sample, particularly peptides, proteins, or other components. After the mass spectrometer electrically separates the molecules identified in the sample, it separates and detects them based on their MMR; accurate determination of the MMR is fundamental to substance identification. The MMR directly reflects the ratio of an ion's mass to its charge. In most chromatographic experiments, sample molecules typically carry one or more charges (usually positive), and the mass of the ions can be deduced from the MMR data. This is crucial for identifying molecules, resolving their structures, and characterizing compounds. On the other hand, mass spectra typically consist of hundreds or even thousands of MMR-intensity pairs, each of which can be considered a high-dimensional processing unit. Calculating the NDP requires comparing and multiplying each mass spectrum point-by-point with 500 reference spectra, resulting in a massive amount of data processing. This large-scale high-dimensional matrix multiplication is extremely time-consuming. To improve model computation efficiency and save computation time, this embodiment designs a novel hash feature extraction method to replace the NDP feature of the reference spectrum in the original model, and adds a new one-dimensional mass-to-charge ratio data feature as the 33rd dimension feature vector for a rough division of positive and negative spectra.

[0051] This invention maps the mass-to-charge ratio data of a mass spectrum into a 200-dimensional vector using the Murmurhash3 algorithm, serving as a feature to replace the NDP of the reference spectrum. MurmurHash3 is a non-cryptographic hash function, originally proposed by Austin Appleby in 2008. It is commonly used to efficiently generate hash values, especially in scenarios requiring fast hashing and where security is not a primary concern. MurmurHash3 is the third version in the MurmurHash series and is the most popular and commonly used in the series. The advantages of MurmurHash3 are as follows:

[0052] 1. Suitable for scenarios requiring high performance, its implementation typically utilizes efficient bitwise operations and numerical manipulations, ensuring high efficiency even when processing large amounts of data. This makes MurmurHash3 an ideal choice for processing large-scale data, significantly improving system response speed and throughput;

[0053] 2. It offers a low collision rate, especially when the data volume is only in the tens of millions, where collision issues are virtually nonexistent. This is crucial for applications that require ensuring data uniqueness or reducing hash collisions. A low collision rate helps maintain the balance of the hash table, improves retrieval efficiency, and reduces performance degradation caused by collisions;

[0054] 3. It provides good randomness and distribution characteristics. Different input data, after hashing, have hash values ​​that are evenly distributed, reducing the possibility of hash collisions. This is crucial for applications requiring fast mapping of mass-to-charge ratio data. Good distribution helps ensure the uniformity of data during storage and retrieval, improving the overall performance of the system.

[0055] Specifically, the calculation process of Murmurhash3 is as follows:

[0056] 1. Define constants c1 and c2 for mixing and multiplication. r1 and r2 are used for the shift values ​​in the left shift operation. m and n are used for the mixing operation constants. Set an initial seed value to initialize the hash calculation state; different seed values ​​will produce different hash results.

[0057] 2. Process the input mass-to-charge ratio data in groups of 4 bytes. If the last block is less than 4 bytes, use a special processing method. Perform a mixing operation on each 4-byte block to ensure that the high and low bits of the input data are evenly distributed in the output hash value. This typically involves bitwise operations, multiplication, XOR, etc.

[0058] 3. For each 4-byte block, calculate its hash key k. The specific steps are as follows:

[0059] K = K * c1: Multiply the current block by the constant c1.

[0060] K = K rot by r1: Shift the result left by r1 bits (circular left shift).

[0061] K = K * c2: Multiply by the constant c2 again.

[0062] The calculated hash key k is mixed and rotated with the intermediate value h. The specific steps are as follows:

[0063] h = h^K: Performs an XOR operation between the intermediate value h and the hash key K of the current block.

[0064] h = h rot by r2: Shifts the result left by r2 bits (circular left shift).

[0065] h = h*m ​​+ n: multiply by the constant m and add the constant n.

[0066] 4. If the length of the input byte array is not a multiple of 4, process the remaining part by using a series of bit shifts, multiplications, and XOR operations to ensure that the entire byte array is taken into account.

[0067] 5. XOR the intermediate value h with the length of the input data to increase the hash value's sensitivity to the input length. A series of XOR, multiplication, and bit shift operations are then applied to perform the final mixing and compression of the hash values. These operations aim to ensure that the output hash values ​​are evenly distributed and possess good properties.

[0068] 6. The final hash value is a 32-bit integer, which can be used as a unique identifier or index value for the input data.

[0069] 7. The two-level feature design involves using the mass-to-charge ratio (MCR) data of each spectrum as the new first-level feature. Experiments showed that a weight of 0.125 was applied to this MCR, adding it to the reduced 32-dimensional vector to create a new 33-dimensional feature vector. This is used for coarse segmentation, ensuring that dissimilar spectrum pairs are strictly distinguished. The MCR data and corresponding intensities are then processed using the Murmurhash3 algorithm to create hash vectors, which serve as the new second-level feature. These new feature vectors replace the normalized distance feature with the 500 reference spectra in the Dleamse model for fine-grained segmentation, measuring the dot product distance between the new vectors generated after embedding these feature values.

[0070] 8. Furthermore, this invention provides a novel feature fusion layer, the Transformer, which includes a multi-head attention mechanism layer, a residual connection layer, and a normalization layer. The multi-head attention mechanism accepts a feature vector concatenated from three feature vectors and extracts information from different perspectives. It achieves this by decomposing the input sequence into multiple subspaces and applying a different attention mechanism to each subspace. This captures information from different levels within the input sequence, enhancing the model's ability to model long-distance dependencies. The residual layer enhances the model's stability by adding a shortcut from input to output, allowing information to flow directly to subsequent layers and avoiding the vanishing gradient problem common in deep neural networks. The normalization layer accelerates training and improves stability by normalizing features across different neurons within each sample, eliminating scale differences. This normalization operation helps the gradient descent algorithm converge faster while reducing internal covariate bias and improving training stability. The Transformer layer significantly improves the model's accuracy.

[0071] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for dimensionality reduction of mass spectra for large mass spectrometry libraries, characterized in that, Precursor features, ion peak features, and hash features are obtained from the mass spectrum. The acquisition of precursor features includes: Gray coding of the precursor ion mass and mass-to-charge ratio in the mass spectrum; one-hot coding of the charge in the mass spectrum; and concatenation of the Gray-coded and one-hot-coded data as the precursor features. The acquisition of ion peak features includes: normalization and binning of the ion peaks in the mass spectrum to obtain ion peak features. The acquisition of hash features includes: mapping the mass-to-charge ratio of the mass spectrum to hash features using the Murmurhash3 algorithm. The acquired features are then input into an embedded system for dimensionality reduction, which includes the following steps: The precursor features are processed using a fully connected network, and the ion peak features and hash features are processed using cascaded convolutional layers and max pooling layers, respectively. The processed features are concatenated together and input into a fully connected layer; The features, precursor features, ion peak features, and hash features output from the fully connected layer are used as input to the Transformer layer. The Transformer layer processes these features to obtain the initial feature vector. The feature processing steps of the Transformer layer include: After processing the features of the fully connected layer's output through a linear layer, the multi-head attention mechanism, residual connection layer, and normalization layer are then used in sequence for further processing. The processed features are concatenated with the precursor features, ion peak features, and hash features, and then mapped through a linear layer to obtain the features output by the Transformer layer. The initial feature vector is concatenated with the mass-to-charge ratio feature of the mass spectrum to obtain the final dimensionality-reduced feature vector. In other words, the initial feature vector output by the Transformer layer is mapped to a 32-dimensional vector, and the mass-to-charge ratio feature of the one-dimensional mass spectrum is weighted with a weight of 0.125 and concatenated with the 32-dimensional vector to obtain a 33-dimensional vector.

2. The mass spectrum dimensionality reduction method for large mass spectrum libraries according to claim 1, characterized in that, The loss function used during the training of the embedding is expressed as: in, Let W represent the loss function of the embedding, W represent the weight vector in the embedding, and label represent the mass spectrometry pair (E) during training. a E b The label ) when the mass spectrum is paired with (E) a E b When the mass spectra are similar, label=1; when the mass spectra are similar (E... a E b When the mass spectra are dissimilar, label = 0; E a E b These represent two mass spectra; This indicates the calculation of the F2 norm.

3. An application of a mass spectrum dimensionality reduction method for large mass spectrum libraries, characterized in that, The embedder described in claim 1 is used to perform dimensionality reduction on mass spectra in the database. When a user inputs a mass spectrum to be retrieved, the embedder is used to perform dimensionality reduction on the mass spectrum to be retrieved, and the top N mass spectra with the smallest Euclidean distance to the mass spectrum to be retrieved in the database after dimensionality reduction are pushed to the user.

Citation Information

Patent Citations

  • Isotope peak identification method and device based on mass spectrum imaging data and readable medium

    CN117274639A

  • Ion index-based protein tandem mass spectrum identification method

    CN117711491A