Data processing method and device, computer equipment and storage medium
By converting mass spectrometry data into images and using deep learning model detection, the problems of low efficiency and large error in mass spectrometry data are solved, and efficient and accurate component content analysis is achieved.
Patent Information
- Application Number
- CN202411105033.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-05
AI Technical Summary
The existing mass spectrometry data processing efficiency is low and is prone to measurement errors, resulting in insufficient manual processing efficiency.
The mass spectrometry data is converted into a mass spectrometry image, and the content label of the components to be measured in the sample is determined by the distribution of pixel values in the image, and image detection is performed using a deep learning model to improve processing efficiency and reduce errors.
It realizes efficient determination of the content label of the components to be tested in the sample, reduces processing time, and improves the accuracy and efficiency of data processing.
Smart Images

Figure CN118897040A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of mass spectrometry analysis, and in particular to a data processing method, apparatus, computer equipment and storage medium. Background Art
[0002] Liquid chromatography-mass spectrometry is a technology that combines liquid chromatography (LC) and mass spectrometry (MS). It mainly uses a liquid mass spectrometer to measure the mass-to-charge ratio (m / z) of molecules or atomic ions for mass spectrometry analysis. The mass spectrometry data obtained by the liquid mass spectrometer test contains multiple dimensions such as time, mass number scanning range, mass spectrum intensity, and primary and secondary mass spectra, so it has the characteristics of large data volume, multiple data types, and diversified dimensions.
[0003] Currently, the mass spectrometry data is mainly analyzed manually to analyze and determine the components contained in the sample. However, due to the large amount of data, data types, and diversified dimensions of the aforementioned mass spectrometry data, it takes a lot of time to process manually. In addition, liquid mass spectrometry instruments are prone to more or less measurement errors due to factors such as changes in environmental parameters (for example, temperature, humidity, etc.), changes in the accuracy of accessories, and differences in the physical or chemical properties of the sample itself. In order to analyze the components in the sample during manual processing, the errors contained in the above mass spectrometry data must also be analyzed. It can be seen that due to the characteristics of mass spectrometry data and the fact that the test equipment is prone to errors due to its high precision, there is a problem of insufficient efficiency when manually processing mass spectrometry data. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium that can improve the efficiency of mass spectrometry data processing in response to the above technical problems.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, including:
[0006] Acquire first mass spectrum data of the sample; wherein the first mass spectrum data includes a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio;
[0007] Determine a pixel point based on the first retention time and the first mass-to-charge ratio, and determine a pixel value of the pixel point based on the first mass spectrum intensity to obtain a first mass spectrum image;
[0008] Based on the pixel values in the first mass spectrometry image, a content label of the component to be tested in the sample is determined.
[0009] In one embodiment, determining a pixel point based on the first retention time and the first mass-to-charge ratio, and determining a pixel value of the pixel point based on the first mass spectrum intensity to obtain a first mass spectrum image includes:
[0010] By dividing the first retention time and the first mass-to-charge ratio, the first mass spectrum data is divided into a plurality of target areas; wherein the target areas correspond to the pixel points;
[0011] Based on a preset rule, the first mass spectrum intensity in the target area is converted into the pixel value to obtain the first mass spectrum image.
[0012] In one embodiment, the time length between the target regions is equal, and the mass-to-charge ratio range is equal; the time length corresponds to the first retention time, and the mass-to-charge ratio range corresponds to the first mass-to-charge ratio;
[0013] The converting the first mass spectrum intensity in the target area into the pixel value based on a preset rule to obtain the first mass spectrum image includes:
[0014] Aggregating the first mass spectrum intensity in the target area according to the preset rule to obtain a target mass spectrum intensity;
[0015] The target mass spectrum intensity is converted into a grayscale value, and the grayscale value is determined as the pixel value; thus, the first mass spectrum image is obtained.
[0016] In one embodiment, before determining the content label of the component to be tested in the sample based on the pixel value in the first mass spectrometry image, the method further includes:
[0017] Acquire a first data set; wherein the first data set includes preset second mass spectrum data and preset labels corresponding one-to-one to the second mass spectrum data;
[0018] Performing data enhancement processing on the second mass spectrum data to obtain third mass spectrum data and a second data set; wherein the second data set includes the second mass spectrum data and the third mass spectrum data;
[0019] Converting the second data set into a mass spectrometry image set, and using the mass spectrometry image set to train the model to be trained until the loss function value of the model to be trained is less than a preset function threshold, thereby obtaining a target model;
[0020] Then, determining the content label of the component to be tested in the sample based on the pixel value in the first mass spectrum image includes:
[0021] The first mass spectrum image is input into the target model to obtain the content label.
[0022] In one embodiment, the performing data enhancement processing on the second mass spectrum data to obtain third mass spectrum data and a second data set includes:
[0023] Performing drift processing on at least one of a second retention time, a second mass-to-charge ratio, and a second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data; wherein the third mass spectrum data includes at least one of a third retention time, a third mass-to-charge ratio, and a third mass spectrum intensity corresponding to the second mass spectrum intensity;
[0024] The second mass spectrum data and the third mass spectrum data are combined to obtain the second data set.
[0025] In one embodiment, performing drift processing on at least one of the second retention time, the second mass-to-charge ratio, and the second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data includes:
[0026] In response to the processing instruction, the second retention time is subjected to drift processing, and the sum of the second retention time and the first drift amount is determined to be the third retention time; in response to the processing instruction, the second mass-to-charge ratio is subjected to drift processing, and the sum of the second mass-to-charge ratio and the second drift amount is determined to be the third mass-to-charge ratio; and in response to the processing instruction, the second mass spectrum intensity is subjected to drift processing, and the product of the second mass spectrum intensity and the third drift amount is determined to be the third mass spectrum intensity; the first drift amount belongs to a first preset range, the second drift amount belongs to a second preset range, and the third drift amount belongs to a third preset range;
[0027] The third mass spectrum data is determined based on at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity.
[0028] In one embodiment, the first preset range is [-20, 20], excluding 0; the second preset range is [-1, 1], excluding 0; and the third preset range is (1, 1.5).
[0029] In a second aspect, an embodiment of the present application provides a data processing device, including:
[0030] A data module, configured to obtain first mass spectrum data of a sample; wherein the first mass spectrum data comprises a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio;
[0031] An image module, configured to determine a pixel point based on the first retention time and the first mass-to-charge ratio, and determine a pixel value of the pixel point based on the first mass spectrum intensity, so as to obtain a first mass spectrum image;
[0032] A label module is used to determine the content label of the component to be tested in the sample based on the pixel value in the first mass spectrum image.
[0033] In one of the embodiments, the image module is specifically used to divide the first mass spectrum data into multiple target areas by dividing the first retention time and the first mass-to-charge ratio; wherein the target area corresponds to the pixel point; based on a preset rule, the first mass spectrum intensity in the target area is converted into the pixel value to obtain the first mass spectrum image.
[0034] In one embodiment, the time length between the target regions is equal, and the mass-to-charge ratio range is equal; the time length corresponds to the first retention time, and the mass-to-charge ratio range corresponds to the first mass-to-charge ratio;
[0035] The image module is specifically used to aggregate the first mass spectrum intensity in the target area through the preset rule to obtain the target mass spectrum intensity; convert the target mass spectrum intensity into a grayscale value, and determine the grayscale value as the pixel value; then obtain the first mass spectrum image.
[0036] In one embodiment, the device further includes a model module for acquiring a first data set; wherein the first data set includes preset second mass spectrum data and preset labels corresponding to the second mass spectrum data one by one; performing data enhancement processing on the second mass spectrum data to obtain third mass spectrum data and a second data set; wherein the second data set includes the second mass spectrum data and the third mass spectrum data; converting the second data set into a mass spectrum image set, and using the mass spectrum image set to train a model to be trained until the loss function value of the model to be trained is less than a preset function threshold, thereby obtaining a target model;
[0037] The label module is specifically used to input the first mass spectrum image into the target model to obtain the content label.
[0038] In one embodiment, the model module is specifically used to perform drift processing on at least one of the second retention time, the second mass-to-charge ratio, and the second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data; wherein the third mass spectrum data includes at least one of a third retention time, a third mass-to-charge ratio, and a third mass spectrum intensity corresponding to the second mass spectrum intensity; and the second mass spectrum data and the third mass spectrum data are combined to obtain the second data set.
[0039] In one embodiment, the model module is specifically used to respond to the processing instruction including drift processing on the second retention time, and determine that the sum of the second retention time and the first drift amount is the third retention time; respond to the processing instruction including drift processing on the second mass-to-charge ratio, and determine that the sum of the second mass-to-charge ratio and the second drift amount is the third mass-to-charge ratio; and respond to the processing instruction including drift processing on the second mass spectrum intensity, and determine that the product of the second mass spectrum intensity and the third drift amount is the third mass spectrum intensity; the first drift amount belongs to a first preset range, the second drift amount belongs to a second preset range, and the third drift amount belongs to a third preset range; based on at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity, determine the third mass spectrum data.
[0040] In one embodiment, the first preset range is [-20, 20], excluding 0; the second preset range is [-1, 1], excluding 0; and the third preset range is (1, 1.5).
[0041] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect and any embodiment when executing the computer program.
[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect and any one of the embodiments are implemented.
[0043] The above-mentioned data processing method, device, computer equipment and storage medium achieve the purpose of converting the first mass spectrum data into a first mass spectrum image by converting the first retention time in the first mass spectrum data and the first mass-to-charge ratio corresponding to the first retention time into pixel points, and converting the first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio in the pixel points into pixel values, thereby converting the mass spectrum analysis into an image detection task, and efficiently determining the content label of the component to be tested in the sample by detecting the pixel values and the distribution of the corresponding pixel points in the first mass spectrum image. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flow chart of a data processing method in one embodiment;
[0045] Figure 2 Schematic diagram of a mass spectrometry image conversion method in one embodiment;
[0046] Figure 3A is a schematic diagram of first mass spectrum data in one embodiment;
[0047] Figure 3B A schematic diagram of dividing a target area based on first mass spectrum data in one embodiment;
[0048] Figure 3C In one embodiment, Figure 3A A schematic diagram of a first mass spectrum image obtained by converting the first mass spectrum data;
[0049] Figure 4 is a schematic diagram of a process for processing drift of second mass spectrum data in one embodiment;
[0050] Figure 5 A schematic diagram of the composition of a mass spectrometry image set when training a model to be trained in one embodiment;
[0051] Figure 6 is a structural block diagram of a data processing device in one embodiment;
[0052] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In response to the problem of insufficient efficiency in current mass spectrometry data processing, in the method provided in the embodiment of the present application, the mass spectrometry data is converted into a first mass spectrometry image to determine the content label of the component to be tested in the sample through the color distribution in the first mass spectrometry image (i.e., the difference in pixel values of each pixel point), and the content label may be, for example, high content, low content, etc.; thereby efficiently determining whether the sample contains the component to be tested, as well as the content label of the component to be tested.
[0054] The technical solution of the present application is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.
[0055] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0056] Please refer to Figure 1In some embodiments, a data processing method is provided, the method comprising the following steps:
[0057] Step 101, obtaining first mass spectrum data of a sample.
[0058] The first mass spectrum data includes a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio.
[0059] Specifically, the first retention time, the first mass-to-charge ratio, and the first mass spectrum intensity can be obtained from the primary mass spectrum data in the first mass spectrum data.
[0060] The first mass spectrum data may also include secondary mass spectrum data. In order to extract the primary mass spectrum data from the first mass spectrum data, the first mass spectrum data may be first format-converted to obtain the first mass spectrum data in a target format for easy processing. The target format may be: .mzXML. Then, the first mass spectrum data in the target format is read by a preset processing rule to extract the primary mass spectrum data.
[0061] Furthermore, the primary mass spectrum data may be subjected to denoising processing to obtain a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio.
[0062] Step 102: Determine a pixel point based on the first retention time and the first mass-to-charge ratio, and determine a pixel value of the pixel point based on the first mass spectrum intensity to obtain a first mass spectrum image.
[0063] The pixel value may indicate the color information of the pixel.
[0064] Specifically, since the first mass spectrum intensity (the primary mass spectrum data in) can correspond to a set of first retention time and first mass-to-charge ratio, the first retention time, the first mass-to-charge ratio, and the first mass spectrum intensity can be regarded as a data set.
[0065] Then the relationship between the first retention time, the first mass-to-charge ratio, and the first mass spectrum intensity in each data set can be equivalent to a three-dimensional relationship (x, y, z), where x can be the first retention time, y can be the first mass-to-charge ratio, and z can be the first mass spectrum intensity.
[0066] Thus, the position of the corresponding mass spectrum data in the first mass spectrum data of the sample can be located by (x, y), and a pixel point in the two-dimensional plane can be uniquely located by the first retention time and the first mass-to-charge ratio. Further, the first mass spectrum intensity can be used to determine the pixel value through the correspondence between the first mass spectrum intensity and the first retention time and the first mass-to-charge ratio, and the correspondence between the first mass spectrum intensity and the pixel point can be obtained, thereby realizing the conversion of the aforementioned three-dimensional relationship into a two-dimensional image to obtain a first mass spectrum image.
[0067] In some embodiments, a pixel point can be directly determined according to the first retention time and the first mass-to-charge ratio in each set of primary mass spectrum data, and then the first mass spectrum intensity in the set of primary mass spectrum data is used as the pixel value of the pixel point. The number of pixels in the first mass spectrum image thus obtained is determined according to the first retention time and the first mass-to-charge ratio in the first mass spectrum data.
[0068] Since the method provided in the embodiment of the present application is to determine the content label of the component to be tested, and does not need to determine the specific content of the component to be tested, in order to further improve the processing efficiency, in some embodiments, the first retention time and the first mass-to-charge ratio can be divided, and the target area obtained by the division is used as a pixel point; accordingly, the pixel value of the pixel point can be obtained by aggregating the first mass spectrum intensity in the target area. The number of pixels in the first mass spectrum image obtained in this way is a preset fixed value, and the number of first mass spectrum intensities contained in each target area can be the same or different.
[0069] Furthermore, the above pixel value may be a grayscale value of a single channel.
[0070] Alternatively, the pixel value may also be a three-channel RGB value.
[0071] According to the above pixel points and pixel values, a first mass spectrum image with uneven color distribution can be generated. The color distribution in the first mass spectrum image corresponds to the content of the component to be measured in the sample.
[0072] Step 103: Determine the content label of the component to be tested in the sample based on the pixel value in the first mass spectrum image.
[0073] Specifically, different positions in the first mass spectrum image correspond to different components. When the pixel value of a certain position in the image is close to 0, it means that the sample does not contain the component to be tested corresponding to the position.
[0074] When the pixel value of a pixel point at a certain position in the image reaches a preset standard, it means that the sample contains the component to be tested corresponding to the position. Then, the content label of the corresponding component to be tested can be determined based on the pixel value.
[0075] In some embodiments, a deep learning model can be used to process the first mass spectrometry image, so as to extract and calculate the features of the pixels and pixel values of the key areas (i.e., areas that may contain a component to be tested) and the areas adjacent to the key areas in the first mass spectrometry image through the deep learning model, and accurately divide the edges of the key areas and accurately locate the key areas corresponding to the components to be tested, so as to accurately determine the components to be tested contained in the sample, and accurately determine the pixel values in the key areas, and then accurately obtain the content labels. The deep learning model may include: 3 convolutional layers, 3 pooling layers, 1 flattening layer, and 2 fully connected layers.
[0076] Furthermore, the above-mentioned content label is used to indicate the content range of the above-mentioned component to be tested, and the content label may include a high content label, a medium content label, and a low content label; then the specific high content label corresponds to the high content range, the medium content label corresponds to the intermediate content range, and the low content label corresponds to the low content range.
[0077] For example, the content interval of high content is greater than 2 mg / L, the content interval of middle content is 0.5-2 mg / L, and the content interval of low content is less than 0.5 mg / L. If the content label is high, it means that the content of the corresponding component to be tested in the sample is greater than 2 mg / L.
[0078] The components to be tested in the above-mentioned sample may be one or more. In some embodiments, the above-mentioned content label may also include a zero content label, which is used to indicate that the sample does not contain the component to be tested. This embodiment is particularly suitable for the case where the same sample contains multiple components to be tested. The above-mentioned deep learning model accurately identifies whether the sample contains each component to be tested and the content range of each component to be tested contained in the sample by processing the first mass spectrometry image.
[0079] In the above data processing method, the first mass spectrum data of three dimensions are converted into a two-dimensional image, and the components to be tested contained in the sample are determined by distinguishing and detecting the pixel values reflecting the mass spectrum intensity in the two-dimensional image, thereby avoiding the problem of insufficient efficiency caused by separately processing the first mass spectrum data of different dimensions and comprehensively analyzing the processing results of each dimension.
[0080] As described in step 102, in some embodiments, the image conversion efficiency can be improved by reducing the amount of data. Figure 2 :
[0081] Step 201: Divide the first mass spectrum data into a plurality of target regions by dividing the first retention time and the first mass-to-charge ratio.
[0082] Among them, the target area corresponds to the pixel point.
[0083] Specifically, Figure 3A A first mass spectrum data representation method provided in an embodiment of the present application, wherein retention time corresponds to a first retention time, in seconds. m / z corresponds to a first mass-to-charge ratio. LC-MS (Liquid chromatography coupled with mass spectrometry) raw data corresponds to the above-mentioned first mass spectrum intensity.
[0084] Figure 3B For Figure 3A The first mass spectrum image obtained by dividing the first retention time and the first mass-to-charge ratio in Figure 3B As shown, the length of the dashed grid is equivalent to the mass-to-charge ratio range, and the width of the dashed grid is equivalent to the retention time length. Each dashed grid is equivalent to a target area; the "·" in each dashed grid indicates that the first retention time and the first mass-to-charge ratio corresponding to the target area have the first mass spectrum intensity, and the "·" contains the corresponding first mass spectrum intensity value.
[0085] Please continue to refer to Figure 3B , the lengths between dashed grids are equal, and the widths between dashed grids are equal. That is, the time lengths between target areas are equal, and the mass-to-charge ratio ranges are equal.
[0086] The time length corresponds to the first retention time, that is, the unit length when dividing the first retention time. The mass-to-charge ratio range corresponds to the first mass-to-charge ratio, that is, the unit length when dividing the first mass-to-charge ratio. In some embodiments, the first retention time is taken from 30-1150 seconds, and the time length is taken from 2-10 seconds; preferably, the time length is taken from 4-7 seconds, for example, 5 seconds. The first mass-to-charge ratio is taken from 70-200m / z, and the mass-to-charge ratio range is 0.3-0.7, for example, 0.5m / z or 0.6m / z. In this way, while improving the conversion efficiency, the problem of decreased accuracy of the content label obtained in step 103 due to the target area coverage being too large can be avoided.
[0087] Step 202: Based on a preset rule, convert the first mass spectrum intensity in the target area into a pixel value to obtain a first mass spectrum image.
[0088] The above preset rule may be used to indicate how to aggregate the first mass spectrum intensities to obtain pixel values.
[0089] Then, according to the preset rule, the first mass spectrum intensity in the target area can be aggregated to obtain the target mass spectrum intensity corresponding to the target area one by one. The aggregation method here can be calculated according to the following formula:
[0090]
[0091] Where m is the number of first mass spectrum intensities in the target area, d is the first mass spectrum intensity, and D is the target mass spectrum intensity. Then d n is the value of the nth first mass spectrum intensity, Represents the sum of the abundances of the first mass spectrum intensity in the target region; that is, the target mass spectrum intensity is equal to the sum of the abundances in the target region.
[0092] Then, according to a preset rule, the target mass spectrum intensity is converted into a grayscale value, and the grayscale value is determined as the pixel value of the target area, so as to obtain a first mass spectrum image. Specifically, the above target intensity can be multiplied by a preset coefficient to obtain a grayscale value. The preset coefficient can be selected from 1-10; preferably 10.
[0093] In this way, after determining the pixel points and the pixel values of each pixel point, we can get the following Figure 3B The first mass spectrometry image is shown.
[0094] It can be seen that the pixel value of each pixel in the first mass spectrum image is positively correlated with the number of first mass spectrum intensities in the target area and the value of the first mass spectrum intensity. For example, when the value of the first mass spectrum intensity is at a high level, even if the number of first mass spectrum intensities in the target area is relatively small, the pixel value corresponding to the target area is also high.
[0095] Alternatively, in some embodiments, the target mass spectrum intensity can be converted into RGB three-channel pixel values by a preset rule, and the RGB three-channel pixel values are the pixel values of the target area. Specifically, R can be the abundance sum of the first mass spectrum intensity in the target area, G can be the average abundance of the first mass spectrum intensity in the target area, and B can be the standard deviation of the abundance of the first mass spectrum intensity.
[0096] It can be seen that the first retention time and the first mass-to-charge ratio are used as the division objects, and the first retention time and the first mass-to-charge ratio are divided at the same time. By dividing the first mass spectrum data from two different dimensions, the first mass spectrum data can be divided into multiple target areas. The multiple target areas can correspond to multiple pixel points, and the first mass spectrum intensity in the multiple target areas can correspond to the pixel value of the pixel point, so as to obtain a two-dimensional first mass spectrum image, thereby integrating the primary mass spectrum data of multiple dimensions (i.e., the primary mass spectrum data in the first mass spectrum data) into the first mass spectrum image, and realizing dimensionality reduction (i.e., reducing the data dimension of the first mass spectrum data). On this basis, the division of the target area further reduces the data volume of the first mass spectrum data.
[0097] Further, as described in step 103, in order to further improve efficiency, in some embodiments, the content label of the component to be tested can be obtained through a deep learning model, that is, the first mass spectrum image is input into the target model to obtain the content label. The training of the target model is described below:
[0098] First, a first data set may be obtained, wherein the first data set includes preset second mass spectrum data and preset labels corresponding to the second mass spectrum data in a one-to-one manner.
[0099] Then, data enhancement processing is performed on the second mass spectrum data in the first data set to obtain third mass spectrum data, and a second data set containing the second mass spectrum data and the third mass spectrum data is obtained. The label of the third mass spectrum data obtained after the enhancement processing of the second mass spectrum data corresponds to (is the same as) the label of the second mass spectrum data before the enhancement processing.
[0100] It can be seen that the number of mass spectrum data in the second data set is greater than the number of second mass spectrum data preset in the first data set, and the number of labels in the second data set is equal to the number of labels in the first preset set.
[0101] Next, the second data set can be converted into a mass spectrometry image set, that is, the second mass spectrometry data and the third mass spectrometry data in the second data set are converted into second mass spectrometry images. Multiple second mass spectrometry images can constitute a mass spectrometry image set, and the preset label corresponding to each second mass spectrometry image can be determined according to the preset label corresponding to the second mass spectrometry data or the third mass spectrometry data in the second data set.
[0102] The mass spectrum image set is used to train the model to be trained: the mass spectrum image set is sequentially input into the model to be trained, the model to be trained outputs a model label corresponding to the second mass spectrum image or the third mass spectrum image in the mass spectrum image set, and the difference between the model label and the preset label is calculated by the loss function, so as to reversely adjust the parameters in the model to be trained by the loss function. The loss function value of the loss function indicates the difference between the model label output by the model to be trained and the preset label of the corresponding mass spectrum image.
[0103] Therefore, the model to be trained is reversely tuned through the loss function value, the loss function value gradually decreases, the difference between the model label output and the preset label gradually decreases, and the accuracy gradually increases. Until the loss function value of the model to be trained is less than the preset function threshold, it can be determined that the accuracy of the model to be trained meets the preset requirements, and the target model is determined to be obtained.
[0104] In this way, the content label can be predicted by the target model, that is, the first mass spectrum image to be processed is input into the target model to obtain the content label of the component to be measured in the sample.
[0105] Furthermore, in order to improve the training efficiency of the model, when performing the data enhancement processing as described above, the first data set and / or the mass spectrometry image obtained by transforming the first data set can be respectively enhanced from different dimensions, and then the results obtained by the data enhancement processing are merged. The following first describes the enhancement processing of the first data set, please refer to Figure 4 :
[0106] Step 401: performing drift processing on at least one of a second retention time, a second mass-to-charge ratio, and a second mass spectrum intensity in second mass spectrum data.
[0107] The third mass spectrum data after drift includes at least one of a third retention time, a third mass-to-charge ratio, and a third mass spectrum intensity, and the third mass spectrum intensity is obtained by drifting the second mass spectrum intensity.
[0108] The second mass spectrum intensity corresponds to the second retention time and the second mass-to-charge ratio. Consistent with the first mass spectrum data, each second mass spectrum data is actually represented as a data set, consisting of 1 second retention time, 1 second mass-to-charge ratio and 1 second mass spectrum intensity. Therefore, the third mass spectrum data can be obtained by drift processing one or more items in each data set; the third mass spectrum data includes at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity corresponding to the second mass spectrum intensity.
[0109] Specifically, the drift processing may be performed according to a preset processing instruction, which includes one or more of performing a drift processing on the second retention time, performing a drift processing on the second mass-to-charge ratio, and performing a drift processing on the second mass spectrum intensity.
[0110] then in response to the processing instruction including performing drift processing on the second retention time, determining the sum of the second retention time and the first drift amount as a third retention time;
[0111] In response to the processing instruction, the processing instruction includes performing drift processing on the second mass-to-charge ratio, and determining the sum of the second mass-to-charge ratio and the second drift amount as a third mass-to-charge ratio;
[0112] And, in response to the processing instruction including performing drift processing on the second mass spectrum intensity, determining that the product of the second mass spectrum intensity and the third drift amount is the third mass spectrum intensity, and the third drift amount belongs to a third preset range.
[0113] After drift processing is performed according to the processing instruction, the third mass spectrum data can be determined based on at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity. For example, the third mass spectrum data may include: a data group consisting of the second retention time, the third mass-to-charge ratio, and the third mass spectrum intensity; a data group consisting of the second retention time, the second mass-to-charge ratio, and the third mass spectrum intensity; a data group consisting of the second retention time, the third mass-to-charge ratio, and the second mass spectrum intensity; a data group consisting of the third retention time, the second mass-to-charge ratio, and the third mass spectrum intensity; a data group consisting of the third retention time, the third mass-to-charge ratio, and the second mass spectrum intensity.
[0114] That is, at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity can be selected, and the others can be correspondingly combined with the second mass spectrum data (second retention time, second mass-to-charge ratio, second mass spectrum intensity) to obtain the third mass spectrum data.
[0115] Furthermore, in order to ensure the accuracy of the preset labels of the third mass spectrum data obtained after drift processing of each group of second mass spectrum data, the first drift amount of the second retention time belongs to the first preset range, the second drift amount of the second mass-to-charge ratio belongs to the second preset range, and the third drift amount of the second mass spectrum intensity is less than the third threshold.
[0116] The first preset range is [-20, 20] and does not include 0; that is, the first drift amount m 1 ∈[-20, 20], and m 1 ≠ 0. Alternatively, the first preset range may also be a range located in [-20, 20] and not including 0.
[0117] The second preset range is [-1, 1] and does not include 0; that is, the second drift amount m 2 ∈[-1, 1], and m 2 ≠ 0. Alternatively, the second preset range may also be a range located in [-1, 1] and not including 0.
[0118] The third preset range is (1,1.5]; that is, the third drift amount m 3 ∈(1,1.5]. Alternatively, the third preset range may also be a range within (1,1.5].
[0119] Step 402: Combine the second mass spectrum data and the third mass spectrum data to obtain a second data set.
[0120] The second mass spectrum data and the third mass spectrum data in the second data set can be converted into a second mass spectrum image in sequence, and the second mass spectrum image corresponds to the preset labels of the second mass spectrum data and the third mass spectrum data respectively. The method of converting the second mass spectrum image can be specifically referred to steps 201-202, which will not be repeated here.
[0121] In some embodiments, data enhancement processing can be performed on the second mass spectrum image obtained by converting the second mass spectrum data to further expand the amount of data used to train the model to be trained. Specifically, brightness drift, random cropping and filling processing, and noise addition can be performed on the same second mass spectrum image obtained by converting the second mass spectrum data.
[0122] like Figure 5 As shown, in this embodiment, the mass spectrum image set includes the second mass spectrum data in the second data set, the second mass spectrum image obtained by converting the third mass spectrum data, and the mass spectrum image obtained by enhancing the second mass spectrum image.
[0123] To further verify the data processing method provided in the embodiments of the present application, the mass spectrometry data of a sample set in which the components to be tested are 3-methylpyrazine and 4-methylpyrazine are used to perform the aforementioned data processing method to obtain content labels of the components to be tested contained in multiple samples as an example.
[0124] In this example, after the mass spectrometry data is converted into a mass spectrometry image according to the aforementioned steps 101-102, the mass spectrometry image is processed using the deep learning model described in one of the aforementioned embodiments.
[0125] The mass spectrum data includes mass spectrum data of a first type sample set containing 3-methylpyrazine and mass spectrum data of a second type sample set containing 4-methylpyrazine; each sample in each type sample set is taken from the same type of sample; for example, the samples in the first type sample set are taken from samples containing 3-methylpyrazine, and the content labels corresponding to 3-methylpyrazine in each sample are not all the same. The content label can be analyzed by the current manual processing method for the corresponding mass spectrum data, and the content label obtained by the analysis is used as a preset label.
[0126] The first 80% of the mass spectrometry data in each type of sample set contains preset labels and is used as a training set to train the model to be trained. The mass spectrometry data of the last 20% of the samples is a validation set for verification, which is used to verify the accuracy of the target model obtained through training. The model to be trained adopts a convolutional neural network model including 3 convolutional layers, 3 pooling layers, and 2 fully connected layers. The configuration parameters of the model to be trained include: a 3×3 convolution kernel, a stride (step length) of 1, and a padding (padding) of 1; a 2×2 maximum pooling layer, a stride (step length) of 2, and a padding (padding) of 0.
[0127] The loss function of the model to be trained uses the cross entropy loss function, and the optimizer uses the adaptive matrix (Adam) optimizer. The initial learning rate of the Adam optimizer is set to 0.001, and then the Adam optimizer can adaptively adjust the learning rate according to the historical gradient information. In the early stage of training, the learning rate of 0.001 can make the loss function converge faster. As the training of the model to be trained is optimized, the learning rate decreases. Using a lower learning rate in the later stage of training can more accurately find the minimum value of the loss function (the minimum value is less than the preset threshold).
[0128] The above-mentioned preset labels include high content, medium content, and low content. For the mass spectrometry data of the first type of sample set, the high content indicates that the content of trimethylpyrazine in the corresponding sample is greater than 2 mg / L; the medium content indicates that the content of trimethylpyrazine in the corresponding sample is 0.5-2 mg / L; the low content indicates that the content of trimethylpyrazine in the corresponding sample is less than 0.5 mg / L. For the mass spectrometry data of the samples in the second type of sample set, the high content indicates that the content of tetramethylpyrazine in the corresponding sample is greater than 5 mg / L; the medium content indicates that the content of tetramethylpyrazine in the corresponding sample is 1-5 mg / L; the low content indicates that the content of tetramethylpyrazine in the corresponding sample is less than 1 mg / L.
[0129] When the above-mentioned training set is used to train the above-mentioned model to be trained, the retention time, mass-to-charge ratio, and mass spectrum intensity of each group of mass spectrum data in the training set can be drifted respectively with reference to steps 401-402. After each group of mass spectrum data is drifted, three groups of mass spectrum data are obtained, that is, the drift-processed mass spectrum data includes any two of the original retention time, the original mass-to-charge ratio, and the original mass spectrum intensity, and the remaining one is the drift-processed data. Among them, the first drift amount of the retention time can be randomly generated by its random number generator or random function, and the randomly generated random number belongs to [1,10].
[0130] Similarly, the second drift of the mass-to-charge ratio can be randomly generated by its random number generator or random function, and the randomly generated random number belongs to [0.1, 0.6].
[0131] The third drift amount of the mass spectrum intensity can be randomly generated by its random number generator or random function, and the randomly generated random number belongs to [1.1, 1.3].
[0132] In addition to the mass spectrum data before drift processing, the training set also includes mass spectrum data after drift processing; the mass spectrum data after drift processing includes: a data set consisting of retention time after drift processing, mass-to-charge ratio before drift processing, and mass spectrum intensity before drift processing; a data set consisting of retention time before drift processing, mass-to-charge ratio before drift processing, and mass spectrum intensity before drift processing; a data set consisting of retention time before drift processing, mass-to-charge ratio before drift processing, and mass spectrum intensity after drift processing. The preset labels of the mass spectrum data obtained by drift processing and the mass spectrum data obtained before drift processing are the same.
[0133] Furthermore, the mass spectrum data before the drift processing and the mass spectrum data after the drift processing can be converted into a mass spectrum image. Specifically, the mass-to-charge ratio and mass spectrum intensity corresponding to the retention time within 30-1150 seconds in the mass spectrum data can be determined first.
[0134] Then, the retention time is divided into 224 regions, and the mass-to-charge ratio is divided into 224 regions. After equal division, the target region consisting of the retention time and the mass-to-charge ratio is obtained, and the size of each target region is the same. And each target region is taken as a pixel point, then the mass spectrum image pixel is 224×224 pixels. The mass spectrum intensity in the target region is calculated and the abundance is summed as the pixel value of its single channel. The label of each mass spectrum image is the same as the preset label of the mass spectrum data (including the mass spectrum data before and after drift processing).
[0135] Furthermore, for the mass spectrum image obtained by converting the mass spectrum data before drift processing, the ColorJitter transformation is used to perform brightness drift; non-negative grayscale noise is generated and added to the image for noise addition, and the value of the grayscale noise is within the preset noise range; and, through the RandomAffine transformation, the slight movement caused by image cropping is simulated, and random cropping and filling processing is performed, thereby achieving the purpose of data enhancement processing on the mass spectrum image.
[0136] The label of the mass spectrum image after data enhancement processing is the same as the label of the mass spectrum image before data enhancement processing.
[0137] After the above processing, the training set includes: the mass spectrum image corresponding to the initial mass spectrum data, the mass spectrum image corresponding to the mass spectrum data after drift processing, and the mass spectrum image obtained by performing the above data enhancement processing on the mass spectrum image converted from the initial mass spectrum data. The labels of the mass spectrum images in the above training sets are consistent with the data or images before data enhancement.
[0138] Furthermore, after completing the preliminary configuration of the aforementioned model to be trained and the expansion of the training set, the mass spectrometry images in the training set are input into the model to be trained, and the parameters in the model to be trained are optimized by the optimizer and loss function of the model to be trained to obtain the target model.
[0139] The mass spectrometry image conversion method described above was used to input the validation set into the target model. The validation results are shown in Table 1.
[0140] Table 1
[0141]
[0142] It can be seen from Table 1 that the method provided in the embodiment of the present application not only effectively improves the processing efficiency of mass spectrometry data, but also ensures that the accuracy of the mass spectrometry data processing results is not affected.
[0143] It should be understood that although Figure 1-Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0144] In one embodiment, Figure 6 As shown, a data processing device is provided, including: a data module 601, an image module 602 and a label module 603, wherein:
[0145] The data module 601 is used to obtain first mass spectrum data of a sample.
[0146] The first mass spectrum data includes a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio.
[0147] The image module 602 is used to determine a pixel point based on the first retention time and the first mass-to-charge ratio, and to determine a pixel value of the pixel point based on the first mass spectrum intensity, so as to obtain a first mass spectrum image.
[0148] The image module 602 is specifically used for:
[0149] The first mass spectrum data is divided into a plurality of target areas by dividing the first retention time and the first mass-to-charge ratio; wherein the target areas correspond to the pixel points; based on a preset rule, the first mass spectrum intensity within the target areas is converted into the pixel values to obtain the first mass spectrum image.
[0150] The time length between the target region and the target region is equal, and the mass-to-charge ratio range is equal; the time length corresponds to the first retention time, and the mass-to-charge ratio range corresponds to the first mass-to-charge ratio;
[0151] Then the image module 602 is specifically used for:
[0152] The first mass spectrum intensity in the target area is aggregated according to the preset rule to obtain the target mass spectrum intensity; the target mass spectrum intensity is converted into a gray value, and the gray value is determined as the pixel value; then the first mass spectrum image is obtained.
[0153] The label module 603 is used to determine the content label of the component to be tested in the sample based on the pixel value in the first mass spectrum image.
[0154] The device also includes a model module, which is used to obtain a first data set; wherein the first data set includes preset second mass spectrum data and preset labels corresponding to the second mass spectrum data one by one; perform data enhancement processing on the second mass spectrum data to obtain third mass spectrum data and a second data set; wherein the second data set includes the second mass spectrum data and the third mass spectrum data; convert the second data set into a mass spectrum image set, and use the mass spectrum image set to train a to-be-trained model until the loss function value of the to-be-trained model is less than a preset function threshold, thereby obtaining a target model;
[0155] The label module 603 is specifically used for:
[0156] The first mass spectrum image is input into the target model to obtain the content label.
[0157] The model module is specifically used to perform drift processing on at least one of the second retention time, the second mass-to-charge ratio, and the second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data; wherein the third mass spectrum data includes at least one of a third retention time, a third mass-to-charge ratio, and a third mass spectrum intensity corresponding to the second mass spectrum intensity; and combine the second mass spectrum data and the third mass spectrum data to obtain the second data set.
[0158] The model module is specifically used to respond to the processing instruction including drift processing on the second retention time, and determine that the sum of the second retention time and the first drift amount is the third retention time; respond to the processing instruction including drift processing on the second mass-to-charge ratio, and determine that the sum of the second mass-to-charge ratio and the second drift amount is the third mass-to-charge ratio; and respond to the processing instruction including drift processing on the second mass spectrum intensity, and determine that the product of the second mass spectrum intensity and the third drift amount is the third mass spectrum intensity; the first drift amount belongs to a first preset range, the second drift amount belongs to a second preset range, and the third drift amount belongs to a third preset range; based on at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity, determine the third mass spectrum data.
[0159] The first preset range is [-20, 20], excluding 0; the second preset range is [-1, 1], excluding 0; and the third preset range is (1, 1.5).
[0160] For the specific definition of the data processing device, please refer to the definition of the data processing method above, which will not be repeated here. Each module in the above data processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0161] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0162] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0163] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0164] Acquire first mass spectrum data of the sample; wherein the first mass spectrum data includes a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio;
[0165] Determine a pixel point based on the first retention time and the first mass-to-charge ratio, and determine a pixel value of the pixel point based on the first mass spectrum intensity to obtain a first mass spectrum image;
[0166] Based on the pixel values in the first mass spectrometry image, a content label of the component to be tested in the sample is determined.
[0167] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0168] The first mass spectrum data is divided into a plurality of target areas by dividing the first retention time and the first mass-to-charge ratio; wherein the target areas correspond to the pixel points; based on a preset rule, the first mass spectrum intensity within the target areas is converted into the pixel values to obtain the first mass spectrum image.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] The time lengths between the target areas are equal, and the mass-to-charge ratio ranges are equal; the time length corresponds to the first retention time, and the mass-to-charge ratio range corresponds to the first mass-to-charge ratio; then, through the preset rule, the first mass spectrum intensity in the target area is aggregated to obtain the target mass spectrum intensity; the target mass spectrum intensity is converted into a grayscale value, and the grayscale value is determined to be the pixel value; then, the first mass spectrum image is obtained.
[0171] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0172] Acquire a first data set; wherein the first data set includes preset second mass spectrum data, and a preset label corresponding to the second mass spectrum data one by one; perform data enhancement processing on the second mass spectrum data to obtain third mass spectrum data, and a second data set; wherein the second data set includes the second mass spectrum data and the third mass spectrum data; convert the second data set into a mass spectrum image set, and use the mass spectrum image set to train a model to be trained until the loss function value of the model to be trained is less than a preset function threshold, thereby obtaining a target model; then input the first mass spectrum image into the target model to obtain the content label.
[0173] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0174] Drift processing is performed on at least one of the second retention time, the second mass-to-charge ratio, and the second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data; wherein the third mass spectrum data includes at least one of a third retention time, a third mass-to-charge ratio, and a third mass spectrum intensity corresponding to the second mass spectrum intensity; and the second mass spectrum data and the third mass spectrum data are combined to obtain the second data set.
[0175] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0176] Acquire first mass spectrum data of the sample; wherein the first mass spectrum data includes a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio;
[0177] Determine a pixel point based on the first retention time and the first mass-to-charge ratio, and determine a pixel value of the pixel point based on the first mass spectrum intensity to obtain a first mass spectrum image;
[0178] Based on the pixel values in the first mass spectrometry image, a content label of the component to be tested in the sample is determined.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] The first mass spectrum data is divided into a plurality of target areas by dividing the first retention time and the first mass-to-charge ratio; wherein the target areas correspond to the pixel points; based on a preset rule, the first mass spectrum intensity within the target areas is converted into the pixel values to obtain the first mass spectrum image.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] The time lengths between the target areas are equal, and the mass-to-charge ratio ranges are equal; the time length corresponds to the first retention time, and the mass-to-charge ratio range corresponds to the first mass-to-charge ratio; then, through the preset rule, the first mass spectrum intensity in the target area is aggregated to obtain the target mass spectrum intensity; the target mass spectrum intensity is converted into a grayscale value, and the grayscale value is determined to be the pixel value; then, the first mass spectrum image is obtained.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] Acquire a first data set; wherein the first data set includes preset second mass spectrum data, and a preset label corresponding to the second mass spectrum data one by one; perform data enhancement processing on the second mass spectrum data to obtain third mass spectrum data, and a second data set; wherein the second data set includes the second mass spectrum data and the third mass spectrum data; convert the second data set into a mass spectrum image set, and use the mass spectrum image set to train a model to be trained until the loss function value of the model to be trained is less than a preset function threshold, thereby obtaining a target model; then input the first mass spectrum image into the target model to obtain the content label.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0186] Performing drift processing on at least one of a second retention time, a second mass-to-charge ratio, and a second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data; wherein the third mass spectrum data includes at least one of a third retention time, a third mass-to-charge ratio, and a third mass spectrum intensity corresponding to the second mass spectrum intensity;
[0187] The second mass spectrum data and the third mass spectrum data are combined to obtain the second data set.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] In response to the processing instruction, the second retention time is subjected to drift processing, and the sum of the second retention time and the first drift amount is determined to be the third retention time; in response to the processing instruction, the second mass-to-charge ratio is subjected to drift processing, and the sum of the second mass-to-charge ratio and the second drift amount is determined to be the third mass-to-charge ratio; and in response to the processing instruction, the second mass spectrum intensity is subjected to drift processing, and the product of the second mass spectrum intensity and the third drift amount is determined to be the third mass spectrum intensity; the first drift amount belongs to a first preset range, the second drift amount belongs to a second preset range, and the third drift amount belongs to a third preset range;
[0190] The third mass spectrum data is determined based on at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity.
[0191] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0192] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several deformations and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the patent of this application shall be based on the attached claims.
Claims
1. A data processing method, characterized in that: include: Acquire first mass spectrum data of the sample; wherein the first mass spectrum data includes a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio; Determine a pixel point based on the first retention time and the first mass-to-charge ratio, and determine a pixel value of the pixel point based on the first mass spectrum intensity to obtain a first mass spectrum image; Based on the pixel values in the first mass spectrometry image, a content label of the component to be tested in the sample is determined.
2. The method according to claim 1, characterized in that The step of determining a pixel point based on the first retention time and the first mass-to-charge ratio, and determining a pixel value of the pixel point based on the first mass spectrum intensity to obtain a first mass spectrum image includes: By dividing the first retention time and the first mass-to-charge ratio, the first mass spectrum data is divided into a plurality of target areas; wherein the target areas correspond to the pixel points; Based on a preset rule, the first mass spectrum intensity in the target area is converted into the pixel value to obtain the first mass spectrum image.
3. The method according to claim 2, characterized in that The time lengths between the target regions are equal, and the mass-to-charge ratio ranges are equal; the time length corresponds to the first retention time, and the mass-to-charge ratio range corresponds to the first mass-to-charge ratio; The converting the first mass spectrum intensity in the target area into the pixel value based on a preset rule to obtain the first mass spectrum image includes: Aggregating the first mass spectrum intensity in the target area according to the preset rule to obtain a target mass spectrum intensity; The target mass spectrum intensity is converted into a grayscale value, and the grayscale value is determined as the pixel value; thus, the first mass spectrum image is obtained.
4. The method according to any one of claims 1 to 3, characterized in that: Before determining the content label of the component to be tested in the sample based on the pixel value in the first mass spectrum image, the method further includes: Acquire a first data set; wherein the first data set includes preset second mass spectrum data and preset labels corresponding one-to-one to the second mass spectrum data; Performing data enhancement processing on the second mass spectrum data to obtain third mass spectrum data and a second data set; wherein the second data set includes the second mass spectrum data and the third mass spectrum data; Converting the second data set into a mass spectrometry image set, and using the mass spectrometry image set to train the model to be trained until the loss function value of the model to be trained is less than a preset function threshold, thereby obtaining a target model; Then, determining the content label of the component to be tested in the sample based on the pixel value in the first mass spectrum image includes: The first mass spectrum image is input into the target model to obtain the content label.
5. The method according to claim 4, characterized in that The step of performing data enhancement processing on the second mass spectrum data to obtain third mass spectrum data and a second data set includes: Performing drift processing on at least one of a second retention time, a second mass-to-charge ratio, and a second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data; wherein the third mass spectrum data includes at least one of a third retention time, a third mass-to-charge ratio, and a third mass spectrum intensity corresponding to the second mass spectrum intensity; The second mass spectrum data and the third mass spectrum data are combined to obtain the second data set.
6. The method according to claim 5, characterized in that The step of performing drift processing on at least one of a second retention time, a second mass-to-charge ratio, and a second mass spectrum intensity in the second mass spectrum data to obtain the third mass spectrum data comprises: In response to the processing instruction, the second retention time is subjected to drift processing, and the sum of the second retention time and the first drift amount is determined to be the third retention time; in response to the processing instruction, the second mass-to-charge ratio is subjected to drift processing, and the sum of the second mass-to-charge ratio and the second drift amount is determined to be the third mass-to-charge ratio; and in response to the processing instruction, the second mass spectrum intensity is subjected to drift processing, and the product of the second mass spectrum intensity and the third drift amount is determined to be the third mass spectrum intensity; the first drift amount belongs to a first preset range, the second drift amount belongs to a second preset range, and the third drift amount belongs to a third preset range; The third mass spectrum data is determined based on at least one of the third retention time, the third mass-to-charge ratio, and the third mass spectrum intensity.
7. The method according to claim 6, characterized in that The first preset range is [-20, 20], excluding 0; the second preset range is [-1, 1], excluding 0; and the third preset range is (1, 1.5).
8. A data processing device, characterized in that: include: A data module, configured to obtain first mass spectrum data of a sample; wherein the first mass spectrum data comprises a first retention time, a first mass-to-charge ratio, and a first mass spectrum intensity corresponding to the first retention time and the first mass-to-charge ratio; An image module, configured to determine a pixel point based on the first retention time and the first mass-to-charge ratio, and determine a pixel value of the pixel point based on the first mass spectrum intensity, so as to obtain a first mass spectrum image; A label module is used to determine the content label of the component to be tested in the sample based on the pixel value in the first mass spectrum image.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
