Method and device for detecting abnormal high abundance sample based on metagenomic sequencing data
By employing a multi-dimensional scoring and chain-based expansion mechanism, combined with background bacteria determination rules, the problem of low efficiency and misjudgment in identifying abnormally high abundance samples in existing technologies has been solved, achieving automated and accurate detection of abnormally high abundance samples.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENYANG JINYU MEDICAL LAB CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, the identification of abnormally high abundance samples mainly relies on manual interpretation, which is inefficient and affected by the experience of the testing personnel, making it difficult to accurately identify true infections. Furthermore, the high sensitivity of mNGS detection leads to the mixing of background bacteria and cross-contaminants, resulting in misjudgments and missed detections.
A multi-dimensional scoring method was used to calculate the total score of the samples. Combined with background bacteria judgment rules and correction factors, a chain expansion mechanism was used to identify abnormally high abundance samples. By performing multi-angle quantitative evaluation of metagenomic sequencing data, background bacteria interference was automatically eliminated to ensure accurate identification.
It improves the accuracy and robustness of identifying abnormally high abundance samples, avoids false positives and false negatives, and achieves automated and accurate identification and screening.
Smart Images

Figure CN122157803A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of gene detection technology, specifically relating to a method and device for detecting abnormally high abundance samples based on metagenomic sequencing data. Background Technology
[0002] In the metagenomic next generation (mNGS) process for pathogenic microorganisms, multiple samples from the same batch are usually sequenced simultaneously. After sequencing is completed, an intra-batch detection statistics report is generated, which details the detection information of each species in each sample, providing basic data support for the diagnosis of pathogenic microorganism infection.
[0003] Among the aforementioned detection information, abundance is the core indicator measuring the relative abundance of a species in a sample, playing an irreplaceable and crucial role in identifying abnormally high abundance infection samples. Specifically, abundance enables a leap from "qualitative detection of pathogens" to "quantitative determination of infection status." By quantifying the relative proportion of pathogens in a sample, it can accurately distinguish between clinically insignificant colonization and contamination, and abnormally high abundance indicating true infection, thereby significantly improving the specificity and accuracy of infection diagnosis. It is the core quantitative basis for infection determination in mNGS testing.
[0004] Currently, the identification of abnormally high abundance samples mostly relies on manual interpretation. In actual clinical testing, laboratory personnel need to accurately identify truly abnormally high abundance samples (i.e., samples where the abundance of a certain species is significantly higher than normal) from a set of abundance data, thereby indicating that the sample may contain a real pathogenic microorganism infection. This method is not only inefficient but also highly dependent on the experience level and subjective judgment of the laboratory personnel, making it difficult to accurately filter out non-pathogenic signals and identify truly abnormally high abundance samples. Moreover, due to the high sensitivity of mNGS detection technology, background bacteria and cross-contaminants are often detected during the testing process, resulting in a large number of non-pathogenic signals mixed in with the batch detection statistics report, which may lead to misjudgments and missed diagnoses. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, device, and storage medium for detecting abnormally high abundance samples based on metagenomic sequencing data, which can accurately identify truly abnormally high abundance samples.
[0006] The first aspect of this invention discloses a method for detecting abnormally high abundance samples based on metagenomic sequencing data, comprising:
[0007] Obtain metagenomic sequencing data of a set of samples, and calculate the abundance of each species in the samples based on the sequencing data. The set of samples consists of multiple samples from the same batch.
[0008] The sequencing data is scored in multiple dimensions to obtain the total score for each sample.
[0009] The presence of background bacteria in the set of samples is determined by the background bacteria determination rule. When background bacteria are present, a correction factor is determined, and the total score of each sample is multiplied by the correction factor to correct the total score of each sample.
[0010] Based on the total score and abundance of the samples, anomaly categories and anomalous samples are obtained according to the anomaly category determination rules. When the anomaly category is a single anomaly, the anomalous sample is regarded as an anomalous high-abundance sample. When the anomaly category is multiple anomalies, a chain expansion mechanism is used to identify anomalous high-abundance samples among all anomalous samples.
[0011] In some embodiments, the sequencing data includes ranking, reads, and coverage; the sequencing data is scored in multiple dimensions to obtain a total score for each sample, including:
[0012] For each sample, an abundance absolute value score, an outlier score, and an abundance dominance score are calculated based on the abundance; a ranking score is calculated based on the ranking; a reads concentration score is calculated based on the reads; and a coverage score is calculated based on the coverage. The outlier score is used to assess the degree of abnormal deviation of the abundance value within the group. The ranking includes genus ranking and within-genus ranking. The abundance absolute value score, outlier score, abundance dominance score, ranking score, reads concentration score, and coverage score are weighted and accumulated to obtain the total score.
[0013] In some embodiments, calculating an outlier score based on the abundance includes:
[0014] The improved Z-score, median multiple, second-highest multiple, gap score, and percentile ranking are calculated based on the abundance.
[0015] The outlier score is obtained by weighting and accumulating the improved Z-score, median multiple, second-highest multiple, gap score, and percentile ranking.
[0016] In some embodiments, a background bacteria determination rule is used to determine whether background bacteria exist in the set of samples. When background bacteria are present, a correction factor is determined, including:
[0017] When the median abundance value is greater than or equal to a preset value and the proportion of samples with abundance greater than the abundance hard threshold is greater than the first proportion, it is determined that background bacteria exist, and the preset first correction factor is set as the correction factor.
[0018] When the proportion of samples with abundance greater than the abundance hard threshold is greater than or equal to the second proportion, it is determined that background bacteria exist, and the correction factor is obtained based on the sample proportion.
[0019] In some embodiments, a chain expansion mechanism is employed to identify anomalously high-abundance samples among all anomalous samples, including:
[0020] All abnormal samples are sorted in descending order based on the total score.
[0021] Save the anomaly sample with the highest total score to the candidate group;
[0022] Enumerate all abnormal samples except the abnormal sample with the highest total score. For each current sample, if the abundance of the current sample is greater than the abundance hard threshold, the ratio between the abundance of the current sample and the minimum abundance of all samples in the candidate group is less than the first preset threshold, and the difference between the total score of the current sample and the highest total score is less than the second preset threshold, the current sample is added to the candidate group. If any condition is not met, the enumeration is completed.
[0023] The samples in the candidate group are set as abnormally high abundance samples.
[0024] In some embodiments, after obtaining metagenomic sequencing data of a set of samples, the method further includes:
[0025] When there are missing data dimensions, the total weight of the missing data dimensions is calculated. Based on the weight ratio of each existing data dimension, the total weight is allocated to each existing data dimension to obtain the corresponding weight increment. The weight of each existing data dimension is updated to the sum of the original weight and the corresponding weight increment. The data dimensions include the abundance absolute value score, outlier score, ranking score, reads concentration score, coverage score, and abundance dominance score.
[0026] A second aspect of this invention discloses a device for detecting abnormally high abundance samples based on metagenomic sequencing data, comprising:
[0027] The data module is used to acquire metagenomic sequencing data of a set of samples and calculate the abundance of each species in the samples based on the sequencing data. The set of samples consists of multiple samples from the same batch.
[0028] A multi-dimensional scoring module is used to score the sequencing data from multiple dimensions and obtain the total score for each sample.
[0029] The background bacteria detection module is used to determine whether background bacteria exist in the group of samples using background bacteria determination rules. When background bacteria are present, a correction factor is determined, and the total score of each sample is multiplied by the correction factor to correct the total score of each sample.
[0030] An abnormally high abundance sample identification module is used to obtain anomaly categories and abnormal samples based on the total score of the samples and the abundance according to the anomaly category determination rules. When the anomaly category is a single anomaly, the abnormal sample is regarded as an abnormally high abundance sample. When the anomaly category is multiple anomalies, an abnormally high abundance sample is identified among all abnormal samples using a chain expansion mechanism.
[0031] In some embodiments, the abnormally high abundance sample identification module includes a sorting unit, an enumeration unit, and an output unit. The sorting unit is used to sort all abnormal samples in descending order according to the total score and save the abnormal sample with the highest total score to the candidate group. The enumeration unit is used to enumerate the remaining abnormal samples except for the abnormal sample with the highest total score. For each current sample, if the abundance of the current sample is greater than the abundance hard threshold, the ratio between the maximum abundance and the minimum abundance of all samples in the candidate group is less than a first preset threshold, and the difference between the total score and the highest total score is less than a second preset threshold, the current sample is added to the candidate group. If any condition is not met, the enumeration is completed. The output unit is used to set the samples in the candidate group as abnormally high abundance samples.
[0032] A third aspect of the present invention discloses an electronic device, including a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the abnormally high abundance sample detection method based on metagenomic sequencing data disclosed in the first aspect.
[0033] The fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the abnormally high abundance sample detection method based on metagenomic sequencing data disclosed in the first aspect.
[0034] The beneficial effects of this invention are as follows: by performing multi-dimensional quantitative scoring on each sample within a batch, the accuracy and robustness of the judgment are improved; by employing background bacteria judgment rules to automatically detect background bacteria and using correction factors to eliminate interference from background bacteria; and by using a chain expansion mechanism to support the identification of single or multiple abnormal samples, avoiding omissions. This achieves automatic and accurate identification of abnormally high abundance samples. Attached Figure Description
[0035] The accompanying drawings illustrate specific examples of the technical solutions described in this invention and, together with the detailed embodiments, form part of the specification, serving to explain the technical solutions, principles, and effects of this invention.
[0036] Unless otherwise specified or defined, the same reference numerals in different figures represent the same or similar technical features, and different reference numerals may be used to represent the same or similar technical features.
[0037] Figure 1 This is a flowchart of a method for detecting abnormally high abundance samples based on metagenomic sequencing data, as disclosed in an embodiment of the present invention.
[0038] Figure 2 This is a flowchart illustrating the chain expansion mechanism used to identify abnormally high abundance samples in this embodiment of the invention.
[0039] Figure 3 This is a schematic diagram of the structure of the abnormally high abundance sample detection device based on metagenomic sequencing data according to an embodiment of the present invention;
[0040] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention.
[0041] Explanation of reference numerals in the attached figures: 600. Data module; 610. Multi-dimensional scoring module; 620. Background bacteria monitoring module; 630. Abnormal high abundance sample identification module; 401. Memory; 402. Processor. Detailed Implementation
[0042] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. When combined with the technical solutions of the invention in a real-world scenario, all technical and scientific terms used herein may also have meanings corresponding to the purpose of achieving the technical solutions of the invention. The terms "first," "second," etc., used herein are merely for distinguishing names and do not represent a specific number or order. The term "and / or," as used herein, includes any and all combinations of one or more of the associated listed items.
[0043] It should be noted that when a component is considered "fixed" to another component, it can be directly fixed to the other component or there can be an intervening component; when a component is considered "connected" to another component, it can be directly connected to the other component or there can be an intervening component; when a component is considered "mounted" on another component, it can be directly mounted on the other component or there can be an intervening component; when a component is considered "placed" on another component, it can be directly placed on the other component or there can be an intervening component.
[0044] Unless otherwise specified or defined, the terms "described" or "the" as used herein refer to the technical features or technical content mentioned or described prior to the relevant section, which may be the same as or similar to the technical features or technical content mentioned herein. Furthermore, the terms "comprising" and "having," and any variations thereof, as used herein, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0045] This invention discloses a method for detecting abnormally high abundance samples based on metagenomic sequencing data. It involves statistical analysis of intra-batch detection in metagenomic next-generation sequencing (mNGS) of pathogenic microorganisms, screening for species abundance anomalies in multiple samples from the same batch, identifying true infection signals from background noise, and accurately identifying genuine abnormally high abundance samples. This method can be implemented through computer programming. The execution subject of this method can be an electronic device such as a computer, laptop, or tablet, or a control chip embedded in an electronic device; this invention does not limit this. To facilitate understanding of this invention, specific embodiments will be described in more detail below with reference to the accompanying drawings.
[0046] like Figure 1 As shown, the method includes the following steps:
[0047] Step S100: Obtain metagenomic sequencing data of a set of samples, and calculate the abundance of each species in the samples based on the sequencing data. A set of samples consists of multiple samples from the same batch.
[0048] Metagenomic sequencing data of a set of samples is obtained. This data typically includes: sample ranking, sequencing reads, sequencing quality scores, sequence alignment information, and genome coverage. The set of samples refers to multiple clinical samples that underwent library construction and sequencing simultaneously within the same experimental batch. Based on the sequencing read information for each sample, the abundance of each pathogenic microorganism in each sample is statistically analyzed and calculated, providing a data foundation for subsequent multi-dimensional scoring and the identification of abnormal infection samples.
[0049] In some implementations, sequencing data can also be preprocessed, such as excluding NC / PC control samples, filtering out null values and undetected samples.
[0050] This embodiment calculates the following data dimensions based on sequencing data: abundance absolute value score, outlier score, ranking score, read concentration score, coverage score, and abundance dominance score. In practical use, some data sources may lack certain data information, resulting in missing data dimensions. For example, without ranking and read information, it is impossible to obtain the ranking score and read concentration score. Therefore, in some implementations, after obtaining metagenomic sequencing data of a set of samples, the following processing is also performed:
[0051] Calculate the total weight of the missing data dimensions, then distribute the total weight to each existing data dimension according to the weight ratio of each existing data dimension to obtain the corresponding weight increment, and update the weight of each existing data dimension to the sum of the original weight and the corresponding weight increment.
[0052] For example: The original weights of each data dimension are: Abundance Absolute Value Score: 0.25; Outlier Score: 0.30; Rank Score: 0.15; Reads Concentration Score: 0.15; Coverage Score: 0.10; Abundance Dominance Score: 0.05. The missing data dimensions are: Rank Score, Reads Concentration Score, and Coverage Score. The total weight of the missing data dimensions is: 0.15 + 0.15 + 0.10 = 0.4. The weight percentage of each existing data dimension is: Abundance Absolute Value Score: 0.25 / (0.25 + 0.30 + 0.05) = 0.4167, corresponding to a weight increment of 0.4167 * 0.4 = 0.1667. The updated weight of Abundance Absolute Value Score is 0.25 + 0.1667 = 0. 0.4167; The weight of the outlier score is 0.30 / (0.25+0.30+0.05)=0.5, and the corresponding weight increment is 0.5*0.4=0.2. The updated weight of the outlier score is 0.3+0.2=0.5; The weight of the abundance dominance score is 0.05 / (0.25+0.30+0.05)=0.0834, and the corresponding weight increment is 0.0834*0.4=0.0334. The updated weight of the abundance dominance score is 0.05+0.0334=0.0834.
[0053] By detecting the data availability of each dimension, the weights of unavailable dimensions are redistributed proportionally, so that reasonable evaluation results can still be given even when information is incomplete.
[0054] Step S200: Perform multi-dimensional scoring on the sequencing data to obtain the total score for each sample;
[0055] To improve the accuracy of identifying samples with abnormally high abundance of pathogenic microorganisms and avoid the risk of misjudgment due to single-indicator interpretation, this embodiment differs from simple single-threshold judgment. It integrates six scoring dimensions (absolute abundance, outlier degree, species ranking, read concentration, genome coverage, and abundance dominance) and uses weighted combinations to achieve multi-dimensional quantitative evaluation of samples, obtaining a total score for each sample. This improves the accuracy and robustness of the judgment, ensuring that the scoring results comprehensively reflect the infection-related characteristics of pathogenic microorganisms in the sample, and providing a comprehensive and reliable quantitative basis for subsequent abnormal sample identification.
[0056] Specifically, for each sample, the abundance absolute value score, outlier score, and abundance dominance score are calculated based on abundance, the ranking score is calculated based on ranking, the reads concentration score is calculated based on reads, and the coverage score is calculated based on coverage. Among these, the outlier score is used to assess the degree of abnormal deviation of the abundance value within the group, and the ranking includes genus ranking and within-genus ranking. Then, the abundance absolute value score, outlier score, abundance dominance score, ranking score, reads concentration score, and coverage score are weighted and accumulated to obtain the total score.
[0057] 1. Abundance absolute value score is used to quantify whether the abundance value of a sample reaches a level of interest, and its weight is 25%. The calculation method is as follows: the Sigmoid function is used to map the abundance value to the [0,1] interval. The specific formula is:
[0058]
[0059] in, The abundance is definitely worth allocating points to. The abundance value of the target species. The center point of the S-curve (default 12.0%). This is the steepness parameter (default 0.5). Using the above formula, we can obtain: <6%, abundance is absolutely close to 0; =12%, Abundance Absolute Score =0.5; With an abundance score >25%, the absolute abundance value approaches 1.0. Using the above function can avoid the jumps caused by hard thresholding.
[0060] 2. The outlier score is used to assess the degree of anomalous deviation of the sample abundance value within the group, and its weight is 30%. This embodiment integrates five sub-indicators for outlier scoring: Modified Z-score (MAD-based), median fold, second-highest value fold, gap score, and percentile ranking. Specifically: the MAD-based Z-score is robust to multiple outliers, the gap score identifies natural breakpoints in the data, and the fusion of multiple indicators avoids the limitations of a single indicator.
[0061] Specifically, firstly, the improved Z-score, median multiple, second-highest multiple, gap score, and percentile ranking based on the median absolute deviation are calculated according to the abundance; then, the improved Z-score, median multiple, second-highest multiple, gap score, and percentile ranking are weighted and accumulated to obtain the outlier score.
[0062] The weight of the improved Z-score based on the absolute deviation of the median is 25%, and the calculation formula is as follows;
[0063]
[0064] in, Let be the abundance value of the target species in the i-th sample, and let be the median abundance value within the group (sort the abundance values of the species in all samples from smallest to largest and take the median value). That is, the median of the absolute values of the differences between the abundance of all samples and the median is normalized to [0, 1]. The saturation value is set to 5.0.
[0065] The median multiple is used to measure how many times the sample abundance is relative to the typical level within the group. It has a weight of 25% and is calculated using the following formula: ,in, Let be the abundance value of the target species in the i-th sample, and let be the median abundance value within the group. The normalized interval of the median multiple is [1, 10].
[0066] The weight of the second-highest multiple is 20%, and the calculation formula is as follows: ,in, Let be the abundance value of the target species in the i-th sample. It is the second highest abundance value within the target species group, and the normalized interval for the second highest value multiple is [1,5].
[0067] The gap score is used to identify natural breakpoints in abundance data, helping to distinguish between "signal" and "noise," and it has a weight of 20%. First, the abundance values of the target species in all samples within the group are sorted from highest to lowest. Then, the ratio between two adjacent abundance values (Gap Ratio) is calculated using the following formula:
[0068] ,in,
[0069] in, For the first Abundance values of the target species in each sample.
[0070] Then, find the largest gap ratio among all gap ratios. The interval between adjacent samples corresponding to this largest gap ratio is the natural breakpoint of the abundance data. If a sample is located above the natural breakpoint, it belongs to the high abundance group, and a gap score is obtained. ,in, This is the proportionality coefficient. This represents the maximum gap ratio.
[0071] Percentile ranking uses the percentile position of a sample abundance within a group as the score, with a weight of 10%, and is calculated using the following formula: (i.e., abundance not exceeding) (Number of samples / Total number of samples).
[0072] Then, a weighted calculation is performed to obtain the outlier score. The calculation formula is:
[0073] , in, Gap score Ranked by percentile.
[0074] 3. The ranking score is calculated using genus ranking and within-genus ranking information, with a weight of 15%. Specifically, if the target species is the most abundant genus in the sample, then the genus ranking = 1, and the genus ranking score is 0.65. For each additional genus rank, the genus ranking score decreases by 15%. If the target species is the most abundant species within its genus, then the within-genus ranking = 1, and the within-genus ranking score is... It is 0.35. The calculation formula is:
[0075]
[0076] 4. Reads concentration score measures the concentration of sequencing reads for this species within the group, with a weight of 15%. The calculation formula is as follows:
[0077]
[0078] The percentage of reads is linearly mapped to the [0,1] interval, with a lower limit of 1% and an upper limit of 80%. If a sample accounts for 100% of the total reads of a species, it indicates that the detection signal is highly concentrated and is a strong positive signal.
[0079] 5. Coverage score is used to assess the reliability of the test based on the relative level of genome coverage. The higher the coverage, the more reliable the test. Its weight is 10%. The calculation formula is:
[0080]
[0081] in, For sample coverage, This represents the maximum coverage within the group.
[0082] 6. The abundance dominance score measures the proportion of a sample's abundance within the total abundance of the group, with a weight of 5%. The calculation formula is as follows:
[0083] ;
[0084] in, Let be the abundance value of the target species in the i-th sample. It is the sum of the abundance of all samples within the target species group.
[0085] After obtaining the abundance absolute value score, outlier score, ranking score, reads concentration score, coverage score, and abundance dominance score, the scores are weighted and accumulated according to their respective weights to obtain the total score for each sample.
[0086] Step S300: Use the background bacteria determination rule to determine whether there are background bacteria in a group of samples. If there are background bacteria, determine the correction factor and multiply the total score of each sample by the correction factor to correct the total score of each sample.
[0087] Certain microorganisms (such as Propionibacterium acnes) are common colonizing bacteria on human skin. In batch assays, these microorganisms may exhibit high abundance (40-84%) in most samples, but this does not necessarily indicate a true infection; rather, it represents background contamination during sample collection and processing. Therefore, it is necessary to exclude interference from background bacteria.
[0088] This embodiment introduces a group-level correction mechanism. By analyzing the statistical characteristics of the abundance distribution within a group (median and high abundance percentage), background bacteria are automatically identified and a penalty factor is applied. This effectively avoids false alarms from common colonizing bacteria such as Propionibacterium acnes, and enables automatic detection and exclusion of background bacteria.
[0089] Specifically, background bacteria determination rules are used to determine whether background bacteria exist in a set of samples. These rules include: if the median abundance is greater than or equal to a preset value and the proportion of samples with abundance greater than a hard abundance threshold is greater than a first proportion, background bacteria are determined to exist; if the proportion of samples with abundance greater than the hard abundance threshold is greater than or equal to a second proportion, background bacteria are determined to exist. When background bacteria are determined to exist according to the first rule, a preset correction factor is used; when background bacteria are determined to exist according to the second rule, a correction factor is calculated based on the sample proportion. Then, the total score of each sample is multiplied by the correction factor to correct the total score of each sample.
[0090] For example: Based on the abundance of each sample within the target species group, the median abundance value is calculated. When the proportion of samples with a median abundance value ≥10% and an abundance value ≥12% (number of samples meeting the abundance value ≥12% / total number of samples) >50%, background bacteria are identified, and a correction factor of 0.05 is set. When the proportion of samples with an abundance value ≥12% ≥70%, background bacteria are identified, and the correction factor is calculated using the formula: Correction factor = max(0.05, (1 - sample proportion)). When background bacteria are detected, the total score of all samples is multiplied by the correction factor to make it much lower than the reporting threshold, thereby avoiding false alarms. In the experiment of this embodiment, for the batch of Propionibacterium acnes, its abundance values are [83.81%, 72.79%, 72.65%, 72.25%, 69.53%, 41.48%]. [3.09%, 0.34%], the calculated median abundance value is 70.89%, the proportion of samples with abundance ≥12% is 75%, background bacteria are present, correction factor is 0.05, the highest total score after correction for each sample is 0.037, which is lower than the preset total score threshold of 0.45, so the sample containing the background bacteria will not be misjudged as an abnormally high abundance sample.
[0091] Step S400: Based on the total score and abundance of the samples, obtain the anomaly category and anomaly samples according to the anomaly category determination rules;
[0092] Step S500: When the anomaly category is a single anomaly, the anomaly sample is regarded as a high-abundance anomaly sample; when the anomaly category is multiple anomalies, a chain expansion mechanism is used to identify high-abundance anomaly samples among all anomaly samples.
[0093] Typically, in a dataset, only one sample exhibits abnormally high abundance (only the highest abundance exceeds the hard abundance threshold). In such cases, a simple judgment logic can be used to identify the abnormally high abundance sample. However, in some scenarios, two to three samples in the same batch may simultaneously exhibit abnormally high abundance (e.g., two cerebrospinal fluid samples with abundances of 20.04% and 18.99% respectively, both exceeding the hard abundance threshold of 12%). All of these samples need to be identified. To address this situation, this embodiment designs a chain-like expansion mechanism to identify abnormally high abundance samples. Therefore, it is necessary to first obtain the abnormal category and abnormal sample based on the sample's total score and abundance according to the abnormal category judgment rule.
[0094] Specifically, the total number of samples with abundance greater than a hard abundance threshold is counted. When the total number of samples is 1, it is determined to be a single anomaly. In this case, if the total score of the abnormal sample with abundance greater than the hard abundance threshold is greater than or equal to a preset total score threshold, then the abnormal sample is determined to be an abnormally high abundance sample. For single anomalies, by setting a joint judgment logic of "total score threshold" and "abundance hard threshold", an abnormal infection is only judged and output when both the total score and abundance of the microbial sequence are higher than the preset threshold. This effectively solves the technical problem of difficulty in distinguishing between background contamination and real infection, and improves the accuracy and reliability of diagnostic results.
[0095] When the total number of samples is greater than 1, all samples with abundance greater than the abundance hard threshold are considered anomalous samples. Then, a chain expansion mechanism is used to identify anomalously high abundance samples among these anomalous samples. For example... Figure 2 As shown, the specific steps include:
[0096] Step S510: Sort all abnormal samples in descending order according to the total score;
[0097] Step S520: Save the abnormal sample with the highest total score to the candidate group;
[0098] Step S530: Enumerate all abnormal samples except the abnormal sample with the highest total score. For each current sample, if the abundance of the current sample is greater than the abundance hard threshold, the ratio between the abundance of the current sample and the minimum abundance of all samples in the candidate group is less than the first preset threshold, and the difference between the total score of the current sample and the highest total score is less than the second preset threshold, add the current sample to the candidate group. If any condition is not met, the enumeration is completed.
[0099] Step S540: Set the samples in the candidate group as abnormally high abundance samples.
[0100] Specifically, in this embodiment, all abnormal samples are sorted in descending order based on the total score, resulting in a sample list sorted in descending order of total score. The first sample, i.e., the abnormal sample with the highest total score, is added to the candidate group. For the next abnormal sample A, the following conditions are checked: the abundance of abnormal sample A is ≥12% (abundance hard threshold); the ratio of the abundance of abnormal sample A to the minimum abundance in the candidate group is <2.0x (usually not exceeding 2 times); the difference between the total score of abnormal sample A and the highest total score is <0.25. If all these conditions are met, abnormal sample A is added to the candidate group, and the next abnormal sample is checked. If any condition is not met, the enumeration process is completed, and the expansion of the candidate group is stopped. Then, all samples in the candidate group are set as abnormally high abundance samples.
[0101] This embodiment addresses the situation where multiple samples from the same batch exhibit abnormally high abundance simultaneously. It designs a chain-like expansion mechanism based on abundance multiples and total score differences, adaptively identifying 1-3 abnormally high-abundance samples to avoid omissions. By using the minimum abundance in the candidate group as the abundance multiple benchmark for comparison, rather than the abundance of the previous abnormal sample, it ensures correct expansion even if the total score ranking of abnormal sample A is inconsistent with the abundance ranking. By limiting the total score difference to less than a second preset threshold, it prevents marginal samples with lower scores from being incorrectly identified as abnormally high-abundance samples.
[0102] In summary, by performing multi-dimensional quantitative scoring on each sample within a batch, the accuracy and robustness of the judgment are improved. Background bacteria are automatically detected and correction factors are used to eliminate their interference. Furthermore, a chain expansion mechanism is adopted to support the identification of multiple abnormal samples, avoiding omissions and automatically and accurately identifying abnormally high abundance samples.
[0103] This embodiment uses 20 sets of real batch-level detection statistics for experimental verification. The data information is shown in Table 1 (where "report" refers to identification and reporting): Table 1:
[0104]
[0105] The experimental results are shown in Table 2: Table 2:
[0106]
[0107]
[0108]
[0109]
[0110] As can be seen from the table above, the accuracy rate of the recognition results is 100%. Furthermore, based on the table above, the boundary verification results are shown in Table 3.
[0111] Table 3:
[0112]
[0113] like Figure 3 As shown, based on the above-mentioned method for detecting abnormally high abundance samples based on metagenomic sequencing data, this embodiment of the invention discloses a device for detecting abnormally high abundance samples based on metagenomic sequencing data, comprising:
[0114] Data module 600 is used to acquire metagenomic sequencing data of a set of samples and calculate the abundance of each species in the samples based on the sequencing data. The set of samples consists of multiple samples from the same batch.
[0115] The multi-dimensional scoring module 610 is used to score the sequencing data in multiple dimensions to obtain the total score of each sample.
[0116] Background bacteria detection module 620 is used to determine whether background bacteria exist in the group of samples using background bacteria determination rules. When background bacteria exist, a correction factor is determined, and the total score of each sample is multiplied by the correction factor to correct the total score of each sample.
[0117] The abnormal high abundance sample identification module 630 is used to obtain the abnormal category and abnormal sample based on the total score of the sample and the abundance according to the abnormal category determination rule. When the abnormal category is a single abnormality, the abnormal sample is regarded as an abnormal high abundance sample. When the abnormal category is multiple abnormalities, an abnormal high abundance sample is identified among all abnormal samples using a chain expansion mechanism.
[0118] In some embodiments, the abnormally high abundance sample identification module includes a sorting unit, an enumeration unit, and an output unit. The sorting unit is used to sort all abnormal samples in descending order according to the total score and save the abnormal sample with the highest total score to the candidate group. The enumeration unit is used to enumerate the remaining abnormal samples except for the abnormal sample with the highest total score. For each current sample, if the abundance of the current sample is greater than the abundance hard threshold, the ratio between the maximum abundance and the minimum abundance of all samples in the candidate group is less than a first preset threshold, and the difference between the total score and the highest total score is less than a second preset threshold, the current sample is added to the candidate group. If any condition is not met, the enumeration is completed. The output unit is used to set the samples in the candidate group as abnormally high abundance samples.
[0119] like Figure 4As shown, an embodiment of the present invention discloses an electronic device, including a memory 401 storing executable program code and a processor 402 coupled to the memory 401;
[0120] The processor 402 calls the executable program code stored in the memory 401 to execute the abnormally high abundance sample detection method based on metagenomic sequencing data described in the above embodiments.
[0121] This invention also discloses a computer-readable storage medium storing a computer program that causes a computer to execute the abnormally high abundance sample detection method based on metagenomic sequencing data described in the above embodiments.
[0122] The purpose of the above embodiments is to reproduce and derive the technical solution of the present invention by way of example, and to fully describe the technical solution, purpose and effect of the present invention. The purpose is to enable the public to have a more thorough and comprehensive understanding of the disclosure of the present invention, and not to limit the scope of protection of the present invention.
[0123] The above embodiments are not an exhaustive list based on the present invention, and there may be many other embodiments not listed. Any substitutions and improvements made without departing from the concept of the present invention are within the protection scope of the present invention.
Claims
1. A method for detecting abnormally high abundance samples based on metagenomic sequencing data, characterized in that, include: Obtain metagenomic sequencing data of a set of samples, and calculate the abundance of each species in the samples based on the sequencing data. The set of samples consists of multiple samples from the same batch. The sequencing data is scored in multiple dimensions to obtain the total score for each sample. The presence of background bacteria in the set of samples is determined by the background bacteria determination rule. When background bacteria are present, a correction factor is determined, and the total score of each sample is multiplied by the correction factor to correct the total score of each sample. Based on the total score and abundance of the samples, anomaly categories and anomalous samples are obtained according to the anomaly category determination rules. When the anomaly category is a single anomaly, the anomalous sample is regarded as an anomalous high-abundance sample. When the anomaly category is multiple anomalies, a chain expansion mechanism is used to identify anomalous high-abundance samples among all anomalous samples.
2. The method for detecting abnormally high abundance samples as described in claim 1, characterized in that, The sequencing data includes ranking, reads, and coverage. The sequencing data is scored in multiple dimensions to obtain a total score for each sample, including: For each sample, an abundance absolute value score, an outlier score, and an abundance dominance score are calculated based on the abundance; a ranking score is calculated based on the ranking; a reads concentration score is calculated based on the reads; and a coverage score is calculated based on the coverage. The outlier score is used to assess the degree of abnormal deviation of the abundance value within the group. The ranking includes genus ranking and within-genus ranking. The abundance absolute value score, outlier score, abundance dominance score, ranking score, reads concentration score, and coverage score are weighted and accumulated to obtain the total score.
3. The method for detecting abnormally high abundance samples as described in claim 2, characterized in that, An outlier score is calculated based on the abundance, including: The improved Z-score, median multiple, second-highest multiple, gap score, and percentile ranking are calculated based on the abundance. The outlier score is obtained by weighting and accumulating the improved Z-score, median multiple, second-highest multiple, gap score, and percentile ranking.
4. The method for detecting abnormally high abundance samples as described in claim 1, characterized in that, The presence of background bacteria in the sample set is determined using background bacteria determination rules. When background bacteria are present, a correction factor is determined, including: When the median abundance value is greater than or equal to a preset value and the proportion of samples with abundance greater than the abundance hard threshold is greater than the first proportion, it is determined that background bacteria exist, and the preset first correction factor is set as the correction factor. When the proportion of samples with abundance greater than the abundance hard threshold is greater than or equal to the second proportion, it is determined that background bacteria exist, and the correction factor is obtained based on the sample proportion.
5. The method for detecting abnormally high abundance samples as described in claim 1, characterized in that, A chain expansion mechanism is used to identify anomalously high-abundance samples among all anomalous samples, including: All abnormal samples are sorted in descending order based on the total score. Save the anomaly sample with the highest total score to the candidate group; Enumerate all abnormal samples except the abnormal sample with the highest total score. For each current sample, if the abundance of the current sample is greater than the abundance hard threshold, the ratio between the abundance of the current sample and the minimum abundance of all samples in the candidate group is less than the first preset threshold, and the difference between the total score of the current sample and the highest total score is less than the second preset threshold, the current sample is added to the candidate group. If any condition is not met, the enumeration is completed. The samples in the candidate group are set as abnormally high abundance samples.
6. The method for detecting abnormally high abundance samples as described in claim 1, characterized in that, After obtaining metagenomic sequencing data from a set of samples, the process also includes: When there are missing data dimensions, the total weight of the missing data dimensions is calculated. Based on the weight ratio of each existing data dimension, the total weight is allocated to each existing data dimension to obtain the corresponding weight increment. The weight of each existing data dimension is updated to the sum of the original weight and the corresponding weight increment. The data dimensions include the abundance absolute value score, outlier score, ranking score, reads concentration score, coverage score, and abundance dominance score.
7. A device for detecting abnormally high abundance samples based on metagenomic sequencing data, characterized in that, include: The data module is used to acquire metagenomic sequencing data of a set of samples and calculate the abundance of each species in the samples based on the sequencing data. The set of samples consists of multiple samples from the same batch. A multi-dimensional scoring module is used to score the sequencing data from multiple dimensions and obtain the total score for each sample. The background bacteria detection module is used to determine whether background bacteria exist in the group of samples using background bacteria determination rules. When background bacteria are present, a correction factor is determined, and the total score of each sample is multiplied by the correction factor to correct the total score of each sample. An abnormally high abundance sample identification module is used to obtain anomaly categories and abnormal samples based on the total score of the samples and the abundance according to the anomaly category determination rules. When the anomaly category is a single anomaly, the abnormal sample is regarded as an abnormally high abundance sample. When the anomaly category is multiple anomalies, an abnormally high abundance sample is identified among all abnormal samples using a chain expansion mechanism.
8. The abnormally high abundance sample detection device as described in claim 7, characterized in that, The abnormal high abundance sample identification module includes a sorting unit, an enumeration unit, and an output unit. The sorting unit is used to sort all abnormal samples in descending order according to the total score and save the abnormal sample with the highest total score to the candidate group. The enumeration unit is used to enumerate the remaining abnormal samples except for the abnormal sample with the highest total score. For each current sample, if the abundance of the current sample is greater than the abundance hard threshold, the ratio between the maximum abundance and the minimum abundance of all samples in the candidate group is less than a first preset threshold, and the difference between the total score and the highest total score is less than a second preset threshold, the current sample is added to the candidate group. If any condition is not met, the enumeration is completed. The output unit is used to set the samples in the candidate group as abnormal high abundance samples.
9. An electronic device, characterized in that, The method includes a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the abnormally high abundance sample detection method based on metagenomic sequencing data according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program causes a computer to perform the abnormally high abundance sample detection method based on metagenomic sequencing data according to any one of claims 1 to 6.