Lossless compression method for protein mass spectrum data and related equipment

By preprocessing protein mass spectrometry data and combining compression strategies, using the Zstandard algorithm and sparse attention Transformer flow model or point cloud flow model, the problem of low compression ratio in existing mass spectrometry data compression technology is solved, achieving lossless compression and improved data integrity.

CN121508543APending Publication Date: 2026-02-10GUANGZHOU UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511455208.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing mass spectrometry data compression techniques have low compression ratios on secondary mass spectrometry data, which cannot meet the needs of precise proteomics analysis. Furthermore, the compression speed of general algorithms and streaming models is not well adapted to the amount of data.

Method used

The raw protein mass spectrometry data were preprocessed, and the mass-to-charge ratio-intensity optimization was performed. The Zstandard algorithm was then used to compress the first-level mass spectrometry data. The second-level mass spectrometry data were compressed using a sparse attention Transformer flow model or a point cloud flow model based on the mass-to-charge ratio. Finally, the compression results were merged.

Benefits of technology

It achieves lossless compression, improves the compression ratio, and balances compression efficiency with data integrity, making it suitable for the storage and transmission of large-scale protein mass spectrometry data generated by high-resolution mass spectrometers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121508543A_ABST
    Figure CN121508543A_ABST
Patent Text Reader

Abstract

The invention discloses a lossless compression method and related equipment for protein mass spectrum data, and the method comprises the following steps: preprocessing original protein mass spectrum data to obtain preprocessed mass spectrum data; performing optimization compression processing on primary mass spectrum data in the pre-processed mass spectrum data to obtain primary mass spectrum compression data; performing Transform flow model compression or point cloud flow model compression on secondary mass spectrum data in the preprocessed mass spectrum data to obtain secondary mass spectrum compression data; and combining the primary mass spectrum compression data and the secondary mass spectrum compression data to obtain a lossless compression result. The method can improve the compression ratio and data integrity, and can be widely applied to the technical field of data compression.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data compression, and in particular to a lossless compression method for protein mass spectrometry data and related equipment. BACKGROUND

[0002] In proteomics research, the resolution of mass spectrometers continues to improve (such as the resolution from 17500 to distinguish overlapping ion peaks), resulting in exponential growth of protein mass spectrometry data: for example, the TimsTOF Pro mass spectrometer of Bruker generates 16GB of data every 3 hours, and the theoretical daily data volume reaches 128GB, bringing huge cost pressure to data storage and transmission. In existing mass spectrometry data compression techniques, the data is compressed by logarithmic transformation and rounding, which will result in a loss of mass-to-charge ratio (m / z) accuracy, and cannot meet the needs of proteomics accurate analysis. In addition, general algorithms such as Zstandard and Zlib can achieve a compression ratio of 3.2~3.4 on primary mass spectrometry data, but the compression ratio on secondary mass spectrometry data is low, only 2.6~2.8, which cannot meet the compression needs of secondary mass spectrometry data. SUMMARY

[0003] Therefore, the embodiments of the present application mainly aim to provide a lossless compression method for protein mass spectrometry data and related equipment, so as to solve at least one of the problems in the prior art, and the present application can improve the compression ratio and data integrity.

[0004] To achieve the above-mentioned purpose, one aspect of an embodiment of the present application provides a lossless compression method for protein mass spectrometry data, which comprises: preprocessing the original protein mass spectrometry data to obtain preprocessed mass spectrometry data; optimizing and compressing the primary mass spectrometry data in the preprocessed mass spectrometry data to obtain primary mass spectrometry compressed data; performing Transform flow model compression or point cloud flow model compression on the secondary mass spectrometry data in the preprocessed mass spectrometry data to obtain secondary mass spectrometry compressed data; merging the primary mass spectrometry compressed data and the secondary mass spectrometry compressed data to obtain a lossless compression result.

[0005] In some embodiments, the preprocessing of the original protein mass spectrometry data to obtain the preprocessed mass spectrometry data comprises the following steps: integerizing the initial mass-to-charge ratio to obtain an integerized mass-to-charge ratio; sorting the integerized mass-to-charge ratio in ascending order and incrementally encoding the integerized mass-to-charge ratio to obtain a preprocessed mass-to-charge ratio; zero value processing of the initial intensity value to obtain a preprocessed intensity value; Wherein, the initial mass-to-charge ratio and the initial intensity value form an initial data pair; the raw protein mass spectrometry data includes the initial data pair; the preprocessed mass-to-charge ratio and the preprocessed intensity value form a preprocessed data pair; the preprocessed mass spectrometry data includes the preprocessed data pair.

[0006] In some embodiments, optimizing and compressing the first-level mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed first-level mass spectrometry data includes the following steps: Obtain preprocessed data pairs from the primary mass spectrometry data to obtain multiple primary data pairs; The multiple first-level data pairs are split to obtain multiple first-level mass-to-charge ratios and multiple first-level intensity values; The first data block is obtained by sequentially splicing together multiple first-level mass-to-charge ratios. The multiple first-level intensity values ​​are sequentially concatenated to obtain the second data block; Perform byte segmentation on each of the first-level mass-to-charge ratios in the first data block to obtain several mass-to-charge ratio segmented bytes; Each of the first-level intensity values ​​in the second data block is split into bytes to obtain several intensity value split bytes; The mass-to-charge ratio cut bytes and the intensity value cut bytes are recombined to obtain a recombined data block; The recombined data block is compressed to obtain the first-level mass spectrometry compressed data.

[0007] In some embodiments, recombining the mass-to-charge ratio slicing bytes and the intensity value slicing bytes to obtain a recombined data block includes the following steps: The mass-to-charge ratio cutting byte and the intensity value cutting byte are combined with corresponding bytes to obtain several third data blocks; The third data blocks are sorted according to the order from the most significant byte to the least significant byte to obtain the recombined data block.

[0008] In some embodiments, the secondary mass spectrometry data in the preprocessed mass spectrometry data is compressed using the Transformer streaming model to obtain compressed secondary mass spectrometry data, including the following steps: Obtain preprocessed data pairs from the secondary mass spectrometry data to obtain multiple secondary data pairs; Projecting the second-level mass-to-charge ratio in the second-level data pair into a preset dimension vector yields the mass-to-charge ratio embedding vector; The secondary intensity values ​​in the secondary data pairs are projected onto the preset dimension vector to obtain the intensity embedding vector; The peak vector is obtained by concatenating the mass-to-charge ratio embedding vector and the intensity embedding vector. The peak vector is input into the Transformer flow model to obtain the first target feature vector; The first target feature vector is encoded using an asymmetric digital system to obtain the compressed secondary mass spectrometry data.

[0009] In some embodiments, inputting the peak vector into a Transformer flow model to obtain a first target feature vector includes the following steps: Use the peak vector as the input feature vector; The input feature vector is input into the current stream module to obtain the first intermediate feature vector; The first intermediate feature vector is input into the current factor layer to obtain the second intermediate feature vector; The second intermediate feature vector is used as the input feature vector, the next flow module is used as the current flow module, the next factor layer is used as the current factor layer, and the step of inputting the input feature vector into the current flow module to obtain the first intermediate feature vector is repeated until the last factor layer outputs the third intermediate feature vector, and the third intermediate feature vector is input into the last flow module to obtain the fourth intermediate feature vector. The first target feature vector is obtained based on each of the second intermediate feature vectors, the third intermediate feature vector, and the fourth intermediate feature vector; The Transformer flow model includes multiple flow modules and multiple factor layers.

[0010] In some embodiments, inputting the input feature vector into the current streaming module to obtain a first intermediate feature vector includes the following steps: Input the input feature vector into the current flow layer; The input feature vectors are sorted in ascending order of the second-order mass-to-charge ratio to obtain a feature vector sequence. For each input feature vector in the feature vector sequence, the similarity between the current input feature vector and several adjacent input feature vectors is obtained, and local window attention weights are generated. A dynamic threshold is set based on the secondary intensity value, and the input feature vector is filtered according to the dynamic threshold to obtain a set of key peaks; Obtain the similarity between each input feature vector and the key peak set, and generate key peak attention weights; The target attention weight is obtained by weighted summation of the local window attention weight and the key peak attention weight. The fifth intermediate feature vector is obtained based on the target attention weights, max pooling layer, group normalization layer, and multilayer perceptron layer. The fifth intermediate feature vector is used as the input feature vector, the next flow layer is used as the current flow layer, and the step of inputting the input feature vector into the current flow layer is returned until the last flow layer outputs the first intermediate feature vector. The flow module includes several flow layers.

[0011] In some embodiments, point cloud flow model compression is performed on the secondary mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed secondary mass spectrometry data, including the following steps: Obtain preprocessed data pairs from the secondary mass spectrometry data to obtain multiple secondary data pairs; Obtain the point cloud form of the secondary data pairs to obtain point cloud data; The point cloud data is input into the point cloud flow model to obtain the second target feature vector; The second target feature vector is encoded using an asymmetric digital system to obtain the compressed secondary mass spectrometry data.

[0012] To achieve the above objectives, another aspect of the present invention proposes a lossless compression system for protein mass spectrometry data, the system comprising: The preprocessing module is used to preprocess the raw protein mass spectrometry data to obtain preprocessed mass spectrometry data. An optimization compression module is used to optimize and compress the first-level mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed first-level mass spectrometry data. The flow model compression module is used to perform Transformer flow model compression or point cloud flow model compression on the secondary mass spectrometry data in the preprocessed mass spectrometry data to obtain secondary mass spectrometry compressed data. The lossless compression generation module is used to merge the first-level mass spectrometry compressed data and the second-level mass spectrometry compressed data to obtain the lossless compression result.

[0013] To achieve the above objectives, another aspect of the present invention provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described above.

[0014] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0015] To achieve the above objectives, another aspect of the present invention provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions to cause the computer device to perform the aforementioned method.

[0016] The embodiments of the present invention include at least the following beneficial effects: The present invention provides a lossless compression method and related equipment for protein mass spectrometry data. This scheme preprocesses the raw protein mass spectrometry data to obtain preprocessed mass spectrometry data, providing a data foundation for downstream steps; optimizes and compresses the first-level mass spectrometry data in the preprocessed mass spectrometry data to obtain first-level compressed mass spectrometry data; and performs Transformer flow model compression or point cloud flow model compression on the second-level mass spectrometry data in the preprocessed mass spectrometry data to obtain second-level compressed mass spectrometry data, taking into account the compression requirements of both first-level and second-level mass spectrometry and improving the compression ratio; and merges the first-level and second-level compressed mass spectrometry data to obtain a lossless compression result, with no accuracy loss throughout the data compression process, thus improving data integrity. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of a lossless compression method for protein mass spectrometry data provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the protein mass spectrometry data preprocessing process provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the first-level mass spectrometry data optimization process provided in an embodiment of the present invention; Figure 4 This is a network structure diagram of the sparse attention Transformer flow model based on mass-to-charge ratio provided in the embodiments of the present invention; Figure 5 This is a network structure diagram of the point cloud flow model provided in an embodiment of the present invention; Figure 6 This is a diagram of the protein mass spectrometry data combination and compression strategy provided in the embodiments of the present invention; Figure 7 This is a schematic diagram of the original structure of mass spectrometry data provided in an embodiment of the present invention; Figure 8This is a structural diagram of the flow module provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.

[0020] It should be noted that although functional modules are divided in the system diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100" and "second / S200" in the specification, claims, and the foregoing drawings may be used herein to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, first information may also be referred to as second information without departing from the scope of the embodiments of the invention, and similarly, second information may also be referred to as first information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to a determination," or "in the event of a determination."

[0021] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0023] Before providing a detailed description of the embodiments of the present invention, some of the nouns and terms involved in the embodiments of the present invention will be explained first. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.

[0024] Mass spectrometry (MS1) primarily involves ionizing molecules in a sample into charged ions, which are then separated and detected by a mass analyzer based on their mass-to-charge ratio (m / z).

[0025] Secondary mass spectrometry (MS2) is based on primary mass spectrometry, which further fragments the ions generated by primary mass spectrometry and then analyzes these fragmented ion fragments.

[0026] Intensity represents the relative number of ions at a specific mass-to-charge ratio (m / z) in a mass spectrum.

[0027] Delta coding, also known as differential coding or incremental coding, is a coding method commonly used for time-series data compression. Its basic principle is to keep the first data unchanged, and convert subsequent data into the difference (delta) between the first and subsequent data.

[0028] The following drawbacks exist in existing mass spectrometry data compression techniques: 1. Lossy compression has poor applicability: For example, the MS-Numpress algorithm compresses data through logarithmic transformation and rounding, but this leads to a loss of mass-to-charge ratio (m / z) accuracy, which cannot meet the needs of precise proteomics analysis and is not widely accepted. 2. Limitations of general compression algorithms: General algorithms such as Zstandard and Zlib can achieve a compression ratio of 3.2 to 3.4 for MS1 data (1MB to 5MB), but the compression ratio for MS2 data (0 to 300KB, with complex structure and low repeatability) is only 2.6 to 2.8, which cannot meet the compression requirements of MS2 data. 3. Defects of existing lossless compression methods: MassComp compresses the mass-to-charge ratio through incremental encoding, but it relies on the universal mzXML / mzML format (which increases the file size after conversion); StackZDPD improves the compression ratio by re-aggregating MS1 / MS2 blocks, but it destroys the individual read properties of MS1 and MS2, which is not conducive to subsequent mass spectrometry analysis. 4. Insufficient adaptability of flow models: Existing integer discrete flow models (such as IDF++) are designed for image data and cannot effectively capture the nonlinear relationship between mass-to-charge ratio and intensity in mass spectrometry data. The compression ratio on MS2 data is only 2.57, which is poor performance.

[0029] In view of this, embodiments of the present invention provide a lossless compression method and related equipment for protein mass spectrometry data. This scheme addresses the problems of low compression ratios and insufficient adaptability of flow model compression speeds to data volume in existing general compression algorithms for secondary mass spectrometry (MS2) data. It adopts an "optimization processing + combined compression" strategy: MS1 data is optimized for mass-to-charge ratio (MMR) and then compressed using the Zstandard algorithm; MS2 data is compressed using either a sparse attention Transformer flow model or a point cloud flow model based on MMR. Specifically, the Transformer flow model constructs peak vectors through different embedding methods and introduces a sparse attention module, while the point cloud flow model handles the nonlinear relationship between MMR and intensity using point cloud data. Experiments show that the present invention achieves a compression ratio of 3.54 for MS1 data and 3.86 for MS2 data, balancing compression efficiency and data integrity. This invention is applicable to the storage and transmission of large-scale protein mass spectrometry data (including MS1 and MS2) generated by high-resolution mass spectrometers (such as the Bruker TimsTOFPro).

[0030] Figure 1 This is an optional flowchart of a lossless compression method for protein mass spectrometry data provided in this embodiment of the invention. Figure 1 The method may include, but is not limited to, steps S100 to S400: Step S100: Preprocess the raw protein mass spectrometry data to obtain preprocessed mass spectrometry data; Step S200: Optimize and compress the first-order mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed first-order mass spectrometry data; Step S300: Perform Transformer flow model compression or point cloud flow model compression on the secondary mass spectrometry data in the preprocessed mass spectrometry data to obtain secondary mass spectrometry compressed data; Step S400: Merge the primary mass spectrometry compressed data and the secondary mass spectrometry compressed data to obtain a lossless compression result.

[0031] In step S100 of some embodiments, raw protein mass spectrometry data refers to a dataset directly generated from the mass spectrometer, without or with minimal processing, which fully records the mass-to-charge ratio and intensity signals of all ions during each experiment. This raw data is a .d directory containing multiple internal data files (such as MS1.raw, MS2.raw), a structure that separates MS1 and MS2 data, improving processing efficiency. Figure 2As shown, the mass-to-charge ratio in the (mass-to-charge ratio, intensity) pairs is integerized, sorted in ascending order, and then delta-incremental encoded. Zero values ​​in the intensity values ​​are then removed to obtain the preprocessed mass spectrometry data. Preprocessing the raw protein mass spectrometry data provides a data foundation for subsequent steps.

[0032] In some embodiments, step S100 may include, but is not limited to, steps S110 to S130: Step S110: The initial mass-to-charge ratio is integerized to obtain the integerized mass-to-charge ratio; Step S120: Sort the integerized mass-to-charge ratios in ascending order and perform incremental encoding on the integerized mass-to-charge ratios to obtain the preprocessed mass-to-charge ratios; Step S130: Remove zero values ​​from the initial strength value to obtain the preprocessed strength value; The initial mass-to-charge ratio and initial intensity value constitute the initial data pair; the raw protein mass spectrometry data includes the initial data pair; the preprocessed mass-to-charge ratio and preprocessed intensity value constitute the preprocessed data pair; and the preprocessed mass spectrometry data includes the preprocessed data pair.

[0033] In step S110 of some embodiments, the mass-to-charge ratio of floating-point type (single / double precision) is converted to a uint32 integer using a custom function, sorted in ascending order, and then delta incremental encoding is performed to reduce the difference between adjacent values. For example, the formula for the custom mass-to-charge ratio integerization function is as follows: (1) in, This represents the result of the mass-to-charge ratio after integerization, which is a converted uint32 type integer. To customize the mapping function and calibrate it according to the mass spectrometer parameters, such as in the Bruker TimsTOF Pro mass spectrometer. This is to ensure that the mass-to-charge ratio is accurate to six decimal places. The initial mass-to-charge ratio for floating-point numbers (single / double precision).

[0034] In step S120 of some embodiments, the integerized mass-to-charge ratios are sorted in ascending order according to their magnitudes, and incremental encoding is performed on the sorted integerized mass-to-charge ratios to obtain the preprocessed mass-to-charge ratio. For example, as shown... Figure 2As shown, the integerized prime-to-charge ratios include "83376", "155797", "240696", "145537", "334124", and "216309". After sorting these integerized prime-to-charge ratios in ascending order, we get "83376", "145537", "155797", "216309", "240696", and "334124". Further, Delta increment encoding is performed on the sorted integerized prime-to-charge ratios to reduce the difference between adjacent values, resulting in preprocessed prime-to-charge ratios "83376", "62161", "10260", "60512", "24387", and "93428".

[0035] In step S130 of some embodiments, since the value of 0 has no practical analytical significance, the zero value in the initial intensity value of uint32 type is removed to reduce data redundancy and obtain the preprocessed intensity value.

[0036] After preprocessing the raw protein mass spectrometry data, the preprocessed mass spectrometry data is output. The raw protein mass spectrometry data contains initial data pairs (initial mass-to-charge ratio, initial intensity value), which are composed of the initial mass-to-charge ratio and the initial intensity value. The preprocessed mass spectrometry data contains preprocessed data pairs (integer mass-to-charge ratio, non-zero intensity value), which are composed of the preprocessed mass-to-charge ratio and the preprocessed intensity value.

[0037] In steps S200 to S300 of some embodiments, a combined compression strategy is designed to address the differences between MS1 ​​(large data volume, high repetition) and MS2 (small data volume, complex structure). For MS1 data, local correlation is improved through mass-to-charge ratio-intensity optimization compression, followed by compression using the Zstandard algorithm, balancing speed and compression ratio. For MS2 data, a sparse attention Transformer flow model based on mass-to-charge ratio is used for compression, leveraging the attention module to capture peak correlation and improve the compression ratio. Figure 7 The diagram shows the original structure of the mass spectrometry data, illustrating the structure of region A (index), region B (mass-charge ratio-intensity), and region C (reserved information) of MS1 / MS2. The data pairs in region B are compressed.

[0038] In step S200 of some embodiments, the first-order mass spectrometry (MS1) data in the preprocessed mass spectrometry data is optimized. For example, such as... Figure 3As shown, the mass-to-charge ratio and intensity of the MS1 data are split into independent data blocks. The uint32 type values ​​of each data block are cut into four uint8 type bytes. After the bytes are reassembled from the most significant byte to the least significant byte, the Zstandard algorithm is used for compression to obtain the first-order mass spectrometry compressed data. By improving the local correlation through mass-to-charge ratio-intensity optimization, and then compressing with the Zstandard algorithm, both compression speed and compression ratio are balanced.

[0039] In some embodiments, step S200 may include, but is not limited to, steps S210 to S280: Step S210: Obtain preprocessed data pairs from the primary mass spectrometry data to obtain multiple primary data pairs; Step S220: Split multiple first-level data pairs to obtain multiple first-level mass-to-charge ratios and multiple first-level intensity values; Step S230: Sequentially concatenate multiple first-level mass-to-charge ratios to obtain the first data block; Step S240: Sequentially concatenate multiple first-level intensity values ​​to obtain the second data block; Step S250: Perform byte segmentation on each first-level mass-to-charge ratio in the first data block to obtain several mass-to-charge ratio segmented bytes; Step S260: Perform byte segmentation on each first-level intensity value in the second data block to obtain several intensity value segmentation bytes; Step S270: Reassemble the mass-to-charge ratio cut bytes and the intensity value cut bytes to obtain a reassembled data block; Step S280: Compress the recombined data block to obtain first-level mass spectrometry compressed data.

[0040] In step S210 of some embodiments, the preprocessed mass spectrometry data includes preprocessed data pairs. For the first-level mass spectrometry data within the preprocessed mass spectrometry data, these preprocessed data points are referred to as first-level data pairs. For example, as... Figure 3 As shown, the first-level data pairs (m / z1, intensity1), (m / z2, intensity2), and (m / z3, intensity3) in the first-level mass spectrometry data can be obtained.

[0041] In steps S220 to S240 of some embodiments, the obtained multiple first-level data pairs are split into independent "mass-to-charge ratio blocks" and "intensity blocks" to obtain multiple first-level mass-to-charge ratios and multiple first-level intensity values. The multiple first-level mass-to-charge ratios are then sequentially concatenated to form a first data block, and the multiple first-level intensity values ​​are sequentially concatenated to form a second data block. For example, as shown... Figure 3As shown, the primary data pairs are split into multiple "mass-to-charge ratio blocks" and "intensity blocks." The multiple "mass-to-charge ratio blocks" are sequentially concatenated to obtain the first data block: m / z1, m / z2, m / z3; the multiple "intensity blocks" are sequentially concatenated to obtain the second data block: intensity1, intensity2, intensity3. Then, following the order of "mass-to-charge ratio blocks + intensity blocks," the "first data block + second data block" is obtained: m / z1, m / z2, m / z3, intensity1, intensity2, intensity3.

[0042] In steps S250 to S260 of some embodiments, the first-level mass-to-charge ratio in the first data block is segmented into multiple mass-to-charge ratio segmentation bytes, and the first-level intensity value in the second data block is segmented into multiple intensity value segmentation bytes. Optionally, each uint32 type first-level mass-to-charge ratio in the first data block is segmented into 4 uint8 type mass-to-charge ratio segmentation bytes, and each uint32 type first-level intensity value in the second data block is segmented into 4 uint8 type intensity value segmentation bytes, such as segmenting the uint32 value 0x12345678 into 0x12, 0x34, 0x56, and 0x78. For example, as shown... Figure 3 As shown, the uint32 type m / z1 is byte-splittered to obtain four uint8 type mass-to-charge ratio byte segments: byte1, byte2, byte3, and byte4. Similarly, the uint32 type intensity1 is byte-splittered to obtain four uint8 type intensity value byte segments: byte1, byte2, byte3, and byte4.

[0043] In step S270 of some embodiments, bytes are regrouped in order from "high-order to low-order", such as the first byte of all uint32 bytes being grouped, the second byte being grouped, ..., the nth byte being grouped, thereby improving the local correlation of data.

[0044] In some embodiments, step S270 may include, but is not limited to, steps S271 to S272: Step S271: Combine the mass-to-charge ratio cutting bytes and the intensity value cutting bytes with the same byte to obtain several third data blocks; Step S272: Sort several third data blocks according to the order from the most significant byte to the least significant byte to obtain a reassembled data block.

[0045] In step S271 of some embodiments, the corresponding bytes of the mass-to-charge ratio cut bytes and the intensity value cut bytes are grouped and combined, that is, the mass-to-charge ratio cut bytes and intensity value cut bytes belonging to the first byte in each first-level mass-to-charge ratio and each first-level intensity value are aggregated to form a new data block. For example, as shown in the figure... Figure 3 As shown, all the first-byte mass-to-charge ratio split bytes and the first-byte strength value split bytes are grouped together... and all the fourth-byte mass-to-charge ratio split bytes and the fourth-byte strength value split bytes are grouped together to form four third data blocks. This third data block is a combination of parity bytes.

[0046] In step S272 of some embodiments, the third data blocks are sorted in order from the most significant byte to the least significant byte to obtain a reassembled data block. For example, as shown... Figure 3 As shown, bytes are reassembled from "high-order bits to low-order bits" to form a recombined data block consisting of "data block consisting of the first byte + data block consisting of the second byte + data block consisting of the third byte + data block consisting of the fourth byte", thereby improving the local correlation of data.

[0047] In step S280 of some embodiments, the recombined data block obtained after aggregation is compressed using the Zstandard algorithm to obtain the first mass spectrometry compressed data. Through the optimized compression method of this embodiment, the compression ratio can reach 3.54, which is higher than the original compression ratio of 3.26.

[0048] In step S300 of some embodiments, the secondary mass spectrometry (MS2) data in the preprocessed mass spectrometry data is compressed using a sparse attention Transformer flow model based on mass-to-charge ratio or a point cloud flow model to obtain compressed secondary mass spectrometry data.

[0049] In some embodiments, in the mass-to-charge ratio-based sparse attention Transformer flow model compression, the mass-to-charge ratio is processed by sinusoidal embedding and the intensity is processed by linear layer embedding to construct a peak vector; this vector is then mapped to a feature vector Z by a Transformer flow model containing h flow modules (each flow module contains multiple cascaded flow layers without channel permutations) and h-1 factor layers (with a layer ratio of 50%:50%), and then encoded into secondary mass spectrometry compressed data using an asymmetric digital system (ANS). Optionally, as... Figure 4 As shown, the Transformer flow model contains 3 flow modules and 2 factor layers. Each flow module contains 8 cascaded flow layers without channel permutations.

[0050] In some embodiments, in point cloud flow model compression, the point cloud flow model compression module inputs the preprocessed mass-to-charge ratio-intensity pairs in the form of a point cloud with a preset dimension. This is then mapped to a feature vector Z through a point cloud flow model containing h flow modules and h-1 factor layers, and finally encoded using ANS to obtain the second-order mass spectrometry compressed data. The coupling layer of this point cloud flow model uses additive coupling and a STE (straight-through estimator) to solve the gradient propagation problem. Optionally, as... Figure 5 As shown, the point cloud flow model contains 3 flow modules and 2 factor layers. Each flow module contains 8 "channel permutation layers + coupling layers".

[0051] In some embodiments, step S300 may include, but is not limited to, steps S311 to S316: Step S311: Obtain the preprocessed data pairs from the secondary mass spectrometry data to obtain multiple secondary data pairs; Step S312: Project the second-level mass-to-charge ratio in the second-level data pair into a preset dimension vector to obtain the mass-to-charge ratio embedding vector; Step S313: Project the secondary intensity values ​​in the secondary data pairs into a preset dimension vector to obtain the intensity embedding vector; Step S314: Concatenate the mass-to-charge ratio embedding vector and the intensity embedding vector to obtain the peak vector; Step S315: Input the peak vector into the Transformer flow model to obtain the first target feature vector; Step S316: Encode the first target feature vector using an asymmetric digital system to obtain secondary mass spectrometry compressed data.

[0052] In step S311 of some embodiments, the preprocessed mass spectrometry data includes preprocessed data pairs. For the secondary mass spectrometry data in the preprocessed mass spectrometry data, these preprocessed data in the secondary mass spectrometry data are referred to as secondary data pairs.

[0053] In steps S312 to S314 of some embodiments, a peak vector is constructed by embedding the second-level mass-to-charge ratio (MTBR) and the second-level intensity value, and then concatenating the MTBR embedding vector and the intensity embedding vector. Optionally, in the second-level MTBR embedding, a sine / cosine function with wavelengths from 0.001 to 10000 nm is used to project the second-level MTBR into a d-dimensional vector to capture fine-grained differences in the MTBR. In the second-level intensity value embedding, a linear layer is used to project the second-level intensity value into a d-dimensional vector to match the dimension of the MTBR embedding vector. The MTBR embedding vector and the intensity embedding vector are then concatenated to obtain the peak vector. For example, in constructing the peak vector, the second-level MTBR sine / cosine embedding needs to be implemented using a wavelength piecewise function; the MTBR sine / cosine embedding formula is as follows: (2) In the formula, The first element representing the mass-to-charge ratio embedding vector 3D eigenvalues; Indicates the first The integerized mass-to-charge ratio of each ion, i.e., in formula (1) ; This indicates the maximum value of the embedded wavelength. ; This represents the minimum value of the embedding wavelength. Among them, the mass-to-charge ratio of protein mass spectrometry is typically in the range of 100 to 2000. This represents the embedding vector dimension. Optionally, in the experiment, the embedding vector dimension was set to 256 to ensure a balance between fine feature granularity and computational efficiency. Indicates the embedding vector dimension index ( ).

[0054] In step S315 of some embodiments, the peak vector is input into the sparse attention Transformer flow model, and the feature transformation of the peak vector is completed using discrete variable bijective mapping. For example, the formula for discrete variable bijective mapping is as follows: (3) In the formula, Represents the peak vector; Represents the bijective function of the flow model; Represents the eigenvector; Indicate the input distribution; This indicates the output distribution.

[0055] In some embodiments, step S315 may include, but is not limited to, steps T310 to T350: Step T310: Use the peak vector as the input feature vector; Step T320: Input the input feature vector into the current stream module to obtain the first intermediate feature vector; Step T330: Input the first intermediate feature vector into the current factor layer to obtain the second intermediate feature vector; Step T340: Take the second intermediate feature vector as the input feature vector, take the next flow module as the current flow module, take the next factor layer as the current factor layer, return to the step of inputting the input feature vector into the current flow module to obtain the first intermediate feature vector, until the last factor layer outputs the third intermediate feature vector, input the third intermediate feature vector into the last flow module to obtain the fourth intermediate feature vector; Step T350: Based on each of the second intermediate feature vectors, the third intermediate feature vector, and the fourth intermediate feature vector, obtain the first target feature vector; The Transformer flow model includes multiple flow modules and multiple factor layers.

[0056] In steps T310 to T350 of some embodiments, the peak vector is processed by the first flow module in the Transformer flow model to output a first intermediate feature vector. Then, this first intermediate feature vector is processed by the first factor layer in the Transformer flow model to output a second intermediate feature vector. The second intermediate feature vector is then processed by the second flow module in the Transformer flow model, and then by the second factor layer, and so on, until the third intermediate feature vector output by the last factor layer in the Transformer flow model is processed by the last flow module to obtain a fourth intermediate feature vector. In this process, all intermediate feature vectors output by all factor layers and the intermediate feature vector output by the last flow module are used as the first target feature vector output by the Transformer flow model.

[0057] For example, such as Figure 4 As shown, the peak vector is processed through a normalization layer, then through the first flow module and the first factor layer, outputting an intermediate feature vector Z1; then through the second flow module and the second factor layer, outputting an intermediate feature vector Z2; finally, through the last flow module, outputting an intermediate feature vector Z3. These three intermediate feature vectors Z1, Z2, and Z3 are used as the feature vector Z output by the Transformer flow model. In the factor layer, the data is modeled hierarchically at a 50% ratio, thereby reducing computational complexity.

[0058] In some embodiments, step T320 may include, but is not limited to, steps T321 to T328: Step T321: Input the input feature vector into the current flow layer; Step T322: Sort the input feature vectors in ascending order of second-order mass-to-charge ratio to obtain a feature vector sequence; Step T323: For each input feature vector in the feature vector sequence, obtain the similarity between the current input feature vector and several adjacent input feature vectors, and generate local window attention weights; Step T324: Set a dynamic threshold based on the secondary intensity value, and filter the input feature vector according to the dynamic threshold to obtain the key peak set; Step T325: Obtain the similarity between each input feature vector and the key peak set, and generate key peak attention weights; Step T326: The local window attention weights and key peak attention weights are weighted and summed to obtain the target attention weights; Step T327: Based on the target attention weights, max pooling layer, group normalization layer, and multi-layer perceptron layer, the fifth intermediate feature vector is obtained. Step T328: Take the fifth intermediate feature vector as the input feature vector, take the next flow layer as the current flow layer, and return to the step of inputting the input feature vector into the current flow layer until the last flow layer outputs the first intermediate feature vector. The flow module includes several flow layers.

[0059] In step T321 of some embodiments, the flow module includes multiple flow layers. The flow layer coupling layer contains a sparse attention Transformer encoder and a max pooling+GroupNorm+MLP. The input feature vector is input to the flow layer.

[0060] In steps T322 to T323 of some embodiments, a local window attention is constructed. Based on the characteristic of the second-order mass-to-charge ratio ascending sort, the input feature vectors are sorted to obtain a feature vector sequence. For the feature vector sequence after the second-order mass-to-charge ratio ascending sort, a local attention with a preset window size k is constructed. For each input feature vector, only the attention weights of the k / 2 peaks before and after it (a total of k adjacent peaks) are activated, that is, the similarity between the input feature vector and the k adjacent input feature vectors is obtained, and local window attention weights are generated, so that each input feature vector focuses on the k adjacent peaks, capturing the local correlation of continuous mass-to-charge ratios. For example, for the feature vector sequence after the second-order mass-to-charge ratio ascending sort, a local attention with a window size k=32 is constructed. For each input feature vector, only the attention weights of the 16 peaks before and after it (a total of 32 adjacent peaks) are activated. The calculation formula is as follows: (4) In the formula, For local window attention weights; For the first A query vector with a peak value; The key vector for all peaks; For the embedding dimension, only the 32 nearest neighbors are counted. The similarity.

[0061] In steps T324 to T325 of some embodiments, a dynamic threshold filtering is applied to the secondary intensity values. Optionally, the secondary intensity values ​​are sorted in descending order, and the top 16% of peak values ​​are taken as the key peak set, so that each input feature vector only focuses on the top 16% of peak values, filtering out redundant low intensity values. Attention is calculated by comparing each input feature vector with the key peak set, that is, the similarity between each input feature vector and the key peak set is obtained, and the key peak attention weight is constructed. The calculation formula is as follows: (5) In the formula, Key peak attention weights; For the first A query vector with a peak value; The bond vectors representing the top 16% of the intensity peaks; For the embedded dimension; This is a transpose operation.

[0062] In step T326 of some embodiments, the local window attention weight and the key peak attention weight are weighted and summed according to the weight ratio to obtain the final target attention weight. Optionally, if the weight ratio is 70% for the local window attention weight and 30% for the key peak attention weight, then the calculation formula is as follows: (6) In the formula, This represents the target attention weight.

[0063] In some embodiments, the preset window size k for local window attention can be adjusted within the range of 16 to 64, the filtering threshold for key peak attention can be adjusted within the range of 10% to 20%, and the attention weight fusion ratio can be adjusted within the range of 60% to 80% (local window) and 20% to 40% (key peak); when k=32, the filtering threshold is 16%, and the fusion ratio is 70%:30%, the attention computation complexity of the Transformer flow module is reduced from... Down to ( (Peak vector length), forward inference time is reduced by more than 90%, and MS2 data compression ratio is maintained at 3.7-3.8.

[0064] In step T327 of some embodiments, local features are output after target attention weights. These local features are then processed by a max pooling layer to extract global features. The global features are then concatenated with the input feature vector and processed by a multilayer perceptron layer to obtain the fifth intermediate feature vector output by the current flow layer.

[0065] In step T328 of some embodiments, a flow module contains multiple flow layers. The fifth intermediate feature vector output by the current flow layer is input into the next flow layer for the same processing until the last flow layer outputs the first intermediate feature vector, thus completing the feature transformation of the peak vector.

[0066] In step S316 of some embodiments, the feature vector Z (which conforms to a piecewise discrete logistic distribution) output by the Transformer stream model is encoded using an asymmetric digital system (ANS) to obtain the second-level mass spectrometry compressed data. The second-level mass spectrometry compression ratio of this embodiment can reach 3.86, which is higher than the compression ratio of 2.6 to 2.8 of general algorithms.

[0067] In some embodiments, in ANS encoding, the symbol encoding range needs to be calculated using the cumulative distribution function (CDF). The calculation formulas include CDF calculation formula (7), ANS compression formula (8), and ANS decompression formula (9): (7) (8) (9) In the formula, For the first The cumulative frequency of each symbol; For the first The frequency of occurrence of each symbol; For the first The frequency of occurrence of each symbol; The original value before ANS encoding; The value is the ANS-encoded value; The ANS encoding range parameter can be optionally set to 12 in the experiment to balance encoding efficiency and compression ratio. It is a bitmask used to extract the first bit of the encoded value. Bit; For symbolic mapping functions, according to Range matching corresponding symbols .

[0068] In some embodiments, step S300 may also include, but is not limited to, steps S321 to S324: Step S321: Obtain the preprocessed data pairs from the secondary mass spectrometry data to obtain multiple secondary data pairs; Step S322: Obtain the point cloud form of the secondary data pairs to obtain point cloud data; Step S323: Input the point cloud data into the point cloud flow model to obtain the second target feature vector; Step S324: The second target feature vector is encoded using an asymmetric digital system to obtain the second-level mass spectrometry compressed data.

[0069] In step S321 of some embodiments, the preprocessed mass spectrometry data includes preprocessed data pairs, which are referred to as secondary data pairs in the secondary mass spectrometry data of the preprocessed mass spectrometry data.

[0070] In step S322 of some embodiments, the secondary data pairs are converted into point cloud form based on a preset dimension to obtain point cloud data.

[0071] In step S323 of some embodiments, the secondary data pairs are input into the point cloud flow model in the form of point clouds with a preset dimension, and then processed through a flow module containing a "channel permutation layer + additive coupling layer" (such as...). Figure 8 The point cloud flow model (shown) and factor layers map point cloud data into feature vector Z to obtain the second target feature vector. For example, as shown... Figure 5 As shown, the point cloud data is processed through the first flow module in the point cloud flow model, then through the first factor layer, outputting feature vector Z1. This output feature vector is then processed through the second flow module and the second factor layer, outputting feature vector Z2. Finally, feature vector Z2 is processed through the third flow module, outputting feature vector Z3. Feature vectors Z1, Z2, and Z3 are used as the second target feature vector output by the point cloud flow model.

[0072] In step S324 of some embodiments, the second target feature vector is input into an asymmetric digital system (ANS) for encoding to obtain secondary mass spectrometry compressed data. The compression ratio of the secondary mass spectrometry in this embodiment of the invention is 3.1, which is higher than the compression ratio of 2.6 to 2.8 of the general algorithm.

[0073] In some embodiments, the training of both the Transformer flow model and the point cloud flow model aims to minimize the negative log-likelihood. The formula for the negative log-likelihood loss function is as follows: (10) In the formula, This represents the model loss value; Represents model parameters (including flow module weights, embedding layer parameters, etc.); This represents the number of training samples. Optionally, the number of training samples in the experiment is set to... That is, the number of samples in the training set; For the first Training samples (preprocessed mass-to-charge ratio - intensity pairs); For the model to sample The predicted probability (based on the input distribution of formula (3)) calculate).

[0074] In step S400 of some embodiments, the first-level mass spectrometry compressed data and the second-level mass spectrometry compressed data are merged, data identifiers are added (to distinguish MS1 and MS2 data), and the final compression result is output.

[0075] In some embodiments, decompressing the final compression result yields the original protein mass spectrometry data. For example, after decompressing the MS1 compressed data using Zstandard, the uint8 bytes are reassembled into uint32 type in reverse order from high to low byte. After delta incremental decoding, the mass-to-charge ratio and intensity values ​​are recovered to obtain the recovered MS1 data. The MS2 compressed data is decoded into a feature vector Z using ANS (Z must conform to a piecewise discrete logistic distribution). The mass-to-charge ratio and intensity values ​​are then recovered through inverse mapping using a Transformer flow model or a point cloud flow model to obtain the recovered MS2 data. The recovered MS1 and MS2 data are then merged to obtain the original protein mass spectrometry data.

[0076] like Figure 6 As shown, the raw mass spectrometry data is preprocessed. Based on the optimization processing and combined compression strategy, the optimized compression of MS1 and the flow model compression of MS2 work together to merge and decompress the compressed data, forming a closed-loop process to ensure lossless data recovery.

[0077] The embodiments of the present invention will be further described in detail below with reference to specific experimental data: (I) Experimental Environment and Dataset 1. Hardware environment: Intel(R) Xeon(R) Gold 6330 CPU @ 2.00GHz, NVIDIA GeForceRTX 3090 GPU (32GB, supports multi-threaded computing); 2. Software environment: Python 3.8, Adam optimizer (lr=1e-3, weight decay=1e-7, momentum=0.935); 3. Datasets: Four protein mass spectrometry datasets generated using a Bruker TimsTOF Pro mass spectrometer are shown in Table 1: Table 1

[0078] (II) Implementation Steps 1. Data Preprocessing Extract (mass-to-charge ratio, intensity) pairs from each dataset and divide them into a training set (for streaming model training), a validation set (for model parameter tuning), and a test set (for compression ratio testing) in an 8:1:1 ratio. Perform preprocessing: - Mass-to-charge ratio: Double-precision floating-point number → uint32 integer (converted via f(x)=tof / (m / z)) → ascending sort → delta incremental encoding; -Intensity: uint32 → Remove 0 values; Preprocessed data volume: 4 million (point cloud flow model) / 2 million (Transformer flow model).

[0079] 2. Flow model training The training set samples are split into batches with a peak vector length of 512 (Transformer flow model), or 2×128 or 8×128 (point cloud flow model), with each batch containing 512 samples to ensure that the model input dimension matches the sample format.

[0080] - Point cloud flow model: Input dimension 2×128 or 8×128, training for 100 epochs, batch size=512; STE is used to solve the gradient propagation problem of the rounding operation in the additive coupling layer; -Sparse attention Transformer flow model: <1> The input dimension is 512 (peak vector length), the training is performed for 100 epochs, and the batch size is 512. GroupNorm and Swish activation functions are used to optimize model convergence. <2> Sparse attention parameter optimization: The performance of the models was compared with different k (16, 32, 64), screening thresholds (10%, 16%, 20%), and fusion ratios (60%:40%, 70%:30%, 80%:20%). The results are shown in Table 2 below. Table 2

[0081] (Note: The original full attention model performed 262,144 calculations, with a forward inference time of 9.2 ms / inference). <3> Optimal parameters determined: k=32, screening threshold=16%, fusion ratio=70%:30%. At this time, the MS2 compression ratio is 3.78, the forward inference time is reduced by 90.2%, and both speed and compression ratio are balanced.

[0082] 3. Experimental Testing Compression was performed on the MS1 (1MB~5MB) and MS2 (0~300KB) data in the test set, and the test results are shown in Table 3 below: Table 3

[0083] Note: IDF++ (densenet) did not test compression / decompression speed. Since this model is mainly for image data, which is not within the scope of this invention, only the compression ratio is listed for comparison.

[0084] ANS parameter verification: Comparing the three encoding ranges of n=8, n=12, and n=16 (Formula 5-9), it was found that when n=12, the MS2 compression ratio reached 3.86, and the encoding time was only 60% of that when n=16, thus determining the optimal parameters; Mass-to-charge ratio conversion verification: using formula (1) The original double-precision mass-to-charge ratio (e.g., 280.09123456) is converted to a uint32 integer (280091235) with a conversion error ≤1e-6, which meets the lossless requirement.

[0085] 4. Decompression verification Decompress the compressed data and compare the mass-to-charge ratio error (≤1e-6) and intensity error (0) of the decompressed data with the original data to verify the lossless nature of the data; read MS1 and MS2 data separately to confirm that the reading time is ≤100ms (no additional data parsing overhead).

[0086] (III) Implementation Precautions 1. Stream model training: If the dataset is insufficient, data augmentation (such as adding a small perturbation to the mass-to-charge ratio) can be used to improve the model's generalization ability; 2. Byte aggregation: Bytes must be aggregated strictly in "high-order to low-order" order to ensure correct byte reassembly during decompression; 3. ANS encoding: The prior distribution parameters (mean μ, standard deviation s) of the feature vector Z need to be stored in advance for distribution matching during decompression.

[0087] 4. Formula (1) Calibration: Different mass spectrometers have different mass-to-charge ratio accuracies (e.g., Thermo mass spectrometers have single-precision accuracies, Bruker mass spectrometers have double-precision accuracies), and adjustments need to be made according to the instrument parameters. (e.g., single-precision mass-to-charge ratio setting) (to avoid precision loss during integerization). 5. Sample size requirement for formula (10): The number of training samples N needs to be... ,otherwise The estimation bias will exceed 15%, resulting in a decrease in the model compression ratio of ≥0.3.

[0088] This invention also provides a lossless compression system for protein mass spectrometry data, which can implement the above-mentioned lossless compression method for protein mass spectrometry data. The system includes: The preprocessing module is used to preprocess the raw protein mass spectrometry data to obtain preprocessed mass spectrometry data. The optimization and compression module is used to optimize and compress the first-level mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed first-level mass spectrometry data. The flow model compression module is used to perform Transformer flow model compression or point cloud flow model compression on the secondary mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed secondary mass spectrometry data. The lossless compression generation module is used to merge the first-level mass spectrometry compressed data and the second-level mass spectrometry compressed data to obtain the lossless compression result.

[0089] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0090] This invention also provides an electronic device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including a tablet computer, an in-vehicle computer, or similar device.

[0091] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0092] refer to Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 501 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 502 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 502 and is called and executed by the processor 501. The input / output interface 503 is used to implement information input and output; The communication interface 504 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 505 transmits information between various components of the device (e.g., processor 501, memory 502, input / output interface 503, and communication interface 504); The processor 501, memory 502, input / output interface 503, and communication interface 504 are connected to each other within the device via bus 505.

[0093] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0094] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0095] This invention also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions to cause the computer device to perform the aforementioned method.

[0096] In summary, the lossless compression method and related equipment for protein mass spectrometry data according to embodiments of the present invention have the following advantages: 1. High compression ratio: The MS1 data compression ratio of this invention reaches 3.54 (Zstandard was 3.26 before optimization), and the MS2 data compression ratio of this invention reaches 3.86 (the highest of general algorithms is 2.95), taking into account the compression requirements of MS1 and MS2.

[0097] 2. Data lossless: No loss of accuracy throughout the process, mass-to-charge ratio and intensity can be fully recovered, meeting the needs of precise proteomics analysis.

[0098] 3. Convenient reading: No need to reassemble MS1 / MS2 blocks, MS1 or MS2 data can be read separately, adapting to subsequent mass spectrometry analysis workflows.

[0099] 4. High flexibility: Supports switching between Transformer streaming model (high compression ratio) and point cloud streaming model (lower computational cost) to adapt to different computing resource scenarios.

[0100] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.

[0101] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.

[0102] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0103] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0104] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0105] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0106] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0107] Although embodiments of the invention have been shown and described, those skilled in the art will understand 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 claims and their equivalents.

[0108] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.

Claims

1. A lossless compression method for protein mass spectrometry data, characterized in that, Includes the following steps: The raw protein mass spectrometry data were preprocessed to obtain preprocessed mass spectrometry data. The first-order mass spectrometry data in the preprocessed mass spectrometry data is optimized and compressed to obtain compressed first-order mass spectrometry data. The second-level mass spectrometry data in the preprocessed mass spectrometry data is compressed using a Transformer flow model or a point cloud flow model to obtain compressed second-level mass spectrometry data. The first-level mass spectrometry compressed data and the second-level mass spectrometry compressed data are merged to obtain a lossless compression result.

2. The method according to claim 1, characterized in that, The preprocessing of the raw protein mass spectrometry data to obtain preprocessed mass spectrometry data includes the following steps: The initial mass-to-charge ratio is integerized to obtain the integerized mass-to-charge ratio. The integerized mass-to-charge ratios are sorted in ascending order, and incremental encoding is performed on the integerized mass-to-charge ratios to obtain the preprocessed mass-to-charge ratios. The initial strength value is removed from the zero value to obtain the preprocessed strength value; Wherein, the initial mass-to-charge ratio and the initial intensity value form an initial data pair; the raw protein mass spectrometry data includes the initial data pair; the preprocessed mass-to-charge ratio and the preprocessed intensity value form a preprocessed data pair; the preprocessed mass spectrometry data includes the preprocessed data pair.

3. The method according to claim 1, characterized in that, The optimization and compression of the first-level mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed first-level mass spectrometry data includes the following steps: Obtain preprocessed data pairs from the primary mass spectrometry data to obtain multiple primary data pairs; Multiple pairs of primary data are split to obtain multiple primary mass-to-charge ratios and multiple primary intensity values; The first data block is obtained by sequentially splicing together multiple first-level mass-to-charge ratios. The multiple first-level intensity values ​​are sequentially concatenated to obtain the second data block; Perform byte segmentation on each of the first-level mass-to-charge ratios in the first data block to obtain several mass-to-charge ratio segmented bytes; Each of the first-level intensity values ​​in the second data block is split into bytes to obtain several intensity value split bytes; The mass-to-charge ratio cut bytes and the intensity value cut bytes are recombined to obtain a recombined data block; The recombined data block is compressed to obtain the first-level mass spectrometry compressed data.

4. The method according to claim 3, characterized in that, The recombination of the mass-to-charge ratio slicing bytes and the intensity value slicing bytes to obtain a recombined data block includes the following steps: The mass-to-charge ratio cutting byte and the intensity value cutting byte are combined with corresponding bytes to obtain several third data blocks; The third data blocks are sorted according to the order from the most significant byte to the least significant byte to obtain the recombined data block.

5. The method according to claim 1, characterized in that, The preprocessed mass spectrometry data is compressed using the Transformer streaming model to obtain compressed second-level mass spectrometry data, including the following steps: Obtain preprocessed data pairs from the secondary mass spectrometry data to obtain multiple secondary data pairs; Projecting the second-level mass-to-charge ratio in the second-level data pair into a preset dimension vector yields the mass-to-charge ratio embedding vector; The secondary intensity values ​​in the secondary data pairs are projected onto the preset dimension vector to obtain the intensity embedding vector; The peak vector is obtained by concatenating the mass-to-charge ratio embedding vector and the intensity embedding vector. The peak vector is input into the Transformer flow model to obtain the first target feature vector; The first target feature vector is encoded using an asymmetric digital system to obtain the compressed secondary mass spectrometry data.

6. The method according to claim 5, characterized in that, The step of inputting the peak vector into the Transformer flow model to obtain the first target feature vector includes the following steps: Use the peak vector as the input feature vector; The input feature vector is input into the current stream module to obtain the first intermediate feature vector; The first intermediate feature vector is input into the current factor layer to obtain the second intermediate feature vector; The second intermediate feature vector is used as the input feature vector, the next flow module is used as the current flow module, the next factor layer is used as the current factor layer, and the step of inputting the input feature vector into the current flow module to obtain the first intermediate feature vector is repeated until the last factor layer outputs the third intermediate feature vector, and the third intermediate feature vector is input into the last flow module to obtain the fourth intermediate feature vector. The first target feature vector is obtained based on each of the second intermediate feature vectors, the third intermediate feature vector, and the fourth intermediate feature vector; The Transformer flow model includes multiple flow modules and multiple factor layers.

7. The method according to claim 6, characterized in that, The input feature vector is input into the current stream module to obtain the first intermediate feature vector. Includes the following steps: Input the input feature vector into the current flow layer; The input feature vectors are sorted in ascending order of the second-order mass-to-charge ratio to obtain a feature vector sequence. For each input feature vector in the feature vector sequence, the similarity between the current input feature vector and several adjacent input feature vectors is obtained, and local window attention weights are generated. A dynamic threshold is set based on the secondary intensity value, and the input feature vector is filtered according to the dynamic threshold to obtain a set of key peaks; Obtain the similarity between each input feature vector and the key peak set, and generate key peak attention weights; The target attention weight is obtained by weighted summation of the local window attention weight and the key peak attention weight. The fifth intermediate feature vector is obtained based on the target attention weights, max pooling layer, group normalization layer, and multilayer perceptron layer. The fifth intermediate feature vector is used as the input feature vector, the next flow layer is used as the current flow layer, and the step of inputting the input feature vector into the current flow layer is returned until the last flow layer outputs the first intermediate feature vector. The flow module includes several flow layers.

8. The method according to claim 1, characterized in that, The preprocessed mass spectrometry data is compressed using a point cloud flow model to obtain compressed second-level mass spectrometry data, including the following steps: Obtain preprocessed data pairs from the secondary mass spectrometry data to obtain multiple secondary data pairs; Obtain the point cloud form of the secondary data pairs to obtain point cloud data; The point cloud data is input into the point cloud flow model to obtain the second target feature vector; The second target feature vector is encoded using an asymmetric digital system to obtain the compressed secondary mass spectrometry data.

9. A lossless compression system for protein mass spectrometry data, characterized in that, include: The preprocessing module is used to preprocess the raw protein mass spectrometry data to obtain preprocessed mass spectrometry data. An optimization compression module is used to optimize and compress the first-level mass spectrometry data in the preprocessed mass spectrometry data to obtain compressed first-level mass spectrometry data. The flow model compression module is used to perform Transformer flow model compression or point cloud flow model compression on the secondary mass spectrometry data in the preprocessed mass spectrometry data to obtain secondary mass spectrometry compressed data. The lossless compression generation module is used to merge the first-level mass spectrometry compressed data and the second-level mass spectrometry compressed data to obtain the lossless compression result.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.