MALDI-TOF mass spectrum microbiological identification method based on inter-spectrum distance

By employing a dimensionality reduction method based on interspectral distance and a two-stage k-NN classification, the problem of insufficient accuracy in microbial identification using MALDI-TOF mass spectrometry was solved, achieving high-precision classification and identification of closely related microorganisms and improving classification stability and interpretability.

CN122045601APending Publication Date: 2026-05-15TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TONGJI UNIV
Filing Date
2026-01-16
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing MALDI-TOF mass spectrometry methods for microbial identification are not accurate enough in distinguishing closely related microbial species. In particular, linear dimensionality reduction methods such as PCA are difficult to capture nonlinear structural information. Nonlinear methods are computationally complex and difficult to generalize, resulting in low classification accuracy.

Method used

A dimensionality reduction method based on inter-spectral distance is adopted. Through inter-spectral distance calculation and two-stage k-NN classification, combined with the inter-spectral distance algorithm (DbDRA) and preprocessing steps such as wavelet denoising, baseline correction, peak extraction and merging, nonlinear, discriminative feature vectors are generated for microbial classification.

Benefits of technology

It significantly improves the classification accuracy and interpretability of microbial mass spectrometry data, especially for difficult-to-distinguish species such as Salmonella enteritidis and Salmonella typhimurium, with a classification accuracy of up to 95%. It enhances the ability to distinguish highly similar microorganisms and improves classification stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122045601A_ABST
    Figure CN122045601A_ABST
Patent Text Reader

Abstract

The invention discloses a MALDI-TOF mass spectrum microbiological identification method based on the distance between spectrums, and the method comprises the following steps: 1, spectrum data preprocessing: carrying out denoising and baseline correction processing on original mass spectrum data, extracting and merging corrected data peaks, and carrying out normalization processing to form a data list; step 2, carrying out average reference spectrum construction on the data based on spectrum spacing dimension reduction, and collecting a plurality of representative spectrums for each microorganism; pairing the same spectrum by using a peak value matching algorithm; calculating the average position and intensity of each group of matching peaks to form an average reference spectrum; constructing an average reference spectrum, then carrying out inter-spectrum distance calculation, obtaining peaks corresponding to the sample spectrum and the average reference spectrum, then calculating an inter-peak distance, and generating a distance vector as a low-dimensional representation of the microorganism sample spectrum; and step 3, microorganism classification: performing binary classification and multi-classification on the microorganism sample to complete microorganism identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microbial detection and data analysis technology, and in particular to a MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance. Background Technology

[0002] Diseases caused by microorganisms pose a significant challenge to global public health, making rapid and accurate pathogen identification crucial for clinical diagnosis and treatment. Traditional methods for microbial identification include biochemical assays based on metabolic phenotypes and molecular biology techniques targeting genetic material. In recent years, MALDI-TOF MS has emerged as a powerful phenotypic tool, widely used in microbial identification due to its advantages such as soft ionization conditions, high throughput, high reliability, and low cost. Commercially available MALDI-TOF MS microbial identification systems, such as Bruker Biotyper and bioMérieux Vitek MS, identify species by comparing the spectra of the sample to reference spectra in a database.

[0003] However, MALDI-TOF MS spectral data are typically high-dimensional, containing a large number of mass-to-charge ratios (m / z) and intensity vectors, and these features are complex, variable, and inevitably contain noise. Although the algorithms of commercial systems are relatively mature, their accuracy in distinguishing closely related microbial species remains problematic. For example, studies have shown that the identification rate of certain species (such as Shigella dysenteriae and Shigella boydii) is less than 64% when distinguishing between Escherichia coli and Shigella. This indicates that existing database-based alignment models have limitations in handling species that are difficult to distinguish. To improve the accuracy of high-throughput microbial identification, optimizing each stage of mass spectrometry data analysis, including data preprocessing, feature extraction, and classification, is of significant research importance. Dimensionality reduction, as a key step, can remove redundant features, retain key information, reduce computational costs, reduce overfitting, and improve signal-to-noise ratio and classification accuracy. Principal component analysis (PCA) is one of the most commonly used dimensionality reduction methods. It can explain most of the data variance with a small number of principal components, achieving data compression and noise reduction. However, PCA is a linear dimensionality reduction method that easily loses non-linear structural information in the data. The principal components it generates are linear combinations of the original variables, often lacking interpretability and having a weak direct correlation with class labels, which may affect its performance in classification tasks. Although improved methods such as kernel PCA and sparse PCA exist, they still have certain limitations. Other non-linear dimensionality reduction methods, such as t-SNE and UMAP, while excelling at capturing non-linear relationships, are limited in their application by: irreversible mapping, making it difficult to generalize the results to new samples; parameter sensitivity, affecting the reproducibility and generality of the results; computational complexity, requiring significant computational resources and resulting in low efficiency; and poor interpretability, making it difficult for the obtained features to provide meaningful biological insights. Therefore, these methods are more suitable for data visualization than for direct use in classification tasks.

[0004] Given the limitations of the aforementioned background technologies, especially when processing high-dimensional mass spectrometry data of closely related microbial species, existing methods face challenges in both accuracy and efficiency. There is an urgent need for a new dimensionality reduction method that can more effectively extract spectral features and enhance identification capabilities, and to establish a complete microbial identification system based on this method. Summary of the Invention

[0005] To address the aforementioned problems in existing technologies, a MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance is provided, which can more effectively extract spectral features and enhance identification capabilities, thereby solving the problem that existing microbial identification methods are unable to effectively distinguish closely related microorganisms.

[0006] To address the above problems, the present invention adopts the following technical solution: a MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance, the method comprising the following steps:

[0007] Step 1: Preprocessing of spectral data. The raw mass spectrometry data is denoised and baseline corrected. Peaks are extracted, merged, and normalized after correction to form a data list.

[0008] Step 2: Based on dimensionality reduction of spectral spacing, construct an average reference spectrum. Collect several representative spectra for each microorganism, use peak matching algorithm to align the peaks of the same microorganism, calculate the average m / z position and intensity of each set of matched peaks, and form a standardized average reference spectrum.

[0009] After constructing an average reference spectrum, the inter-spectral distance is calculated. The top few peaks with the highest intensity from the constructed average reference spectrum are selected as reference feature peaks. In the sample spectrum to be compared, the peaks corresponding to the reference feature peaks are obtained through a peak matching algorithm. After obtaining the peak pairs that match between the two spectra, the differences between the peak pairs in terms of peak position and peak intensity are measured, and the differences are weighted and merged according to a preset weight to generate a distance vector as a low-dimensional representation of the microbial sample spectrum.

[0010] Step 3: Microbial classification. Perform binary or multi-class classification on the microbial samples to complete the microbial identification.

[0011] Furthermore, the spectral data preprocessing includes:

[0012] For denoising, the Daubechies wavelet is used to perform a five-level wavelet decomposition on the original mass spectrum data. Soft thresholding is applied to the high-frequency coefficients, and the signal is then reconstructed to obtain a smooth spectrum.

[0013] Baseline correction involves setting an intensity value window around each mass spectrometry data point, calculating the average of the three minimum values ​​within the window as the baseline for that mass spectrometry data point, and subtracting the baseline from the original intensity value.

[0014] Peak extraction was performed using the second derivative method to detect peak values ​​in mass spectrometry data, retaining local minima as candidate peaks; for peaks meeting the positional spacing condition... Adjacent peaks are merged, where, This represents the absolute distance between the two peaks to be merged. The current position is given; R is the instrument resolution; the position of the merged new peak is the average of the two peaks, and the intensity is the larger of the two values.

[0015] Normalization normalizes the intensity of the strongest peak after merging to 1, while scaling the remaining peaks proportionally; weak peaks with intensities below 0.01 are removed, and a list of peaks with significant and normalized peak positions and intensities is output.

[0016] Furthermore, the peak matching algorithm described in step two specifically involves selecting the adjacent peak of spectrum A for any two spectra, spectrum A and spectrum B. , Find the corresponding peak in spectrum B. , , making the overall distance Minimum.

[0017] Furthermore, step two, which involves calculating the spectral spacing, specifically includes:

[0018] The top n peaks with the highest intensity in each reference spectrum are selected as the baseline peaks;

[0019] Based on the peak matching algorithm, a matching peak is found for the benchmark peak in the sample spectrum, and a peak pair with the reference spectrum is established in a one-to-one correspondence.

[0020] After obtaining the matched peak pairs, the spectral distance between the peak pairs is calculated. The differences in position and signal intensity of each pair of peaks are measured separately, and quantization is performed using a weighted Minkowski distance.

[0021] The formula is as follows:

[0022]

[0023] and Let represent the position of the i-th pair of matching peaks in the two spectra; 1 represents the reference spectrum, and 2 represents the sample spectrum; calculate the absolute difference in position for each pair of matching peaks. The number of matched peak pairs;

[0024] Among them, the positional difference and intensity difference are controlled by the weight parameters posP and inP, respectively, and the order of the distance is determined by the parameter p;

[0025] The intensity of the i-th peak in the reference spectrum. Let be the intensity of the i-th peak in the sample spectrum;

[0026] Repeat the above process for n reference spectra to obtain the distances from the sample spectrum to each reference spectrum, forming an n-dimensional distance vector:

[0027]

[0028] The vector is a dimensionality-reduced representation of the sample spectrum.

[0029] Furthermore, in step three, the binary classification task is performed by employing the k-nearest neighbor algorithm. First, the inter-spectral distance between the spectrum of the sample to be tested and all reference spectra is calculated. Then, the k nearest reference spectra are selected, and a majority vote is conducted based on their respective categories to determine the category of the sample.

[0030] Furthermore, step three, which describes performing a multi-class classification task, specifically involves using a two-stage k-NN classification process, including the following steps:

[0031] S31. Reference database construction: For standard mass spectrometry samples of each type of microorganism, calculate the intra-class average reference spectrum; convert each original training sample into a distance vector to the average reference spectrum of all classes, and retain its true class label to complete the construction of the reference database.

[0032] S32. Perform a two-stage k-NN classification. In the first stage, preliminary classification is performed. In the reference database, the k1 reference samples that are closest to the unknown sample X are identified, and their categories are statistically analyzed for preliminary determination. If a certain category accounts for ≥ 70%, it is directly assigned to that category; otherwise, proceed to the second stage.

[0033] The second stage, secondary classification: For samples with unclear initial classification, select initial k1 neighbor classes, enumerate all pairwise class combinations, construct a sub-reference set using only training samples from these two classes for each class pair, perform one binary classification k-NN, record X's tendency in this adversarial process, summarize all adversarial results, calculate the comprehensive score for each class in multiple rounds of binary classification, and normalize to obtain the probability distribution. ;

[0034] The formula for calculating the overall score in the binary classification is as follows:

[0035]

[0036] Where Ni is the total number of nearest neighbors of category i in all binary adversarial scenarios, and T is the total number of nearest neighbors generated by all binary adversarial scenarios.

[0037] By combining the results of multiple rounds of binary classification, the proportion of each class is calculated, and the final classification probability is a two-stage weighted combination:

[0038]

[0039] in The percentage of each category in the k1 nearest neighbors in the first stage; take The category with the highest probability is taken as the final classification result.

[0040] Furthermore, as described in step S31, when there are many types of microorganisms in the database, the increase in the number of average spectra leads to an increase in the dimension of the sample coordinates; by calculating the standard deviation of the distance distribution between each average spectrum and its corresponding sample, the N average spectra with the smallest standard deviation are selected as reference spectra to reduce the dimension while retaining key features.

[0041] Next, reference spectrum matching and mapping are performed. For the unknown sample X to be tested, its distance to N reference spectra is calculated to obtain its coordinates in the dimensionality-reduced data space. For a known sample Y in the database, its dimensionality-reduced coordinates are also calculated. ;

[0042] An unknown sample X is mapped to all known samples Y in the database using the same N average reference spectra to obtain their respective coordinates in the N-dimensional feature space;

[0043] The similarity between two samples is then measured using both geometric distance and data correlation, where geometric distance is defined as:

[0044]

[0045] in, Indicates distance, This represents the nth feature value of sample X; This indicates that it is the nth feature value of sample Y; N represents the set of dimensions, and P represents the order of the distance;

[0046] Pearson correlation coefficient is defined as

[0047]

[0048] in, Represents the correlation coefficient. and Let X and Y represent the values ​​of the two samples in the j-th dimension, respectively. and This represents the average of the vectors for samples X and Y.

[0049] The overall similarity between the two is ; Use similarity to define a dimensionality-reduced representation of the spectrum.

[0050] Compared with the prior art, the beneficial technical effects of the present invention are as follows:

[0051] 1. The method described in this application can improve classification accuracy and reliability. The distance-based dimensionality reduction algorithm combined with the two-stage k-NN classification method can effectively improve the classification accuracy of microbial mass spectrometry data. The distance vector feature used in this application fundamentally improves the separability of the data. In multi-class microbial identification experiments, the distance-based dimensionality reduction algorithm (DbDRA) has an average classification accuracy of over 98% for the vast majority of bacterial species. Even for difficult-to-distinguish Salmonella enteritidis and Salmonella typhimurium, the classification accuracy can reach about 95%, which is significantly better than the traditional PCA method.

[0052] 2. The method provided in this application can enhance the ability to distinguish highly similar microorganisms. For highly similar species such as Escherichia coli and Shigella dysenteriae, and Citrobacter braakii and C. koseri, DbDRA significantly reduces interclass overlap, enhances the identifiability of interspectral differences, and achieves more accurate classification and identification.

[0053] 3. The method provided in this application can improve clustering quality. The "distance vector" generated by this invention is a non-linear, discriminative feature. Unlike the abstract principal components generated by PCA, each dimension of this vector directly corresponds to a biological category, and the feature value (distance) has clear interpretability (the degree of difference from a certain standard pattern). Using the feature representation described in this application can significantly expand the inter-class distance of closely related species in the feature space, reflecting its more compact intra-class aggregation and clearer inter-class separation, thereby improving the interpretability and usability of the dimensionality reduction data; for example, in the comparison between Escherichia coli and Shigella, the inter-class separation is improved by more than 30% compared with PCA features.

[0054] 4. The method described in this application can take into account both signal intensity and spectral features. The feature vector constructed by the distance-based dimensionality reduction algorithm (DbDRA) not only reflects the peak position and peak intensity information of the mass spectrum, but also considers the relative relationship between the sample and various average spectra, making the features more biologically meaningful and improving the stability and reliability of classification.

[0055] 5. The method described in this application is highly applicable and flexible in processing. This method can simultaneously process mass spectrometry data obtained by different sample pretreatment methods (such as chemical extraction CE and direct spotting DS). After standardized pretreatment, the data can be directly merged for analysis without the need to process different sample processing methods separately, thus improving data processing efficiency.

[0056] 6. The method described in this application provides a multi-class classification solution. Through a two-stage k-NN classification strategy, the distance-based dimensionality reduction algorithm (DbDRA) performs secondary multi-round binary classification judgments when the initial classification is uncertain, effectively reducing the misclassification rate and improving the reliability of identification of complex multi-class microorganisms.

[0057] 7. Scalability and potential for widespread application: The method provided in this application is not dependent on specific sample preparation methods (such as chemical extraction (CE) or direct spotting (DS). Its feature construction is based on the relative distance to the standard reference spectrum, rather than the absolute signal intensity. Therefore, it has the ability to offset the systematic differences introduced by different preprocessing methods. It has good adaptability to high-dimensional and complex microbial mass spectrometry data, and can reduce the data dimensionality while maintaining key spectral features, providing a reliable technical foundation for further application in clinical diagnosis, food safety testing and microbial classification research. Attached Figure Description

[0058] Figure 1 This is a flowchart of the MALDI-TOF mass spectrometry microbial identification method based on interspectral distance described in this invention;

[0059] Figure 2 This is a schematic diagram of peak matching as described in this invention;

[0060] Figure 3 This is a schematic diagram illustrating the dimensionality reduction representation of the present invention;

[0061] Figure 4 This is a two-dimensional scatter plot of the binary classification results of Shigella dysenteriae and Escherichia coli in Embodiment 1 of the present invention. Detailed Implementation

[0062] The technical solution of the present invention will be further described clearly and in detail below with reference to the embodiments and accompanying drawings.

[0063] like Figure 1 As shown, this application provides a MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance, the method comprising the following steps:

[0064] Step 1: Mass spectrometry data preprocessing. This involves denoising and baseline correction of the raw mass spectrometry data, followed by peak extraction, merging, and normalization of the corrected data to form a data list. The spectral data preprocessing includes:

[0065] For denoising, the Daubechies wavelet is used to perform a five-level wavelet decomposition on the original mass spectrum data, and soft thresholding is applied to the high-frequency coefficients before reconstructing the signal to obtain a smooth spectrum.

[0066] Baseline correction involves setting an intensity value window around each mass spectrometry data point, calculating the average of the three minimum values ​​within the window as the baseline for that mass spectrometry data point, and subtracting the baseline from the original intensity value to eliminate background interference.

[0067] Peak extraction was performed using the second derivative method to detect peak values ​​in mass spectrometry data, retaining local minima as candidate peaks; for peaks meeting the positional spacing condition... Adjacent peaks are merged, where, This represents the absolute distance between the two peaks to be merged. The current position is given; R is the instrument resolution; the position of the merged new peak is the average of the two peaks, and the intensity is the larger of the two values.

[0068] Normalization normalizes the intensity of the strongest peak after merging to 1, while scaling the remaining peaks proportionally; weak peaks with intensities below 0.01 are removed, and a list of peaks with significant and normalized peak positions and intensities is output.

[0069] Step 2: Based on spectral spacing dimensionality reduction, construct an average reference spectrum. Collect several representative spectra for each microorganism, use a peak matching algorithm to align the peaks of the same microorganism's spectrum, calculate the average m / z position and intensity of each set of matched peaks, and form a standardized average reference spectrum; for example... Figure 2 As shown, the peak matching algorithm specifically involves selecting the adjacent peak of spectrum A for any two spectra, spectrum A and spectrum B. , Find the corresponding peak in spectrum B. , , making the overall distance Minimum.

[0070] After constructing an average reference spectrum, interspectral distance is calculated. The top few peaks with the highest intensity from the constructed average reference spectrum are selected as benchmark feature peaks. In the sample spectra to be compared, peaks corresponding to the benchmark feature peaks are obtained using a peak matching algorithm. After obtaining matching peak pairs between the two spectra, the differences in peak position and peak intensity are measured, and the differences are weighted and merged according to preset weights to generate a distance vector as a low-dimensional representation of the microbial sample spectrum. The interspectral distance calculation specifically involves:

[0071] The top n peaks with the highest intensity in each reference spectrum are selected as the baseline peaks;

[0072] Based on the peak matching algorithm, a matching peak is found for the benchmark peak in the sample spectrum, and a peak pair with the reference spectrum is established in a one-to-one correspondence.

[0073] After obtaining the matched peak pairs, the spectral distance between the peak pairs is calculated. The differences in position and signal intensity of each pair of peaks are measured separately, and quantization is performed using a weighted Minkowski distance.

[0074] The formula is as follows:

[0075]

[0076] and The position of the i-th matching peak in the two spectra; 1 represents the reference spectrum, and 2 represents the sample spectrum;

[0077] Calculate the absolute difference in position for each pair of matching peaks;

[0078] Among them, the positional difference and intensity difference are controlled by the weight parameters posP and inP, respectively, and the order of the distance is determined by the parameter p;

[0079] and Let be the signal intensity of the i-th pair of matching peaks in the two spectra;

[0080] like Figure 3 As shown, the above process is repeated for n reference spectra to obtain the distances from the sample spectrum to each reference spectrum, forming an n-dimensional distance vector:

[0081]

[0082] The vector is a dimensionality-reduced representation of the sample spectrum.

[0083] Step 3: Microbial classification. Perform binary or multi-class classification on the microbial samples to complete microbial identification. Specifically, for binary classification, the k-nearest neighbor algorithm is used. First, the inter-spectral distance between the spectrum of the sample to be tested and all reference spectra is calculated. Then, the k nearest reference spectra are selected, and a majority vote is performed based on their respective categories to determine the sample's category.

[0084] The multi-class classification task is specifically performed using a two-stage k-NN classification method, including the following steps:

[0085] S31. Reference database construction: For standard mass spectrometry samples of each type of microorganism, calculate the intra-class average reference spectrum; convert each original training sample into a distance vector to the average reference spectrum of all classes, and retain its true class label to complete the construction of the reference database.

[0086] S32. Perform a two-stage k-NN classification. The first stage is preliminary classification. In the reference database, find the k1 reference samples that are closest to the unknown sample X, and determine their categories. If a certain category accounts for more than 70%, directly assign that category; otherwise, proceed to the second stage.

[0087] The second stage, secondary classification: For samples with unclear initial classification, select initial k1 neighbor classes, enumerate all pairwise class combinations, construct a sub-reference set using only training samples from these two classes for each class pair, perform one binary classification k-NN, record X's tendency in this adversarial process, summarize all adversarial results, calculate the comprehensive score for each class in multiple rounds of binary classification, and normalize to obtain the probability distribution. ;

[0088] The formula for calculating the overall score in the binary classification is as follows:

[0089]

[0090] Where Ni is the total number of nearest neighbors of category i in all binary adversarial scenarios, and T is the total number of nearest neighbors generated by all binary adversarial scenarios.

[0091] By combining the results of multiple rounds of binary classification, the proportion of each class is calculated, and the final classification probability is a two-stage weighted combination:

[0092]

[0093] in The percentage of each category in the k1 nearest neighbors in the first stage; take The category with the highest probability is taken as the final classification result.

[0094] As described in step S31, when there are many types of microorganisms in the database, the increase in the number of average spectra leads to an increase in the dimension of the sample coordinates. By calculating the standard deviation of the distance distribution between each average spectrum and its corresponding sample, the N average spectra with the smallest standard deviation are selected as reference spectra to reduce the dimension while retaining key features.

[0095] Next, reference spectrum matching and mapping are performed. For the unknown sample X to be tested, its distance to N reference spectra is calculated to obtain its coordinates in the dimensionality-reduced data space. For a known sample Y in the database, its dimensionality-reduced coordinates are also calculated. ;

[0096] An unknown sample X is mapped to all known samples Y in the database using the same N average reference spectra to obtain their respective coordinates in the N-dimensional feature space;

[0097] The similarity between two samples is then measured using both geometric distance and data correlation, where geometric distance is defined as:

[0098]

[0099] in, Indicates distance, This represents the nth feature value of sample X; This indicates that it is the nth feature value of sample Y; N represents the set of dimensions, and P represents the order of the distance;

[0100] Pearson correlation coefficient is defined as

[0101]

[0102] in, Represents the correlation coefficient. and Let X and Y represent the values ​​of the two samples in the j-th dimension, respectively. and This represents the average of the vectors for samples X and Y.

[0103] The overall similarity between the two is ; Use similarity to define a dimensionality-reduced representation of the spectrum.

[0104] Example 1

[0105] The specific application of the MALDI-TOF mass spectrometry microbial identification method based on interspectral distance described in this application in a binary classification task involving Shigella dysenteriae and Escherichia coli includes the following steps: S1, spectral acquisition, where Shigella dysenteriae and Escherichia coli are treated using extraction and direct coating methods, followed by MALDI-TOF spectral acquisition. This embodiment employs two sample preparation methods: direct coating and extraction. The former is suitable for common microbial samples with easily lysed cells, while the latter is suitable for difficult-to-lyse samples such as mycobacteria and yeast with relatively robust cell walls.

[0106] (1) Direct coating method

[0107] Sampling: Select a single colony of microorganism and spread it evenly on a MALDI target plate to form a film.

[0108] Add matrix: Add about 1 μL of the prepared matrix solution (containing HCCA matrix powder, acetonitrile and trifluoroacetic acid) to the smear.

[0109] Mechanism of action: Acetonitrile and trifluoroacetic acid in the matrix solution can disrupt the cell wall structure, causing intracellular proteins to be released for subsequent MALDI-TOF MS detection.

[0110] Optional treatment: For some difficult-to-lyse Gram-positive bacteria and yeast-like fungi, a small amount of 70% formic acid can be added to the sample surface and the sample can be ground appropriately to improve the lysis efficiency.

[0111] (2) Extraction method

[0112] Preparation and inactivation of bacterial suspension: Pick a small amount of bacterial colonies, add an appropriate amount of pure water and mix well to form a bacterial suspension, then add anhydrous ethanol for inactivation.

[0113] Centrifuge and discard supernatant: After inactivation, centrifuge and discard the supernatant.

[0114] Lysis treatment: Add an equal volume of 50% formic acid and mix thoroughly to lyse the microorganisms.

[0115] Protein extraction: Add an equal volume of pure acetonitrile, mix well, centrifuge, and collect the supernatant.

[0116] Sample loading and matrix addition: The obtained supernatant is dropped onto the MALDI target plate, air-dried, and then covered with matrix solution.

[0117] Detection: After the sample is completely dry, perform MALDI-TOF mass spectrometry detection.

[0118] S2, Mass Spectrometry Data Preprocessing

[0119] The raw mass spectrometry data undergoes denoising and baseline correction. Peaks are extracted, merged, and normalized after correction to form a data list. The spectral data preprocessing includes:

[0120] Denoising is performed by assigning original labels to the acquired spectra and then using Daubechies wavelet (db4) for five-level decomposition of the original mass spectrometry signal. Soft thresholding is applied to the high-frequency coefficients for noise reduction, with the threshold set to 200. Following this, a spectrum preprocessing and peak extraction process is conducted. This process includes data import, signal peak extraction, peak merging and filtering, intensity normalization, and spectrum standardization reconstruction. The main steps are as follows:

[0121] (21) Data reading and object construction

[0122] First, the mass spectrometry data files (in .csv format) of each sample are read in batches from the specified file directory. Each file corresponds to the raw mass spectrometry signal of a microbial sample. Each file is parsed into a series of data points composed of mass-to-charge ratio (m / z) and relative intensity, and stored as a mass spectrometry point sequence. A mass spectrometry object (MassSpectrum) is created for each sample and bound to the corresponding bacterial species information (such as Escherichia coli, Shigella dysenteriae), forming a Bacterium instance.

[0123] (22) Peak extraction: The second derivative method is used to detect the peak values ​​of the mass spectrometry data, and local minima are retained as candidate peaks; for peaks that meet the position spacing condition... Adjacent peaks are merged, where, This represents the absolute distance between the two peaks to be merged. The current position is given; R is the instrument resolution; the position of the merged new peak is the average of the two peaks, and the intensity is the larger of the two values.

[0124] Specifically, signal derivative analysis is performed on each mass spectrum point sequence to identify the true peak value:

[0125] First derivative calculation: The first derivative of the intensity as a function of m / z is calculated using the five-point difference formula to identify the trend of signal change;

[0126] Second derivative calculation: The central difference method is used to calculate the second derivative, which is used to determine the signal curvature. The local minimum of the second derivative usually corresponds to the peak of the spectral peak.

[0127] Third-order derivative auxiliary calculation: By further calculating the third-order derivative, the stability of inflection point judgment is enhanced and noise interference is reduced.

[0128] Local extremum screening: Find local minimum points in the second derivative sequence as candidate peak positions. To prevent misjudgment, a point is considered a valid peak only if several adjacent positions (3-4 points before and after the second derivative) are all greater than the value.

[0129] (23) Merging of adjacent peaks

[0130] To eliminate duplicate or false peaks caused by resolution limitations, distance is used to determine the distance between adjacent candidate peaks:

[0131] If the m / z position difference between two adjacent peaks is less than the resolution (i.e., the peak spacing is less than the peak position value divided by the resolution coefficient R), then they are considered to belong to the same signal peak.

[0132] During the merging process, the point with the highest intensity from the original data points between the two peaks is selected as the location of the new peak after merging, and the intensity of that point is used as the peak intensity.

[0133] (24) Peak intensity screening and normalization

[0134] Maximum peak intensity acquisition: Traverse all peak points and find the peak with the highest intensity in the current sample.

[0135] Small peak removal: If the intensity of a certain peak is lower than a certain percentage (e.g., 10%) of the intensity of the maximum peak, then the peak is considered to be a noise peak and is removed.

[0136] Normalization normalizes the intensity of the strongest peak after merging to 1, while scaling the remaining peaks proportionally; weak peaks with intensities below 0.01 are removed, and a list of peaks with significant and normalized peak positions and intensities is output.

[0137] Intensity normalization: Divide the intensity values ​​of all remaining peaks by the maximum peak intensity to achieve 0–1 normalization, ensuring that the peak intensities of different samples are comparable.

[0138] (25) Spectral normalization reconstruction

[0139] To facilitate subsequent comparisons and modeling, the coordinates of the spectra of each sample were reconstructed using a unified method.

[0140] Construct a fixed-resolution m / z base coordinate axis (range 0–20000 Da, step size 1 / de).

[0141] Initialize all intensity values ​​to 0 on this coordinate axis.

[0142] The detected normalized peak values ​​are mapped to corresponding coordinate points according to their m / z positions, and the intensity is accumulated.

[0143] The obtained spectra are sorted in ascending order of m / z to form standardized continuous mass spectrometry curves.

[0144] (26) Output and Packaging

[0145] Finally, the processing result for each sample is stored as a Bacterium object, containing the following information:

[0146] The data includes: bacterial species name (e.g., "Escherichia coli", "Shigella dysenteriae"); the original data path; a list of processed peak information (position and intensity); and normalized continuous mass spectrometry data. Bacterium objects for all samples are stored in a list and returned, providing input for subsequent feature extraction, cluster analysis, or classification modeling.

[0147] S3. Construction of Standard Sets and Generation of Standard Mass Spectrometers

[0148] After preprocessing the mass spectrometry data of Shigella dysenteriae and Escherichia coli, standard sets and test sets for the two strains were constructed for subsequent classification and identification analysis. Representative standard mass spectra were extracted for feature alignment and comparison analysis. The overall workflow is as follows.

[0149] (31) Sample grouping and randomization

[0150] First, pre-processed mass spectrometry samples of *Escherichia coli* and *Shigella dysenteriae* were loaded. Then, the sample order for each bacterial class was randomly shuffled to eliminate sampling order bias. Based on this, each sample class was randomly divided into two parts in a 1:1 ratio: the first half served as the Standard Set, used to generate reference spectra and for model training; the second half served as the Test Set, used to validate the model's recognition performance. The final Standard Set included two types of data: DCAX: *Escherichia coli* Standard Set; LJZH: *Shigella dysenteriae* Standard Set.

[0151] (32) Standard mass spectrometry peak extraction

[0152] To extract representative standard peaks from the standard set samples, the following steps are designed:

[0153] Peak matching and aggregation: Summarize the peak lists of all samples in the same bacterial species standard set; starting from each peak of the first sample, find the corresponding peaks in other samples whose m / z distance does not exceed the set tolerance (errorStan); if a match is successful, these peaks are regarded as the same "group of peaks" and classified into the same set; gradually traverse all samples until all peaks are classified.

[0154] This process yields several peak clusters, each representing a signal peak that appears consistently in multiple measurements for that bacterial species.

[0155] Statistical analysis and calculation of standard peak parameters:

[0156] For each peak cluster, calculate the following characteristic values: the average position (m / z) as the standard peak position; the average and range of peak intensity (minimum and maximum); and the probability of occurrence.

[0157] Standard spectrum sorting and screening:

[0158] All standard peaks are sorted in ascending order of m / z; only peaks with a probability of occurrence higher than a threshold (e.g., 0.1 or higher) are retained as reliable characteristic peaks. The final set of standard spectral peaks (stanPeaks) represents the typical mass spectrometry signal characteristics of this bacterial species.

[0159] (33) Selection of standard reference peak

[0160] To facilitate subsequent comparison and feature mapping, several of the most representative peaks are further selected from the standard peaks as reference peaks. The specific steps are as follows: Standard peaks are sorted by their probability of occurrence and intensity; the top refPeaksNum peaks (e.g., 20) are selected as the reference peak set; the average position and normalized intensity of each reference peak are recorded, forming a standard reference spectrum. This reference spectrum will serve as the feature benchmark for subsequent clustering, similarity measurement, or pattern recognition.

[0161] (34) Structuring of standard set mass spectrometry data

[0162] Finally, the standard peaks and reference peaks for each bacterial species are combined to generate structured data for the standard set. For each species, the following information is extracted: the peak set of each sample; the corresponding standard peak set; the reference peak set and its corresponding feature vector; and the matching relationship of each peak in the standard spectrum. This information is encapsulated into a list of ClusterData objects, stored in a hash mapping structure by species key, forming a unified data format (dataClassify) for the standard set.

[0163] (35) Output and subsequent uses

[0164] Through the above steps, standard sets of two types of bacterial strains (Escherichia coli and Shigella dysenteriae) and their corresponding standard mass spectra and reference peak information are obtained. These standard spectra not only reflect the stable characteristic patterns of each bacterial species, but also provide a unified input basis for subsequent algorithms (such as similarity analysis, classification and identification, cluster visualization, etc.).

[0165] S4. Feature mapping of the test set and k-NN classification execution.

[0166] Based on the characteristics of reference spectral peaks and a standard sample set, a feature map of the mass spectrometry test samples is constructed, and the K-nearest neighbor algorithm is used for classification. The overall process includes three parts: test set feature extraction, distance calculation, and classification prediction. The specific steps are as follows.

[0167] (41) Construction of test set features

[0168] Input data preparation: The test set data is organized by strain category, with each category corresponding to several mass spectrometry data objects; at the same time, a list of standard peaks and multiple sets of reference spectra are input.

[0169] Data copying and preprocessing: To avoid directly modifying the original data, a deep copy of the input test set data is first performed to generate an independent data copy.

[0170] Reference feature set construction: Combine the spectral peaks of each category in the reference data refs into a reference feature set for subsequent feature coordinate calculation.

[0171] Feature coordinate calculation: For each test sample, call the distance mapping function Distance.getCoo() to calculate its projected coordinates in the reference feature space.

[0172] The calculation uses the generalized form of the Minkowski distance, with parameter p representing the distance order (2.0 here). The peak weight coefficient weiP = 0.1 and the intensity weight coefficient inP = 0.9 are set to comprehensively consider the difference between peak position and peak intensity.

[0173] The calculated result is a set of continuous feature value vectors d, which are used for subsequent classification.

[0174] ClusterData object construction: The original label (true class), feature vector, and file path information of each sample are encapsulated into a ClusterData object, and stored in a hash map structure according to the category. <String, List <clusterdata>In the >, a mapping data structure for the test set is formed.

[0175] (42) k-NN classification method

[0176] To achieve automatic sample classification and recognition, the K-Nearest Neighbors (k-NN) algorithm based on Euclidean space is adopted. The core process of the algorithm is as follows:

[0177] Standard set consistency check: Before classification, the label consistency of the standard sample set is verified to ensure that the true category of each standard sample is consistent with the key value of its set, so as to avoid classification bias caused by label errors.

[0178] Sample distance calculation: For each sample to be classified, calculate its distance to all samples in the standard set.

[0179] Distance calculations use the same Minkowski distance form.

[0180] Distance sorting and neighborhood selection: Sort all calculated distance values ​​in ascending order, and select the top K (K=5 in this study) nearest neighbors as the discriminative neighborhood.

[0181] Category voting: Statistically analyze the sample categories in the selected neighborhood and record the number of times each category appears.

[0182] If multiple categories appear the same number of times, the category corresponding to the first maximum value is selected randomly or in traversal order.

[0183] Assigning classification labels: The category that receives the most votes is used as the predicted label (classifyLabel) for the test sample and updated in the ClusterData object.

[0184] The final binary classification results for Shiga dysentery and Escherichia coli are as follows: Figure 4 As shown, the horizontal axis represents the distance to the average spectrum of Escherichia coli, and the vertical axis represents the distance to the average spectrum of Shigella dysenteriae.

[0185] Figure 4 Two-dimensional representations of the mass spectra of *Escherichia coli* and *Shigella dysenteriae* obtained by the method described in this application are shown. The evaluation results of 10 k-NN classification tests are as follows:

[0186]

[0187] Example 2

[0188] The application of the MALDI-TOF mass spectrometry microbial identification method based on interspectral distance described in this application in multivariate classification tasks involving Escherichia coli, Shigella dysenteriae, Citrobacter brucellosis, Citrobacter korshinskii, Salmonella enteritidis, Salmonella typhimurium, Enterococcus faecalis, Enterococcus faecalis, Propionibacterium vesicacaceus, and Propionibacterium fibrillii includes the following steps:

[0189] S1. Data Acquisition and Preprocessing

[0190] The specific process and parameters are the same as in Example 1;

[0191] S2. Dataset Partitioning and Processing

[0192] Dataset partitioning: The input dataset allData is a hash map structure containing multiple categories (strains), where the key is the category label and the value is all sample data under that category (List). <bacterium>).

[0193] During the data processing phase, the datasets for each category are randomly shuffled and divided into a standard set (training set) and a test set according to a set ratio of sr = 0.7. Specifically, for each category, 70% of the data is used for training on the standard set, and 30% is used for evaluation on the test set.

[0194] Standard set processing: Feature extraction and label selection are performed on the standard set. First, the standard average spectrum and reference peak for each category are obtained by calling the feature extraction method in Example 1.

[0195] The reference peak and standard average spectrum are used to generate feature data mappings for the standard set, and finally, classification data (dataClassify) for the standard set is constructed. This data structure is a HashMap. <String, List <clusterdata>Each category corresponds to a set of data that has undergone feature mapping.

[0196] Feature label selection: The data in the standard set is sorted according to the standard deviation of each feature, and the features with the smallest standard deviation, `markNum`, are selected. These features are considered the most discriminative and are crucial for subsequent classification decisions. The label for each category is stored in a `marks` hash map, and `marks.get(key)` stores the index of the selected feature for that category.

[0197] S3. Test Set Processing and Preliminary Classification

[0198] Test set feature mapping: Using the k-NN method in Example 1, each sample in the test set is transformed into a new feature space based on the reference peak and feature mapping of the standard set. The method generates testMap0, which is a HashMap. <String,List <clusterdata>The mapping structure of type > stores the feature mapping corresponding to each test sample.

[0199] Preliminary Classification and Distance Calculation: For each test sample, the `singleMate()` method is called for preliminary classification. In this method, we calculate the distance between the test sample and all samples in the standard set, and classify based on a vote of the K nearest neighbors. The distance calculation comprehensively considers the Euclidean distance and similarity (calculated through correlation) between features.

[0200] k0: The number of nearest neighbors selected during the initial classification.

[0201] p0: The parameter used in distance calculation, which determines the norm of the distance metric.

[0202] k1: The number of nearest neighbors for subsequent binary classification, used to further refine the classification.

[0203] p1: The distance calculation norm used in subsequent binary classification.

[0204] pf and ps: Used to adjust the classification threshold. pf is the matching threshold with the reference spectrum, and ps is the matching threshold with other categories.

[0205] In the initial classification phase, for each test sample, the distances to all class samples are calculated, these distances are sorted, the K neighbors with the smallest distances are selected, and then the class with the most votes is chosen by voting.

[0206] S4, Subsequent Classification (Multi-round Binary Classification)

[0207] Handling Classification Uncertainty: When the initial classification result is uncertain (e.g., multiple categories have similar vote counts, and the maximum vote percentage is less than a set threshold of 80%), the algorithm proceeds to the subsequent binary classification step. This subsequent classification employs a pairwise comparison strategy, performing binary classification on the categories with the highest vote counts to further refine the classification results. The binary classification at this stage is performed by calculating the distance between the test sample and samples from the two categories.

[0208] Binary classification: For each pair of possible classes (selected from the class with the most votes in the initial classification), we calculate the distance between each test sample and all samples of both classes, and select the class with the smallest distance as the final classification class. If multiple classes have the same number of votes, the algorithm will calculate the probability value of each class and make the final judgment.

[0209] Final classification decision: Based on binary classification, the algorithm ultimately determines the final classification of the test sample according to the number of votes for each category. If a unique category still cannot be determined, a probability-weighted averaging strategy is used to rank all categories and select the most likely category.

[0210] Final classification results output:

[0211] The final classification results are stored as category labels for each test sample, and the classification results of all test samples are summarized for subsequent accuracy evaluation.

[0212] The final test results are shown in the table below:

[0213]

[0214] As can be seen, the MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance generally exhibits excellent classification performance. For most species, the classification accuracy reached over 98%, and even for the species with the lowest accuracy, Salmonella enteritidis and Salmonella typhimurium, the classification accuracy still reached approximately 95%.

[0215] Finally, it should be pointed out that the above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.< / clusterdata> < / clusterdata> < / bacterium> < / clusterdata>

Claims

1. A MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance, characterized in that, The method includes: Step 1: Preprocessing of spectral data. The raw mass spectrometry data is denoised and baseline corrected. Peaks are extracted, merged, and normalized after correction to form a data list. Step 2: Based on dimensionality reduction of spectral spacing, construct an average reference spectrum. Collect several representative spectra for each microorganism, use peak matching algorithm to align the peaks of the same microorganism, calculate the average m / z position and intensity of each set of matched peaks, and form a standardized average reference spectrum. After constructing an average reference spectrum, the inter-spectral distance is calculated. The top few peaks with the highest intensity from the constructed average reference spectrum are selected as reference feature peaks. In the sample spectrum to be compared, the peaks corresponding to the reference feature peaks are obtained through a peak matching algorithm. After obtaining the peak pairs that match between the two spectra, the differences between the peak pairs in terms of peak position and peak intensity are measured, and the differences are weighted and merged according to a preset weight to generate a distance vector as a low-dimensional representation of the microbial sample spectrum. Step 3: Microbial classification. Perform binary or multi-class classification on the microbial samples to complete the microbial identification.

2. The MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance according to claim 1, characterized in that, The spectral data preprocessing includes: For denoising, the Daubechies wavelet is used to perform a five-level wavelet decomposition on the original mass spectrum data. Soft thresholding is applied to the high-frequency coefficients, and the signal is then reconstructed to obtain a smooth spectrum. Baseline correction involves setting an intensity value window around each mass spectrometry data point, calculating the average of the three minimum values ​​within the window as the baseline for that mass spectrometry data point, and subtracting the baseline from the original intensity value. Peak extraction was performed using the second derivative method to detect peak values ​​in mass spectrometry data, retaining local minima as candidate peaks; for peaks meeting the positional spacing condition... Adjacent peaks are merged, where, This represents the absolute distance between the two peaks to be merged. The current position is given; R is the instrument resolution; the position of the merged new peak is the average of the two peaks, and the intensity is the larger of the two values. Normalization normalizes the intensity of the strongest peak after merging to 1, while scaling the remaining peaks proportionally; weak peaks with intensities below 0.01 are removed, and a list of peaks with significant and normalized peak positions and intensities is output.

3. The MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance according to claim 1, characterized in that, The peak matching algorithm described in step two specifically involves selecting the adjacent peak of spectrum A for any two spectra, spectrum A and spectrum B. , Find the corresponding peak in spectrum B. , , making the overall distance Minimum.

4. The MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance according to claim 1, characterized in that, Step two involves calculating the spectral spacing, specifically as follows: The top n peaks with the highest intensity in each reference spectrum are selected as the baseline peaks; Based on the peak matching algorithm, a matching peak is found for the benchmark peak in the sample spectrum, and a peak pair with the reference spectrum is established in a one-to-one correspondence. After obtaining the matched peak pairs, the spectral distance between the peak pairs is calculated. The differences in position and signal intensity of each pair of peaks are measured separately, and quantization is performed using a weighted Minkowski distance. The formula is as follows: and Let represent the position of the i-th pair of matching peaks in the two spectra; 1 represents the reference spectrum, and 2 represents the sample spectrum; calculate the absolute difference in position for each pair of matching peaks. The number of matched peak pairs; Among them, the positional difference and intensity difference are controlled by the weight parameters posP and inP, respectively, and the order of the distance is determined by the parameter p; The intensity of the i-th peak in the reference spectrum. Let be the intensity of the i-th peak in the sample spectrum; Repeat the above process for n reference spectra to obtain the distances from the sample spectrum to each reference spectrum, forming an n-dimensional distance vector: The vector is a dimensionality-reduced representation of the sample spectrum.

5. The MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance according to claim 1, characterized in that, Step 3 describes the process of performing a binary classification task. Specifically, the k-nearest neighbor algorithm is used to first calculate the inter-spectral distance between the spectrum of the sample to be tested and all reference spectra; then, the k nearest reference spectra are selected, and a majority vote is performed based on their respective categories to determine the category of the sample.

6. The MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance according to claim 1, characterized in that, Step three describes performing a multi-class classification task, specifically using a two-stage k-NN classification method, which includes the following steps: S31. Reference database construction: For standard mass spectrometry samples of each type of microorganism, calculate the intra-class average reference spectrum; convert each original training sample into a distance vector to the average reference spectrum of all classes, and retain its true class label to complete the construction of the reference database. S32. Perform two-stage k-NN classification. In the first stage, preliminary classification is performed. In the reference database, the k1 reference samples that are closest to the unknown sample X are identified, and their categories are statistically analyzed to make a preliminary determination. When a certain category accounts for ≥ 70%, that category is directly assigned. Otherwise, proceed to the second stage; The second stage, secondary classification: For samples with unclear initial classification, select initial k1 neighbor classes, enumerate all pairwise class combinations, construct a sub-reference set using only training samples from these two classes for each class pair, perform one binary classification k-NN, record X's tendency in this adversarial process, summarize all adversarial results, calculate the comprehensive score for each class in multiple rounds of binary classification, and normalize to obtain the probability distribution. The formula for calculating the overall score in the binary classification is as follows: Where Ni is the total number of nearest neighbors of category i in all binary adversarial scenarios, and T is the total number of nearest neighbors generated by all binary adversarial scenarios. By combining the results of multiple rounds of binary classification, the proportion of each class is calculated, and the final classification probability is a two-stage weighted combination: in The percentage of each category in the k1 nearest neighbors in the first stage; take The category with the highest probability is taken as the final classification result.

7. The MALDI-TOF mass spectrometry method for microbial identification based on interspectral distance according to claim 6, characterized in that, As described in step S31, when there are many types of microorganisms in the database, the increase in the number of average spectra leads to an increase in the dimension of the sample coordinates. By calculating the standard deviation of the distance distribution between each average spectrum and its corresponding sample, the N average spectra with the smallest standard deviation are selected as reference spectra to reduce the dimension while retaining key features. Next, reference spectrum matching and mapping are performed. For the unknown sample X to be tested, its distance to N reference spectra is calculated to obtain its coordinates in the dimensionality-reduced data space. For a known sample Y in the database, its dimensionality-reduced coordinates are also calculated. ; An unknown sample X is mapped to all known samples Y in the database using the same N average reference spectra to obtain their respective coordinates in the N-dimensional feature space; The similarity between two samples is then measured using both geometric distance and data correlation, where geometric distance is defined as: in, Indicates distance, This represents the nth feature value of sample X; This indicates that it is the nth feature value of sample Y; N represents the set of dimensions, and P represents the order of the distance; Pearson correlation coefficient is defined as in, Represents the correlation coefficient. and Let X and Y represent the values ​​of the two samples in the j-th dimension, respectively. and This represents the average of the vectors for samples X and Y. The overall similarity between the two is ; Use similarity to define a dimensionality-reduced representation of the spectrum.