Decompression method for nucleic acid mass spectrometry data
Through the decompression method of nucleic acid mass spectrometry data, the problem that MassArray spectrum data can only be opened in MassArray software is solved, efficient decompression and integration of data is achieved, the data processing process is simplified, and the convenience of software integration development is improved.
Patent Information
- Application Number
- CN202410352788.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-03-26
AI Technical Summary
Because MassArray spectrum data uses a unique and complex compression algorithm, it can only be opened through MassArray software and cannot be directly integrated in other software systems, causing users to frequently switch software during data analysis, causing inconvenience.
Provides a method for decompressing nucleic acid mass spectrometry data, including finding files, reading spectrum data, decompressing the data, and converting it into a common format so that it can be previewed and displayed in third-party software. Specific steps include splitting and decompressing the original data to form a universal two-dimensional array, which can then be directly integrated and displayed in third-party software.
It achieves efficient decompression of MassArray spectrum data into universal two-dimensional data, so that it can be directly integrated and displayed in third-party software systems, simplifying the data processing process and improving the convenience of software integration development.
Smart Images

Figure CN118193470B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to a method for decompressing nucleic acid mass spectrometry data. Background Art
[0002] The spectrum data of MassArray is the result data generated after the flight mass spectrometer is completed. It is a string composed of double-precision floating-point numbers separated by commas. According to analysis, the spectrum data of MassArray is obtained through a unique and complex compression algorithm. The spectrum data can be stored in an independent file, which can only be opened by MassArray software, which is extremely unfavorable for the integration of other software. Currently, the existing third-party software systems on the market cannot directly integrate MassArray spectrum data. Users need to switch back and forth between multiple software systems when performing data analysis, which causes great inconvenience to users. Summary of the invention
[0003] The purpose of this application is to provide a method for decompressing nucleic acid mass spectrometry data to solve the technical problems raised in the above background technology.
[0004] To achieve the above purpose, the present application discloses the following technical solution: a method for decompressing nucleic acid mass spectrometry data, the method comprising the following steps:
[0005] Step A, find the file: according to the target file name, find the file address of the file in the file system. If the file cannot be found, exit. If the file is found, execute step B.
[0006] Step B, read spectrum: read spectrum file, if reading fails, it will exit, if reading succeeds, execute step C;
[0007] Step C, decompressing the spectrum: decompressing the original spectrum data into general spectrum data using a decompression method. If the decompression fails, the process will exit. If the decompression succeeds, the process will proceed to step D.
[0008] Step D, preview the spectrum with third-party software: preview and open the decompressed general spectrum data in the third-party software. If the preview fails, an error message will be displayed. If the preview succeeds, go to step E.
[0009] Step E: Close the file: close the target file stream.
[0010] Preferably, the step C specifically comprises:
[0011] Step C11: collect spectrum data, split it according to the segmentation symbol, and obtain a primary one-dimensional array double[n], where n is the index length, double[0] indicates the total length of the spectrum array, double[1] indicates whether the spectrum array is generated normally, double[2] indicates the total index length of the spectrum array decompressed into a two-dimensional array, double[3] indicates the starting frequency value of the spectrum, double[4] indicates the fixed scaling value of the spectrum, and double[5] indicates the frequency step value of the spectrum;
[0012] Step C12: further splitting the primary one-dimensional array according to a preset splitting rule to obtain a plurality of split one-dimensional arrays;
[0013] Step C13: performing calculation and decompression on the multiple split one-dimensional arrays respectively to obtain multiple converted one-dimensional arrays;
[0014] Step C14: merging and traversing the multiple converted one-dimensional arrays to form a common two-dimensional array result.
[0015] Preferably, the decompressed general spectrum data is the general two-dimensional array result.
[0016] Preferably, the splitting rules specifically include:
[0017] Define to take the array range value from the m1 index in the primary one-dimensional array, assign the value of double[m1] to h1 to determine the array length, the array value formula is: array[h1]={double[m1+1],double[m1+2],....,double[m1+h1]}, and get the one-dimensional array after the first segment split;
[0018] Define to take the array range value from the m2 index in the primary one-dimensional array, assign the value of double[m2] to h2 to determine the array length, the array value formula is: array[h2]={double[m2+1],double[m2+2],....,double[m2+h2]}, and get the one-dimensional array after the second segment split;
[0019] Define to take the array range value from the m3 index in the primary one-dimensional array, assign the value of double[m3] to h3 to determine the array length, the array value formula is: array[h3]={double[m3+1],double[m3+2],....,double[m3+h3]}, and get the one-dimensional array after the third segment split;
[0020] Define to take the array range value from the m4 index in the primary one-dimensional array, assign the value of double[m4] to h4 to determine the array length, the array value formula is: array[h4]={double[m4+1],double[m4+2],....,double[m4+h4]}, and get the one-dimensional array after the fourth segment split;
[0021] Define to take the array range value from the m5 index in the primary one-dimensional array, assign the value of double[m5] to h5 to determine the array length, the array value formula is: array[h5]={double[m5+1],double[m5+2],....,double[m5+h5]}, and get the one-dimensional array after the fifth segment split;
[0022] Define the array range value from the m6 index in the primary one-dimensional array, assign the value of double[m6] to h6 to determine the array length, the array value formula is: array[h6]={double[m6+1],double[m6+2],....,double[m6+h6]}, and get the one-dimensional array after the sixth segment split.
[0023] Preferably, the operation decompression specifically includes:
[0024] Perform square root operation on the one-dimensional array after the first segment is split to obtain the one-dimensional array after the first segment is converted;
[0025] Perform bitwise operation on the one-dimensional array after the second segment is split to obtain the one-dimensional array after the second segment is converted;
[0026] Raise the exponential power of the one-dimensional array after the third segment is split to obtain the one-dimensional array after the third segment is converted;
[0027] Perform modf on the one-dimensional array after the fourth segment is split to obtain the one-dimensional array after the fourth segment is converted;
[0028] After splitting the fifth segment, multiply the one-dimensional array by Math.LOG2E to obtain the converted one-dimensional array of the fifth segment.
[0029] To traverse the one-dimensional array after splitting the sixth segment, first perform n=Math.Pow(2,0)-1, where n is a variable, then perform m=(n+1.0)*Math.Pow(2,y*Math.LOG2E), where m is a variable and y is the value in array[h6], and calculate z=m / n to obtain the one-dimensional array after the sixth segment is converted.
[0030] Beneficial effects: The nucleic acid mass spectrometry data decompression method of the present application can efficiently decompress the spectrum data into general two-dimensional data, and keep it consistent with the data results displayed by the software, so that the third-party software system can directly integrate the decompressed data and directly display it using various data visualization components on the market, which is more conducive to the integrated development of software manufacturers and provides great convenience to system users. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0032] Figure 1 A flowchart of a method for decompressing nucleic acid mass spectrometry data provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a specific process of step C provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of a conventional MassArray spectrum data opening process provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0036] In this article, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprising..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0037] like Figure 3 As shown in the figure, the process of opening the spectrum data of the traditional MassArray has the following steps:
[0038] Step 1, find the file: according to the target file name, find the file address of the file in the file system. If the file cannot be found, exit. If the file is found, execute step 2.
[0039] Step 2, read spectrum: read spectrum file, if reading fails, it will exit, if reading succeeds, go to step 3;
[0040] Step 3, preview spectrum in MassArray: preview and open the spectrum data in MassArray. If the preview fails, an error message will be displayed. If the preview succeeds, proceed to step 4.
[0041] Step 4, close the file: close the target file stream.
[0042] Since MassArray's spectral data is obtained through a unique and complex compression algorithm, the spectral data can be stored in an independent file, which can only be opened by MassArray software. This is extremely unfavorable for the integration of other software. When users perform data analysis, they need to switch back and forth between multiple software systems, causing great inconvenience to users.
[0043] In this regard, this embodiment discloses a method such as Figure 1 The method for decompressing nucleic acid mass spectrometry data shown in the figure comprises the following steps:
[0044] Step A, search for files: According to the target file name, find the file address of the file in the file system. If the file cannot be found, exit. If the file is found, execute step B.
[0045] Step B, read spectrum: read spectrum file, if reading fails, it will exit (for example, reading non-spectrum file will fail, an abnormal information will be reported to the program and exit), if reading is successful, execute step C.
[0046] Step C, decompressing the spectrum: decompressing the original spectrum data into general spectrum data using a decompression method. If the decompression fails, the program will exit (for example, when the original spectrum data is incomplete, an exception message will be thrown and the program will exit). If the decompression succeeds, step D will be executed; Figure 2 As shown, the step C specifically includes:
[0047] Step C11: Collect the spectrum data and split it according to the segmentation symbol to obtain a primary one-dimensional array double[n], where n is the index length, double[0] indicates the total length of the spectrum array, double[1] indicates whether the spectrum array is generated normally, double[2] indicates the total index length of the spectrum array decompressed into a two-dimensional array, double[3] indicates the starting frequency value of the spectrum, double[4] indicates the fixed scaling value of the spectrum, and double[5] indicates the frequency step value of the spectrum.
[0048] Step C12: further split the primary one-dimensional array according to a preset splitting rule to obtain a plurality of split one-dimensional arrays; specifically, the splitting rule is:
[0049] Define to take the array range value from the m1 index in the primary one-dimensional array, assign the value of double[m1] to h1 to determine the array length, the array value formula is: array[h1]={double[m1+1],double[m1+2],....,double[m1+h1]}, and get the one-dimensional array after the first segment split;
[0050] Define to take the array range value from the m2 index in the primary one-dimensional array, assign the value of double[m2] to h2 to determine the array length, the array value formula is: array[h2]={double[m2+1],double[m2+2],....,double[m2+h2]}, and get the one-dimensional array after the second segment split;
[0051] Define to take the array range value from the m3 index in the primary one-dimensional array, assign the value of double[m3] to h3 to determine the array length, the array value formula is: array[h3]={double[m3+1],double[m3+2],....,double[m3+h3]}, and get the one-dimensional array after the third segment split;
[0052] Define to take the array range value from the m4 index in the primary one-dimensional array, assign the value of double[m4] to h4 to determine the array length, the array value formula is: array[h4]={double[m4+1],double[m4+2],....,double[m4+h4]}, and get the one-dimensional array after the fourth segment split;
[0053] Define to take the array range value from the m5 index in the primary one-dimensional array, assign the value of double[m5] to h5 to determine the array length, the array value formula is: array[h5]={double[m5+1],double[m5+2],....,double[m5+h5]}, and get the one-dimensional array after the fifth segment split;
[0054] Define the array range value from the m6 index in the primary one-dimensional array, assign the value of double[m6] to h6 to determine the array length, the array value formula is: array[h6]={double[m6+1],double[m6+2],....,double[m6+h6]}, and get the one-dimensional array after the sixth segment split.
[0055] Step C13: performing calculation and decompression on the multiple split one-dimensional arrays respectively to obtain multiple converted one-dimensional arrays;
[0056] Step C14: merging and traversing the multiple converted one-dimensional arrays to form a common two-dimensional array result as the common spectrum data.
[0057] Step D, preview the spectrum with third-party software (for example, in actual applications, use a line chart such as echarts' visualization chart as the target result, and use the general spectrum data as a data source): preview and open the decompressed general spectrum data in the third-party software. If the preview fails, an error message will be reported. If the preview is successful, execute step E.
[0058] Step E: Close the file: close the target file stream.
[0059] Among them, in step C13, the operation decompression specifically includes:
[0060] Perform square root operation (Math.Sqrt) on the one-dimensional array after the first segment is split to obtain the one-dimensional array after the first segment is converted;
[0061] Perform bitwise operation on the one-dimensional array after splitting the second segment. If x is greater than zero, then x<<1=x*2; if x is less than zero, then x>>1=x / 2. Then, the one-dimensional array after the second segment conversion is obtained.
[0062] Perform exponential power (Math.Pow) on the one-dimensional array after the third segment is split to obtain the one-dimensional array after the third segment is converted;
[0063] Perform modf on the one-dimensional array after the fourth segment is split, return the decimal part (the part after the decimal point), and set integer to the integer part to obtain the one-dimensional array after the fourth segment is converted;
[0064] After splitting the fifth segment, multiply the one-dimensional array by Math.LOG2E to obtain the converted one-dimensional array of the fifth segment.
[0065] To traverse the one-dimensional array after splitting the sixth segment, first perform n=Math.Pow(2,0)-1, where n is a variable, then perform m=(n+1.0)*Math.Pow(2,y*Math.LOG2E), where m is a variable and y is the value in array[h6], and calculate z=m / n to obtain the one-dimensional array after the sixth segment is converted.
[0066] In summary, the decompression method of nucleic acid mass spectrometry data provided in this embodiment can efficiently decompress MassArray spectrum data into general two-dimensional data, and keep it consistent with the data results displayed by MassArray software, so that third-party software systems can directly integrate the decompressed data and directly display it using various data visualization components on the market, which is more conducive to the integrated development of software manufacturers and provides great convenience to system users.
[0067] In the present embodiment, for software implementation, part or all of the process of the embodiment can be completed by instructing the relevant hardware through a computer program. When implemented, the above program can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Specifically, the computer-readable storage medium includes a computer storage medium and a communication medium, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that can be accessed by a computer. The computer-readable storage medium can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer.
[0068] Finally, it should be noted that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for decompressing nucleic acid mass spectrometry data, characterized in that: The method comprises the following steps: Step A, find the file: according to the target file name, find the file address of the file in the file system. If the file cannot be found, exit. If the file is found, execute step B. Step B, read spectrum: read spectrum file, if reading fails, it will exit, if reading succeeds, execute step C; Step C, decompressing the spectrum: decompressing the original spectrum data into general spectrum data using a decompression method. If the decompression fails, the process will exit. If the decompression succeeds, the process will proceed to step D. Step D, preview the spectrum with third-party software: preview and open the decompressed general spectrum data in the third-party software. If the preview fails, an error message will be displayed. If the preview succeeds, go to step E. Step E, close the file: close the target file stream; Wherein, the step C specifically includes: Step C11: collect spectrum data, split it according to the segmentation symbol, and obtain a primary one-dimensional array double[n], where n is the index length, double[0] indicates the total length of the spectrum array, double[1] indicates whether the spectrum array is generated normally, double[2] indicates the total index length of the spectrum array decompressed into a two-dimensional array, double[3] indicates the starting frequency value of the spectrum, double[4] indicates the fixed scaling value of the spectrum, and double[5] indicates the frequency step value of the spectrum; Step C12: further splitting the primary one-dimensional array according to a preset splitting rule to obtain a plurality of split one-dimensional arrays; Step C13: performing calculation and decompression on the multiple split one-dimensional arrays respectively to obtain multiple converted one-dimensional arrays; Step C14: merging and traversing the converted one-dimensional arrays of the multiple segments to form a common two-dimensional array result; The splitting rules specifically include: Define to take the array range value from the m1 index in the primary one-dimensional array, assign the value of double[m1] to h1 to determine the array length, the array value formula is: array[h1]={double[m1+1],double[m1+2],....,double[m1+h1]}, and get the one-dimensional array after the first segment split; Define to take the array range value from the m2 index in the primary one-dimensional array, assign the value of double[m2] to h2 to determine the array length, the array value formula is: array[h2]={double[m2+1],double[m2+2],....,double[m2+h2]}, and get the one-dimensional array after the second segment split; Define to take the array range value from the m3 index in the primary one-dimensional array, assign the value of double[m3] to h3 to determine the array length, the array value formula is: array[h3]={double[m3+1],double[m3+2],....,double[m3+h3]}, and get the one-dimensional array after the third segment split; Define to take the array range value from the m4 index in the primary one-dimensional array, assign the value of double[m4] to h4 to determine the array length, the array value formula is: array[h4]={double[m4+1],double[m4+2],....,double[m4+h4]}, and get the one-dimensional array after the fourth segment split; Define to take the array range value from the m5 index in the primary one-dimensional array, assign the value of double[m5] to h5 to determine the array length, the array value formula is: array[h5]={double[m5+1],double[m5+2],....,double[m5+h5]}, and get the one-dimensional array after the fifth segment split; Define to take the array range value from the m6 index in the primary one-dimensional array, assign the value of double[m6] to h6 to determine the array length, the array value formula is: array[h6]={double[m6+1],double[m6+2],....,double[m6+h6]}, and get the one-dimensional array after the sixth segment split; The operation decompression specifically includes: Perform square root operation on the one-dimensional array after the first segment is split to obtain the one-dimensional array after the first segment is converted; Perform bitwise operation on the one-dimensional array after the second segment is split to obtain the one-dimensional array after the second segment is converted; Raise the exponential power of the one-dimensional array after the third segment is split to obtain the one-dimensional array after the third segment is converted; Perform modf on the one-dimensional array after the fourth segment is split to obtain the one-dimensional array after the fourth segment is converted; After splitting the fifth segment, multiply the one-dimensional array by Math.LOG2E to obtain the converted one-dimensional array of the fifth segment. To traverse the one-dimensional array after splitting the sixth segment, first perform n=Math.Pow(2,0)-1, where n is a variable, then perform m=(n+1.0)*Math.Pow(2,y*Math.LOG2E), where m is a variable and y is the value in array[h6], and calculate z=m / n to obtain the one-dimensional array after the sixth segment is converted.
2. The method for decompressing nucleic acid mass spectrometry data according to claim 1, characterized in that: The decompressed general spectrum data is the general two-dimensional array result.
Citation Information
Patent Citations
Multi-resolution switched audio encoding / decoding scheme
CN102177426A
Frequency spectrum recovery method based on time-domain signal low rank
CN105976329A
