Method, apparatus, device, and program product for detecting sample contamination

By constructing a machine learning model by monitoring SNP site features, the accuracy problem of cross-contamination detection in human methylation samples was solved, improving detection accuracy and reducing false positive rate, thus ensuring the reliability and cost-effectiveness of medical testing.

CN122637876APending Publication Date: 2026-08-25SHANGHAI WEIHE MEDICAL LAB CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510176284.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing methods are insufficient to accurately detect the level of cross-contamination in human methylated samples. In particular, sample contamination introduced during high-throughput sequencing steps such as library preparation, DNA amplification, and sequencing can lead to false positive results, affecting the reliability and accuracy of diagnostic results.

Method used

By monitoring the characteristics of SNP sites, defining the characteristics of SNP sites with high signal-to-noise ratio, constructing a machine learning model, determining whether the sample is contaminated, obtaining the sample sequence using next-generation sequencing technology, and reducing the impact of sequencing error noise by filtering thresholds and feature value correction.

Benefits of technology

It improves the accuracy of sample contamination detection, lowers the detection limit, ensures the accuracy of medical testing, saves testing costs, and reduces false positive results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122637876A_ABST
    Figure CN122637876A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, electronic device and program product for detecting sample contamination. The method comprises filtering a detection sample sequence based on a determined filtering threshold, wherein the detection sample sequence comprises single nucleotide polymorphism (SNP) site sequencing data of the detection sample. The method further comprises determining a feature value of the detection sample sequence based on the filtered detection sample sequence. The method further comprises calculating a likelihood of the detection sample being contaminated based on the feature value of the detection sample sequence and a trained machine learning model. The method further comprises determining that the detection sample is contaminated in response to the likelihood of the detection sample being contaminated being greater than a predetermined contamination threshold. Through the method, it can be determined whether the sample is contaminated, and the detection cost is reduced and the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of information processing technology, and more specifically, to methods, apparatus, equipment, and procedures for detecting sample contamination. Background Technology

[0002] Currently, gene-based diagnosis and disease prevention are becoming increasingly common. Gene diagnosis aims to determine the cause of diseases at the molecular level by analyzing the molecular sequences carried in genetic information; molecular diagnosis targeting DNA and RNA is called gene diagnosis.

[0003] Single nucleotide polymorphisms (SNPs), also known as SNP sites, refer to variations in the DNA sequence caused by changes in a single nucleotide (A, T, C, G). These variations lead to diversity among individuals within the genome and are an important concept in genetic research. The basic characteristics of SNP sites include that almost all common SNP sites have only two alleles (biallelic), and in the human genome, there is approximately one polymorphic site per 1000 base pairs, indicating a high frequency. Furthermore, SNP sites are unevenly distributed, with non-coding regions being more common than coding regions. SNP sites are associated with the occurrence and development of various diseases, and therefore have wide applications in medical research and disease detection. Summary of the Invention

[0004] In a first aspect of the embodiments of this disclosure, a method for detecting sample contamination is provided. The method includes filtering a sample sequence for detection based on a determined filtering threshold, wherein the sample sequence includes sequencing data of single nucleotide polymorphisms (SNPs) of the sample. The method further includes determining feature values ​​of the filtered sample sequence. The method further includes calculating the probability that the sample is contaminated based on the feature values ​​of the sample sequence and a trained machine learning model. The method also includes determining that the sample is contaminated in response to the probability that the sample is contaminated being greater than a predetermined contamination threshold.

[0005] In a second aspect of the embodiments of this disclosure, an apparatus for detecting sample contamination is provided. The apparatus includes a filtering module configured to filter a test sample sequence based on a determined filtering threshold, wherein the test sample sequence includes sequencing data of single nucleotide polymorphisms (SNPs) of the test sample. The apparatus also includes a determining module configured to determine feature values ​​of the test sample sequence based on the filtered test sample sequence. The apparatus further includes a second determining module configured to determine the probability that the test sample is contaminated based on the feature values ​​of the test sample sequence and a trained machine learning model. The apparatus also includes a third determining module configured to determine that the test sample is contaminated in response to a probability that the test sample is contaminated exceeding a predetermined contamination threshold.

[0006] In a third aspect of embodiments of this disclosure, an electronic device for detecting sample contamination is provided. The electronic device includes a processor and a memory coupled to the processor. The memory has instructions stored therein that cause the processor to perform a method for detecting sample contamination. The method includes filtering a sample sequence to be detected based on a determined filtering threshold, wherein the sample sequence to be detected includes sequencing data of single nucleotide polymorphism (SNP) sites of the sample. The method further includes determining feature values ​​of the filtered sample sequence. The method further includes calculating the probability that the sample is contaminated based on the feature values ​​of the sample sequence and a trained machine learning model. The method also includes determining that the sample is contaminated in response to a probability that the sample is contaminated being greater than a predetermined contamination threshold.

[0007] In a fourth aspect of embodiments of this disclosure, a computer program product is provided. The computer program product is tangibly stored on a non-transitory computer-readable medium and includes machine-executable instructions that, when executed, cause a machine to implement a method for detecting sample contamination according to this disclosure. The method includes filtering a sample sequence to be detected based on a determined filtering threshold, wherein the sample sequence to be detected includes sequencing data of single nucleotide polymorphisms (SNPs) of the sample. The method further includes determining feature values ​​of the detected sample sequence based on the filtered sample sequence. The method further includes calculating the probability that the sample is contaminated based on the feature values ​​of the sample sequence and a trained machine learning model. The method also includes determining that the sample is contaminated in response to the probability that the sample is contaminated being greater than a predetermined contamination threshold.

[0008] In a fifth aspect of embodiments of this disclosure, a computer-readable storage medium is provided, wherein machine-executable instructions are stored on the computer-readable medium, which, when executed, cause a machine to implement a method for detecting sample contamination according to this disclosure. The method includes filtering a sample sequence for detection based on a determined filtering threshold, wherein the sample sequence for detection includes sequencing data of single nucleotide polymorphisms (SNPs) of the sample for detection. The method further includes determining feature values ​​of the filtered sample sequence for detection. The method further includes calculating the probability that the sample is contaminated based on the feature values ​​of the sample sequence and a trained machine learning model. The method also includes determining that the sample is contaminated in response to a probability that the sample is contaminated being greater than a predetermined contamination threshold.

[0009] It should be understood that the description in the Summary of the Invention section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] Other features, advantages, and aspects of the present disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0011] Figure 1 Flowcharts of methods for detecting sample contamination according to some embodiments of this disclosure are shown;

[0012] Figure 2 A flowchart illustrating a method for determining a filtering threshold for a test sample, according to some embodiments of this disclosure, is shown.

[0013] Figure 3 A flowchart illustrating a method for determining a filtering baseline for a sample, according to some embodiments of this disclosure, is shown;

[0014] Figure 3A A schematic diagram showing the relationship between different sequencing depths and observable contamination AF is presented;

[0015] Figure 4 A flowchart illustrating a method for determining a filtering threshold for a sample, according to some embodiments of this disclosure, is shown;

[0016] Figure 4A The diagram illustrates the distribution of alt_reads (other base types detected on the reference genome) from the mixed sample according to sequencing depth;

[0017] Figure 5 Flowcharts of methods for determining feature values ​​of detection samples according to some embodiments of this disclosure are shown;

[0018] Figure 6 Flowcharts illustrating methods for training machine learning models according to some embodiments of this disclosure are shown;

[0019] Figure 7 A flowchart of an overall method for detecting sample contamination according to some other embodiments of the present disclosure is shown;

[0020] Figure 8A This diagram illustrates the features of the detected samples before feature selection.

[0021] Figure 8B This diagram illustrates the features of the detected samples after feature selection.

[0022] Figure 9 The diagram shows the detection performance of a machine learning model for sample contamination detection trained using one or more embodiments of the present disclosure;

[0023] Figure 10 A block diagram of an apparatus for detecting sample contamination according to some embodiments of the present disclosure is shown;

[0024] Figure 11 A block diagram of an electronic device that can implement several embodiments of the present disclosure is shown. Detailed Implementation

[0025] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure. The embodiments of this disclosure described below with reference to the accompanying drawings are for illustrative purposes only.

[0026] As mentioned above, gene sequencing has been widely applied. Recently developed next-generation sequencing (NGS) technology has also been widely used in various diagnostic analyses, with methylation sequencing technology becoming an important tool for cancer screening, diagnosis, and monitoring. However, in high-throughput sequencing, experimental steps such as library preparation, DNA amplification, and sequencing all carry the risk of introducing DNA contamination from adjacent samples. This contamination may lead to the detection of tumor signals belonging to other patients in the sample, resulting in false positives. In tumor diagnostic screening, tumor signal molecules in early-stage solid tumors typically constitute a very low percentage; even trace amounts of contamination can lead to misjudgment, affecting the reliability of screening or diagnostic results and reducing product specificity. To ensure the reliability and accuracy of results, there is an urgent need to develop sensitive cross-contamination detection technologies to effectively determine whether samples are contaminated.

[0027] Furthermore, blood methylation library construction methods introduce high background noise, and 3-base alignment results may lead to numerous mismatches. When processing this data, a balance needs to be struck between the number of available reads and the number of mismatches; too few reads or improper filtering can result in inaccurate methylation levels. In addition, after DNA fragments undergo methylation transformation, such as CT transformation, the methylation status of fragments from different parental sources is inconsistent, leading to a discrepancy between the capture efficiency of fully methylated and fully non-methylated probes. This results in unpredictable changes in the allele frequencies of polymorphic sites in the target captured sequencing data.

[0028] Existing methods such as Conpair and ConEst attempt to address the problem of cross-contamination identification. Conpair requires paired case-control samples, while ConEst uses Bayesian methods to calculate posterior probabilities based on population mutation frequency information to assess contamination levels. However, neither of these methods is applicable to human (e.g., blood) methylation data. Furthermore, methylation transformation often causes significant fluctuations in background noise levels, and previous methods have not adequately considered the impact of these fluctuations on cross-contamination calculations. Therefore, accurately detecting cross-contamination levels in human (e.g., blood) methylated samples remains challenging.

[0029] Optionally, one or more embodiments of this disclosure provide a method, electronic device, system, program product, and storage medium for detecting sample contamination by improving the signal-to-noise ratio and lowering the detection limit in cross-contamination detection. One or more embodiments of this disclosure innovatively consider that noise at mutated SNP sites is independent and randomly generated. By defining SNP site features with high signal-to-noise ratios, the influence of noise caused by sequencing errors can be reduced, thereby improving the detection limit and accurately determining which samples are contaminated or which are not, thus achieving significant beneficial effects.

[0030] Furthermore, one or more embodiments of this disclosure include defining the characteristics of SNP sites by monitoring SNP sites, selecting the characteristics of the SNP sites according to predetermined conditions, constructing a machine learning model based on the characteristics of the selected SNP sites, and then determining whether the sample to be tested is contaminated based on the machine learning model. Optionally, the contamination may originate from different parental sources; for example, some samples may contain blood from different individuals. The contamination may also originate from the detection environment, such as aerosol contamination.

[0031] Figure 1 A flowchart of a method 100 for detecting sample contamination, according to some embodiments of this disclosure, is shown. The various steps of method 100 can be performed by a system, electronic device, or program product implementing the method. At block 110, a sample sequence for detection is filtered based on a determined filtering threshold, wherein the sample sequence for detection includes sequencing data of single nucleotide polymorphisms (SNPs) of the sample. Optionally, the sample for detection can be derived from human tissue. Optionally, the sample for detection can be derived from bodily fluids. Optionally, the sample for detection can be human blood or saliva, etc. As mentioned above, various applicable sequencing technologies can be used, such as first-generation or second-generation sequencing technologies. It is worth noting that those skilled in the art can use any sequencing technology suitable for this disclosure to obtain the sample sequence for detection. This disclosure does not limit the sequencing method for the sample sequence. Any sequencing method suitable for this disclosure should fall within the protection scope of this disclosure. How the determined filtering threshold is determined will be described in detail in one or more subsequent embodiments. Optionally, the sample sequence for detection can be filtered by the determined filtering threshold. Optionally, the filtered detection sample sequence will have feature values ​​that stand out from the background noise, thereby revealing the individual features of the detection sample sequence and facilitating the extraction of its features. This is also a substantial feature that makes one or more embodiments of this disclosure significantly superior to the prior art.

[0032] At box 120, feature values ​​of the detected sample sequence are determined based on the filtered detected sample sequence. Optionally, as described above, the filtered detected sample sequence has feature values ​​that stand out from the background noise, thereby revealing the individual features of the detected sample sequence and facilitating the extraction of the feature values. Optionally, method 100 may further include correcting the feature values ​​of the detected sample sequence based on the feature mean and standard deviation of the uncontaminated sample sequence. The specific method for extracting the feature values ​​of the detected sample sequence will be described in detail in one or more subsequent embodiments, and will not be elaborated here.

[0033] At box 130, the probability of a detected sample being contaminated is calculated based on the feature values ​​of the detected sample sequence and the trained machine learning model. Optionally, the feature values ​​of the detected sample sequence can be used as input to the trained machine learning model to calculate the probability of contamination. Optionally, the probability can be a percentage value between 0 and 1. Optionally, the higher the percentage value, the greater the probability of contamination, and vice versa. Optionally, a discrete probability can also be defined, for example, using integers from 0 to 10, where 0 represents no contamination and 10 represents that the detected sample is definitely contaminated. It is worth noting that those skilled in the art can use any suitable numerical method to indicate probability, and this disclosure does not limit this. Any probability representation suitable for this disclosure should fall within the protection scope of this disclosure. As for how to train the machine learning model, this disclosure will describe it in detail in one or more subsequent embodiments, and for the sake of brevity, it will not be repeated here.

[0034] At box 140, in response to the probability that the test sample is contaminated being greater than a predetermined contamination threshold, it is determined that the test sample is contaminated. Optionally, based on the feature values ​​of the test sample sequence, a trained machine learning model calculates the probability that the test sample is contaminated. Optionally, this probability can be a percentage value or a discrete integer. Optionally, the contamination threshold can be predetermined. As an example, if the applicant's long-term practice has found that a predetermined contamination threshold greater than or equal to 50% is reasonable, then for test samples from different populations, regions, etc., the predetermined contamination threshold can be set to 50%, 60%, or 70%, etc. For a discrete probability indication method, the contamination threshold can be set to 5, 6, or 7, etc. It is worth noting that those skilled in the art can use any predetermined contamination threshold suitable for this disclosure, and those skilled in the art can also adjust the predetermined contamination threshold accordingly according to actual needs. This disclosure does not impose any limitations in this regard. Any predetermined contamination threshold suitable for this disclosure should fall within the protection scope of this disclosure. Optionally, method 100 also includes determining that the test sample is uncontaminated in response to the probability that the test sample is contaminated being less than or equal to the predetermined contamination threshold.

[0035] Therefore, using Method 100 to detect sample contamination can reduce the impact of noise caused by sequencing errors, thereby increasing the detection limit. Even samples with low levels of contamination can be detected, accurately identifying which samples are contaminated and which are not. This ensures that the samples used will not cause false results in subsequent medical tests, guaranteeing the accuracy of those tests. Furthermore, detecting contaminated samples in advance eliminates the need for subsequent medical testing, significantly reducing testing costs.

[0036] Figure 2A flowchart of a method 200 for determining a filtering threshold for a test sample, according to some embodiments of the present disclosure, is shown. At block 210, a training sample sequence is obtained, wherein the sample sequence includes sequencing data of single nucleotide polymorphism (SNP) sites of the training sample. Optionally, the training sample may be derived from human tissue. Optionally, the training sample may be derived from human bodily fluids. Optionally, the training sample may be human blood or saliva, etc. As mentioned above, various applicable sequencing technologies can be used, such as first-generation or second-generation sequencing technologies. It is worth noting that those skilled in the art can use any sequencing technology suitable for the present disclosure to obtain the training sample sequence of the present disclosure. The present disclosure does not limit the sequencing method for the training sample sequence. Any sequencing method suitable for the training sample of the present disclosure should fall within the protection scope of the present disclosure. Optionally, for training samples from a specific population, SNP sites with variant allele frequencies (AF) between a predetermined numerical range are selected. Since there are certain differences in the relative genes of a population, these differences are also reflected in the numerical range of AF. The numerical range of AF for some specific populations is certain, for example, between 0.4 and 0.6. Optionally, by selecting training sample sequences with representative AF numerical ranges, it is beneficial to reveal the effective features of the training sample sequences from the background noise, thereby facilitating subsequent processing, such as feature extraction. Optionally, the training sample sequences include uncontaminated training sample sequences and mixed training sample sequences, and the mixed training sample sequences include uncontaminated training sample sequences with different parental sources at a predetermined ratio. Optionally, the predetermined ratio includes simulated mixing according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}.

[0037] At box 220, based on the training sample sequence, SNP sites in the training sample sequence that conform to the predetermined mutation direction are determined. Optionally, selecting appropriate SNP sites in the training sample sequence with the predetermined mutation direction is very beneficial for detecting sample contamination. A pioneering contribution of one or more embodiments of this disclosure is the proposal to select mutation directions with high signal-to-noise ratios. Optionally, the predetermined mutation direction may include at least one of mutation from adenine A to thymine T or mutation from thymine T to adenine A. Optionally, mutations from adenine A to thymine T or from thymine T to adenine A exhibit good signal-to-noise ratios. Therefore, they exhibit excellent properties in subsequent noise removal and feature extraction, making the machine learning model using them as training samples very accurate in judging sample contamination after training. Optionally, the training samples include a training sample set and a validation sample set, and the validation sample set includes a first validation sample set and a second validation sample set, wherein the first validation sample set includes simulated training samples generated by computer simulation, and the training sample set and the validation sample set have no identical samples.

[0038] At box 230, a filtering baseline is determined based on the identified SNP sites. Optionally, the training sample sequences include uncontaminated training sample sequences and mixed training sample sequences, and the mixed training sample sequences include uncontaminated training sample sequences from different parental sources at a predetermined ratio. Optionally, the predetermined ratio includes simulated mixing according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}. As an example, 62 uncontaminated samples can be selected, paired to form 1891 different sample pairs, and simulated mixing can be performed according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}. The specific method for determining the filtering baseline based on the identified SNP sites will be described in detail in one or more subsequent embodiments, and will not be repeated here for brevity. At box 240, a filtering threshold is determined based on the filtering baseline and the SNP sites. Similarly, how to determine the filtering threshold based on the filtering baseline and SNP sites will be described in detail in one or more subsequent embodiments, and will not be repeated here for the sake of brevity.

[0039] Therefore, method 200 determines the filtering threshold for the detection samples. Based on this threshold, the corresponding detection sample sequences can be filtered, thus easily obtaining the feature values ​​of the detection samples. This is highly advantageous whether using the feature values ​​of the detection samples for training machine learning models or for detecting whether the samples are contaminated.

[0040] Figure 3 A flowchart of a method 300 for determining a filtering baseline for detection samples, according to some embodiments of the present disclosure, is shown. At block 310, an uncontaminated training sample sequence is selected, and at block 320, based on the uncontaminated training sample sequence, a simulated mixing is performed according to a predetermined mixing gradient to form a mixed sample sequence. Optionally, the training sample sequence includes an uncontaminated training sample sequence and a mixed training sample sequence, and the mixed training sample sequence includes uncontaminated training sample sequences with different parental sources at a predetermined ratio. Optionally, the predetermined ratio includes simulated mixing according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}. As an example, 62 uncontaminated samples can be selected, paired to form 1891 different sample pairs, and simulated mixing can be performed according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}.

[0041] At box 330, based on the mixed sample sequences, the relationship between the depth range of SNP sites in the mixed sample sequences and the detected AFs is statistically analyzed. Optionally, SNP sites under the corresponding mixing gradient are selected, and the relationship between different sequencing depths and observable contamination AFs is statistically analyzed. Optionally, as an example, the corresponding mixing gradient can be defined as AF = 1 in mixed sample A and AF = 0 in mixed sample B; alternatively, as an example, the corresponding mixing gradient can be defined as AF = 0 in mixed sample A and AF = 1 in mixed sample B. Figure 3A A schematic diagram illustrating the relationship between different sequencing depths and observable contamination AF is shown. Figure 3A The horizontal axis represents the readings of abrupt changes, and the vertical axis represents the frequency of such readings in the mixed sample. Figure 3A This shows the statistical relationship between different sequencing depths and observable contamination AF in this mixed sample. Optionally, for different mixed samples, the same statistical relationship can be shown. Figure 3A Similar diagrams illustrating the relationship between different sequencing depths and observable contamination AFs are omitted here to save space. Based on these diagrams showing the relationship between different sequencing depths and observable contamination AFs in mixed sample sequences, the relationship between the sequencing depth of SNP sites and the detected AFs in the mixed sample sequences can be statistically analyzed.

[0042] At box 340, a filtering baseline is determined based on the statistical results. Optionally, based on these statistical results, the filtering baseline can be selected to be determined according to actual needs. For example, using... Figure 3A For example, if frequently occurring readings are all below 350, then reading 350 can be selected as the filtering baseline. Of course, those skilled in the art can determine the filtering baseline according to actual needs; for example, to reduce computational load, those skilled in the art may consider reading 300 as the filtering baseline. It is worth noting that any filtering baseline selection suitable for this disclosure is permitted and should fall within the protection scope of this disclosure.

[0043] Therefore, it can be seen that the method 300 is used to determine the filtering baseline, which can reduce the impact of noise, highlight the feature signal, and reduce the amount of computation, thus reducing the time and cost of machine learning and achieving very good technical results.

[0044] Figure 4A flowchart of a method 400 for determining a filtering threshold for a test sample, according to some embodiments of the present disclosure, is shown. At block 410, quantiles corresponding to different sequencing depths of the mixed sample sequences are calculated based on a filtering baseline. Optionally, based on the filtering baseline, the AF values ​​observed by the training samples at different sequencing depths under the corresponding mixing gradient are determined to calculate the quantiles for that interval. Optionally, since there are different mixing gradients, the training samples will have different corresponding quantiles. Optionally, these quantiles also correspond to the corresponding filtering baseline under different mixing gradients. Optionally, as an example, if an AF value is observed within the depth range of 300–350, then the quantile in the depth range of 300–350 is determined based on the observed AF value. It is worth noting that those skilled in the art can determine the specific calculation method for the quantiles according to actual needs. The present disclosure does not limit this. Any specific calculation method for quantiles suitable for the present disclosure should fall within the protection scope of the present disclosure.

[0045] At box 420, the mixed sample sequences are filtered based on quantiles and different predetermined filtering thresholds. At box 430, the signal-to-noise ratio (SNR) of SNP sites in the mixed sample sequences filtered by different predetermined filtering thresholds is calculated. Optionally, all simulated mixed samples are filtered according to different mixing gradients and corresponding sequencing depth quantiles, and the SNR of signal sites in the samples under different threshold filtering is calculated. Optionally, this SNR can be obtained by calculating the ratio of all_real_alt_site / nosie_alt_site / both_alt_site, where alt_reads in SNP sites represent other base types detected on the reference genome, all_real_alt_site indicates that all alt reads at this site come from the mixed sample, nosie_alt_site indicates that none of the alt reads at this site come from the mixed sample, and both_alt_site indicates that some of the alt reads at this site come from the mixed sample. Figure 4A This diagram illustrates the distribution of alt_reads from a mixed sample according to sequencing depth. Figure 4A The horizontal axis represents different sequencing depths, and the vertical axis represents the proportion of alt reads at that locus originating from the mixed sample out of all loci. Optionally, similar values ​​can be applied to different mixed gradient samples. Figure 4A The corresponding distribution diagram of alt reads from mixed samples according to sequencing depth is not described in detail here to save space.

[0046] At box 440, a filtering threshold is determined based on the signal-to-noise ratio (SNR). Optionally, the Q70 quantile is calculated and selected as the filtering threshold based on the aforementioned SNR. Optionally, the filtering threshold is greater than the Q70 quantile. Optionally, the filtering threshold comprises an M*N matrix, where M corresponds to different mixing gradients and N corresponds to different sequencing depths. Optionally, the Q60 or Q80 quantile can also be used as the filtering threshold, and those skilled in the art can choose according to actual needs. It is worth noting that this disclosure does not limit the specific selection of the quantile for the filtering threshold, and any specific selection of the quantile suitable for this disclosure should fall within the protection scope of this disclosure.

[0047] In summary, by using method 400 to determine the filtering threshold and filtering the training or detection samples based on the determined filtering threshold, a large amount of background noise is removed, leaving behind beneficial signals with eigenvalue properties. This facilitates the extraction of eigenvalues ​​from the training or detection samples. Based on the eigenvalues ​​of the training or detection samples, machine learning models can be effectively trained, or the trained models can be used to accurately and effectively detect contamination in the detection samples, achieving significant technical results.

[0048] Figure 5 A flowchart of a method 500 for determining feature values ​​of a test sample, according to some embodiments of this disclosure, is shown. At block 510, an initial feature matrix of the test sample sequence is calculated based on the variant reads at all SNP sites and the total sequencing depth of the filtered test sample sequence. This initial feature matrix includes an M'*N' matrix, where M' corresponds to different mixing gradients and N' corresponds to different sequencing depths. Optionally, for each test sample, at the monitored SNP sites, filtering is performed based on different mixing gradients and mutation allele frequencies (AF values) corresponding to different sequencing depths, according to a filtering threshold. Optionally, an initial feature matrix of the test sample sequence is calculated based on the variant reads at all SNP sites and the total sequencing depth of the filtered test sample sequence. This initial feature matrix includes an M'*N' matrix, where M' corresponds to different mixing gradients and N' corresponds to different sequencing depths. The filtered test sample sequence or training sample sequence, corresponding to different mixing gradients and different sequencing depths, can constitute an M'*N' initial feature value matrix. One drawback of the initial eigenvalue matrix M'*N' is that it has a lot of redundancy, which needs to be further removed. The process of removing redundancy is also, to some extent, a process of further removing noise.

[0049] Further, at box 520, initial feature values ​​corresponding to the predetermined sequencing depth are removed from the initial feature matrix, and at box 530, initial feature values ​​corresponding to the predetermined mixed gradient are removed from the initial feature matrix. Optionally, removing initial feature values ​​corresponding to the predetermined sequencing depth from the initial feature matrix includes removing initial feature values ​​corresponding to the interval above depth 350. As mentioned above, the reading frequency corresponding to the interval above depth 350 is very low. Removing this interval can reduce noise and reduce the computational cost of the matrix, thus reducing the time and cost of training the model. Similarly, performing this processing on the detection samples can also reduce the detection time and cost. Optionally, removing initial feature values ​​corresponding to the predetermined mixed gradient from the initial feature matrix includes removing initial feature values ​​corresponding to more than 10% of the mixed gradient. Again, as mentioned above, the reading frequency corresponding to more than 10% of the mixed gradient is very low. Removing this interval can also reduce noise and reduce the computational cost of the matrix, thus reducing the time and cost of training the model. Similarly, performing this processing on the detection samples can also reduce the detection time and cost.

[0050] At box 540, feature values ​​for the detection sample sequence are generated based on the initial feature matrix after removing the corresponding initial feature values. Optionally, removing noise and redundancy from the initial feature matrix yields a simplified feature matrix, which is then used to generate and output the feature values ​​for the detection sample sequence. This feature value matrix can then be used to train a machine learning model or to detect whether the detection sample is contaminated.

[0051] In summary, the feature value matrix of the detection sample determined by method 500 is highly beneficial for subsequent training of machine learning models or for using trained machine learning models to detect contamination of the detection sample, as this feature value matrix removes noise and redundancy and retains strong features that can characterize the detection sample. This saves costs, improves training effect and detection accuracy, and achieves significant technical results.

[0052] Figure 6 A flowchart of a method 600 for training a machine learning model according to some embodiments of this disclosure is shown. At block 610, a training sample sequence is filtered based on a determined filtering threshold. At block 620, feature values ​​of the training sample sequence are determined based on the filtered training sample sequence. The specific methods for filtering the training sample sequence based on the determined filtering threshold and determining the feature values ​​of the training sample sequence based on the filtered training sample sequence have been described in detail in the above-described methods 200, 300, 400, and 500; for the sake of brevity, they will not be repeated here.

[0053] At box 630, a machine learning model is trained based on the feature values ​​of the training sample sequence. Optionally, this machine learning model includes a gradient boosting algorithm. Optionally, this machine learning model is based on the XGBoost model. The XGBoost model is a boosting tree algorithm that combines multiple weak learners (decision trees) to form a strong learner. The construction of each new tree is based on the prediction errors of the previous trees, aiming to reduce the overall loss. The objective function of XGBoost consists of a loss function and a regularization term. For the sample sequence dataset... The objective function is given by equation (1):

[0054]

[0055] in,

[0056] L represents the loss function, which measures the model's predictions. Compared with the true value y i The error between;

[0057] Ω(f k ) is a regularization term used to control the complexity of the tree model. It is usually defined as equation (2):

[0058]

[0059] in,

[0060] f k Represent each tree in the model;

[0061] T is the number of leaves in the tree;

[0062] w j This is the weight of the j-th leaf. The weight update formula is: Among them, I j It is the set of sample indices contained in the j-th leaf node;

[0063] γ and λ control the complexity;

[0064] To minimize the loss component in the objective function, XGBoost approximates it using a second-order Taylor expansion as shown in equation (3):

[0065]

[0066] in,

[0067] It is the first derivative (gradient);

[0068] It is the second derivative (Hessian);

[0069] In the k-th tree, the model's prediction is the sum of the predictions from the first k-1 trees and the output value from the k-th tree, as shown in equation (4):

[0070]

[0071] At box 640, in response to the loss function of the machine learning model converging to a predetermined residual threshold, a trained machine learning model is generated. Optionally, this machine learning model includes multiple model gradient boosting decision trees. Optionally, method 600 also includes generating a new decision tree in response to the pre-decision tree prediction errors of the machine learning model to make the loss function of the machine learning model converge. Optionally, the predetermined residual threshold is less than or equal to 5%.

[0072] Therefore, it can be seen that by training a machine learning model using method 600, the quality of the training data is very high due to the special processing of the training data according to one or more embodiments of this disclosure, and thus the trained machine learning model is also very effective.

[0073] Figure 7A flowchart of an overall method 700 for detecting sample contamination according to some other embodiments of the present disclosure is shown. To help those skilled in the art understand the overall scheme of the present disclosure, method 700 provides an overall method flowchart for detecting sample contamination and training a machine learning model for detecting sample contamination. Considering that the specific methods 200, 300, 400, and 500 described above have already detailed how to filter training sample sequences based on a determined filtering threshold, and how to determine feature values ​​of the filtered training sample sequences, etc., will not be repeated here for the sake of brevity. Specifically, at box 701, the sample to be tested is acquired, the sequence of which includes sequencing data of single nucleotide polymorphism (SNP) sites of the sample. At box 702, available SNP sites are extracted according to thresholds of different depths. At box 703, the contamination signal value is calculated for each layer according to the depth of the SNP sites, and the corresponding feature value is obtained. At box 704, the feature values ​​of the sample to be tested are merged. At box 705, the trained machine learning model is used to determine whether the sample is contaminated. If the judgment result is negative, the process ends at box 707. If the judgment result is positive, indicating that the sample is contaminated, the contamination level range is determined at box 706. Boxes 708–712 schematically illustrate the process of training a machine learning model for detecting sample contamination. At box 708, test samples are obtained. At box 709, samples are mixed pairwise to simulate contamination levels of 0.05%–10%. At box 710, the probability and threshold of alt_reads at each SNP site are determined for each contamination level and depth. The results obtained at box 710 can be used for processing at box 702. At box 711, features of uncontaminated samples and samples at each contamination level are collected to construct training and test sets. At box 712, the contamination detection model is trained and its performance is validated. The trained machine learning model obtained at box 712 can be used for sample contamination detection at box 705.

[0074] In summary, the methods described in one or more embodiments of this disclosure have yielded excellent results in both sample contamination detection and training machine learning models for sample contamination detection. For example, Figure 8A and 8B This diagram illustrates a comparison of features before and after selection. Figure 8A and 8B The horizontal axis represents different samples, and the vertical axis represents the feature values ​​corresponding to different samples. The first column (control) represents uncontaminated samples (0 doping). Those skilled in the art can easily understand this from... Figure 8A and 8B After seeing the feature selection performed using one or more embodiments of this disclosure, Figure 8B The sample feature values ​​in the middle are significantly higher than Figure 8AThe feature values ​​corresponding to the same samples are much more significant. Similar comparisons and effect diagrams exist for features of different samples at different depths and contamination levels, which will not be elaborated upon here to save space. Figure 9 The diagram illustrates the detection performance of a machine learning model for sample contamination detection trained using one or more embodiments of the present disclosure. Figure 9 The horizontal axis represents different sample types, with the first column (control) representing uncontaminated samples (0 doping) and the rest representing samples with different levels of contamination. The vertical axis represents the probability values ​​predicted by the model, and the dashed line represents the threshold defined by the model. On the first and second validation sets, the model achieved a detection limit of 0.1% for contamination levels with 95% specificity. The applicant's detection practice shows that even with a small sample size, the detection limit can still reach 0.2% with 95% specificity. Therefore, using one or more embodiments of this disclosure for sample contamination detection and training machine learning models for sample contamination detection has achieved excellent practical results.

[0075] Figure 10 A block diagram of an apparatus 1000 for detecting sample contamination according to some embodiments of the present disclosure is shown. Figure 10 As shown, the device 1000 includes a filtering module 1010 configured to filter a test sample sequence based on a determined filtering threshold, wherein the test sample sequence includes single nucleotide polymorphism (SNP) sequencing data of the test sample. The device 1000 also includes a determination module 1020 configured to determine feature values ​​of the test sample sequence based on the filtered test sample sequence. The device 1000 further includes a second determination module 1030 configured to determine the likelihood of contamination of the test sample based on the feature values ​​of the test sample sequence and a trained machine learning model. The device 1000 also includes a third determination module 1040 configured to determine that the test sample is contaminated in response to a likelihood of contamination exceeding a predetermined contamination threshold.

[0076] It is understood that the apparatus 1000 of this disclosure can achieve at least one of the many advantages achievable by the methods or processes described above. For example, it can reduce the impact of noise caused by sequencing errors, thereby increasing the detection limit, enabling the detection of samples with low levels of contamination, accurately determining which test samples are contaminated and which are not, thus ensuring that the test samples used will not cause false results in subsequent medical tests and ensuring the accuracy of subsequent medical tests. Moreover, by detecting contaminated test samples in advance, subsequent medical tests can be avoided, greatly saving testing costs.

[0077] This disclosure also provides an electronic device for detecting sample contamination. The electronic device includes a processor and a memory coupled to the processor. The memory has instructions stored therein that cause the processor to perform a method for detecting sample contamination. The method includes filtering a sample sequence to be detected based on a determined filtering threshold, wherein the sample sequence to be detected includes sequencing data of single nucleotide polymorphisms (SNPs) of the sample. The method also includes determining feature values ​​of the filtered sample sequence based on the filtered sample sequence. The method further includes calculating the probability that the sample is contaminated based on the feature values ​​of the sample sequence and a trained machine learning model. The method also includes determining that the sample is contaminated in response to the probability that the sample is contaminated being greater than a predetermined contamination threshold.

[0078] Figure 11 A block diagram of an electronic device 1100 according to certain embodiments of the present disclosure is shown. Device 1100 may be the device or apparatus described in the embodiments of the present disclosure. Figure 11 As shown, device 1100 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 1101, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 1102 or loaded from storage unit 1108 into random access memory (RAM) 1103. Various programs and data required for the operation of device 1100 can also be stored in RAM 1103. The CPU / GPU 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104. Although not shown in... Figure 11 As shown, device 1100 may also include a coprocessor.

[0079] Multiple components in device 1100 are connected to I / O interface 1105, including: input unit 1106, such as keyboard, mouse, etc.; output unit 1107, such as various types of monitors, speakers, etc.; storage unit 1108, such as disk, optical disk, etc.; and communication unit 1109, such as network card, modem, wireless transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0080] The various methods or processes described above can be executed by CPU / GPU 1101. For example, in some embodiments, the methods may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by CPU / GPU 1101, one or more steps or actions in the methods or processes described above can be performed.

[0081] In some embodiments, the methods and processes described above can be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.

[0082] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0083] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, a local area network (LAN), a wide area network (WAN), and / or a wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0084] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​and conventional procedural programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0085] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0086] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0087] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0088] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

[0089] The following are some example implementations of this disclosure.

[0090] Example 1. A method for detecting sample contamination, comprising:

[0091] Based on a defined filtering threshold, sample sequences are filtered, wherein the detected sample sequences include sequencing data of single nucleotide polymorphism (SNP) sites of the detected samples.

[0092] Based on the filtered detection sample sequence, the feature values ​​of the detection sample sequence are determined;

[0093] Based on the feature values ​​of the detected sample sequence and the trained machine learning model, the probability that the detected sample is contaminated is calculated; and

[0094] The test sample is determined to be contaminated if the probability of the test sample being contaminated is greater than a predetermined contamination threshold.

[0095] Example 2. The method according to Example 1, wherein the method further includes:

[0096] Obtain training sample sequences, wherein the detection sample sequences include SNP site sequencing data of the training samples;

[0097] Based on the training sample sequences, identify the SNP sites in the training sample sequences that conform to the predetermined mutation direction;

[0098] Based on the identified SNP sites, a filtering baseline is determined; and

[0099] The filtering threshold is determined based on the filtering baseline and the SNP site.

[0100] Example 3. The method according to any one of Examples 1-2, wherein obtaining the training sample sequence comprises:

[0101] For training samples from a specific population, SNP sites with variant allele frequencies (AF) falling within a predetermined range are selected.

[0102] Example 4. The method according to any one of Examples 1-3, wherein the predetermined mutation direction includes at least one of mutation from adenine A to thymine T or mutation from thymine T to adenine A.

[0103] Example 5. The method according to any one of Examples 1-4, wherein the training sample sequence comprises an uncontaminated training sample sequence and a mixed training sample sequence, and the mixed training sample sequence comprises uncontaminated training sample sequences with different parental sources at a predetermined ratio.

[0104] Example 6. The method according to any one of Examples 1-5, wherein the predetermined ratio comprises simulated mixing according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}.

[0105] Example 7. The method according to any one of Examples 1-6, wherein determining the filtering baseline based on the determined SNP site comprises:

[0106] Select the uncontaminated training sample sequence;

[0107] Based on the uncontaminated training sample sequence, simulated mixing is performed according to a predetermined mixing gradient to form a mixed sample sequence;

[0108] Based on the mixed sample sequences, the relationship between the sequencing depth of SNP sites and the detected AFs in the mixed sample sequences was statistically analyzed; and

[0109] Based on the statistical results, the filtering baseline is determined.

[0110] Example 8. The method according to any one of Examples 1-7, wherein determining the filtering threshold based on the filtering baseline and the SNP site includes:

[0111] Based on the filtering baseline, calculate the quantiles corresponding to different sequencing depths of the mixed sample sequences;

[0112] The mixed sample sequences are filtered based on the quantiles and different predetermined filtering thresholds, respectively.

[0113] The signal-to-noise ratio of the SNP sites in the mixed sample sequences after filtering with different predetermined filtering thresholds was statistically analyzed; and

[0114] The filtering threshold is determined based on the signal-to-noise ratio.

[0115] Example 9. The method according to any one of Examples 1-8, wherein the filtering threshold comprises an M*N matrix, where M corresponds to different mixing gradients and N corresponds to different sequencing depths.

[0116] Example 10. The method according to any one of Examples 1-9, wherein determining the feature values ​​of the detection sample sequence based on the filtered detection sample sequence comprises:

[0117] Based on the variant readings and total sequencing depth at all SNP sites of the filtered test sample sequence, an initial feature matrix of the test sample sequence is calculated, wherein the initial feature matrix includes an M'*N' matrix, where M' corresponds to different mixing gradients and N' corresponds to different sequencing depths;

[0118] Remove the initial feature values ​​corresponding to the predetermined sequencing depth from the initial feature matrix;

[0119] Remove the initial eigenvalues ​​corresponding to the predetermined mixed gradient from the initial feature matrix; and

[0120] The feature values ​​of the detection sample sequence are generated based on the initial feature matrix after removing the corresponding initial feature values.

[0121] Example 11. The method according to any one of Examples 1-10, wherein the training samples include a training sample set and a validation sample set, and the validation sample set includes a first validation sample set and a second validation sample set, wherein the first validation sample set includes simulated training samples generated by computer simulation, and wherein the training sample set and the validation sample set have no identical samples.

[0122] Example 12. The method according to any one of Examples 1-11, wherein the machine learning model is based on the XGBoost model, the method further comprising:

[0123] The training sample sequence is filtered based on a determined filtering threshold;

[0124] Based on the filtered training sample sequence, the feature values ​​of the training sample sequence are determined;

[0125] The machine learning model is trained based on the feature values ​​of the training sample sequence; and

[0126] The trained machine learning model is generated in response to the loss function of the machine learning model converging to a predetermined residual threshold.

[0127] Example 13. The method according to any one of Examples 1-12, wherein the machine learning model comprises multiple model gradient boosting decision trees, the method further comprising:

[0128] In response to the prediction errors of the previous decision tree of the machine learning model, a new decision tree is generated to bring the loss function of the machine learning model to converge.

[0129] Example 14. The method according to any one of Examples 1-13, the method further comprising:

[0130] The feature values ​​of the detected sample sequence are corrected based on the feature mean and standard deviation of the uncontaminated sample sequence.

[0131] Example 15. The method according to any one of Examples 1-14, the method further comprising:

[0132] In response to the probability that the test sample is contaminated being less than or equal to a predetermined contamination threshold, the test sample is determined to be uncontaminated.

[0133] Example 16. The method according to any one of Examples 1-15, wherein the predetermined contamination threshold is greater than or equal to 50%, the filtration threshold is greater than the Q70 quantile, and the predetermined residual threshold is less than or equal to 5%.

[0134] Example 17. The method according to any one of Examples 1-16, wherein removing the initial feature value corresponding to the predetermined sequencing depth from the initial feature matrix includes removing the initial feature value corresponding to the interval above depth 350.

[0135] Example 18. The method according to any one of Examples 1-17, wherein removing the initial eigenvalues ​​corresponding to the predetermined mixed gradients from the initial feature matrix includes removing the initial eigenvalues ​​corresponding to more than 10% of the mixed gradients.

[0136] Example 19. An apparatus for detecting sample contamination, comprising:

[0137] A filtering module configured to filter sample sequences based on a defined filtering threshold, wherein the detected sample sequences include single nucleotide polymorphism (SNP) site sequencing data of the detected samples.

[0138] A determination module, configured to determine feature values ​​of the detected sample sequence based on the filtered detected sample sequence;

[0139] A second determining module is configured to determine the likelihood that the detected sample is contaminated based on the feature values ​​of the detected sample sequence and a trained machine learning model; and

[0140] A third determining module is configured to determine that the test sample is contaminated in response to the possibility that the test sample is contaminated being greater than a predetermined contamination threshold.

[0141] Example 20. The apparatus according to Example 19, wherein the apparatus further comprises:

[0142] The acquisition module is configured to acquire training sample sequences, wherein the detection sample sequences include SNP site sequencing data of the training samples;

[0143] The fourth determining module is configured to determine SNP sites in the training sample sequence that conform to a predetermined mutation direction based on the training sample sequence.

[0144] The fifth determining module is configured to determine a filtering baseline based on the determined SNP sites; and

[0145] The sixth determining module is configured to determine the filtering threshold based on the filtering baseline and the SNP site.

[0146] Example 21. The apparatus according to any one of Examples 19-20, wherein the acquisition module comprises:

[0147] The selection module is configured to select SNP sites whose variant allele frequencies (AF) fall within a predetermined range for training samples from a specific population.

[0148] Example 22. The apparatus according to any one of Examples 19-21, wherein the predetermined mutation direction includes at least one of mutation from adenine A to thymine T or mutation from thymine T to adenine A.

[0149] Example 23. The apparatus according to any one of Examples 19-22, wherein the training sample sequence comprises an uncontaminated training sample sequence and a mixed training sample sequence, and the mixed training sample sequence comprises an uncontaminated training sample sequence with different parental sources at a predetermined ratio.

[0150] Example 24. The apparatus according to any one of Examples 19-23, wherein the predetermined ratio comprises simulated mixing according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}.

[0151] Example 25. The apparatus according to any one of Examples 19-24, wherein the fourth determining module comprises:

[0152] The selection module is configured to select the uncontaminated training sample sequence;

[0153] The mixing module is configured to perform simulated mixing based on the uncontaminated training sample sequence according to a predetermined mixing gradient to form a mixed sample sequence;

[0154] The statistics module is configured to, based on the mixed sample sequences, statistically analyze the relationship between the sequencing depth of SNP sites in the mixed sample sequences and the detected AFs; and

[0155] The seventh determining module is configured to determine the filtering baseline based on the results of the statistics.

[0156] Example 26. The apparatus according to any one of Examples 19-25, wherein the fifth determining module comprises:

[0157] The calculation module is configured to calculate the quantiles corresponding to different sequencing depths of the mixed sample sequences based on the filtering baseline;

[0158] The second filtering module is configured to filter the mixed sample sequences based on the quantiles and different predetermined filtering thresholds respectively.

[0159] The second statistical module is configured to calculate the signal-to-noise ratio of the SNP sites in the mixed sample sequences after filtering with different predetermined filtering thresholds; and

[0160] The eighth determining module is configured to determine the filtering threshold based on the signal-to-noise ratio.

[0161] Example 27. The apparatus according to any one of Examples 19-26, wherein the filtering threshold comprises an M*N matrix, where M corresponds to different mixing gradients and N corresponds to different sequencing depths.

[0162] Example 28. The apparatus according to any one of Examples 19-27, wherein the determining module comprises:

[0163] The second calculation module is configured to calculate an initial feature matrix of the detection sample sequence based on the variant readings and total sequencing depth of all SNP sites in the filtered detection sample sequence. The initial feature matrix includes an M'*N' matrix, where M' corresponds to different mixing gradients and N' corresponds to different sequencing depths.

[0164] The first removal module is configured to remove the initial feature values ​​corresponding to a predetermined sequencing depth from the initial feature matrix;

[0165] The second removal module is configured to remove initial feature values ​​corresponding to a predetermined mixed gradient from the initial feature matrix; and

[0166] The generation module is configured to generate feature values ​​of the detection sample sequence based on the initial feature matrix after removing the corresponding initial feature values.

[0167] Example 29. The apparatus according to any one of Examples 19-28, wherein the training samples include a training sample set and a validation sample set, and the validation sample set includes a first validation sample set and a second validation sample set, wherein the first validation sample set includes simulated training samples generated by computer simulation, and the training sample set and the validation sample set have no identical samples.

[0168] Example 30. The apparatus according to any one of Examples 19-29, wherein the machine learning model is based on the XGBoost model, the apparatus further comprising:

[0169] The third filtering module is configured to filter the training sample sequence based on a determined filtering threshold.

[0170] The ninth determining module is configured to determine the feature values ​​of the training sample sequence based on the filtered training sample sequence;

[0171] The training module is configured to train the machine learning model based on the feature values ​​of the training sample sequence; and

[0172] The second generation module is configured to generate the trained machine learning model in response to the loss function of the machine learning model converging to a predetermined residual threshold.

[0173] Example 31. The apparatus according to any one of Examples 19-30, wherein the machine learning model comprises a plurality of model gradient boosting decision trees, the apparatus further comprising:

[0174] The third generation module is configured to generate a new decision tree in response to the previous decision tree prediction error of the machine learning model so that the loss function of the machine learning model converges.

[0175] Example 32. The apparatus according to any one of Examples 19-31, further comprising:

[0176] The correction module is configured to correct the feature values ​​of the detected sample sequence based on the feature mean and standard deviation of the uncontaminated sample sequence.

[0177] Example 33. The apparatus according to any one of Examples 19-32, further comprising:

[0178] The tenth determining module is configured to determine that the test sample is uncontaminated in response to the possibility that the test sample is contaminated being less than or equal to a predetermined contamination threshold.

[0179] Example 34. The apparatus according to any one of Examples 19-33, wherein the predetermined contamination threshold is greater than or equal to 50%, the filtration threshold is greater than the Q70 quantile, and the predetermined residual threshold is less than or equal to 5%.

[0180] Example 35. The apparatus according to any one of Examples 19-34, wherein removing the initial feature value corresponding to the predetermined sequencing depth from the initial feature matrix includes removing the initial feature value corresponding to the interval above depth 350.

[0181] Example 36. The apparatus according to any one of Examples 19-35, wherein removing the initial eigenvalues ​​corresponding to the predetermined mixed gradient from the initial feature matrix includes removing more than 10% of the initial eigenvalues ​​corresponding to the mixed gradient.

[0182] Example 37. An electronic device for detecting sample contamination, comprising:

[0183] Processor; and

[0184] A memory coupled to the processor, the memory having instructions stored therein, which, when executed by the processor, cause the device to perform the following actions:

[0185] Based on a defined filtering threshold, sample sequences are filtered, wherein the detected sample sequences include sequencing data of single nucleotide polymorphism (SNP) sites of the detected samples.

[0186] Based on the filtered detection sample sequence, the feature values ​​of the detection sample sequence are determined;

[0187] Based on the feature values ​​of the detected sample sequence and the trained machine learning model, the probability that the detected sample is contaminated is calculated; and

[0188] The test sample is determined to be contaminated if the probability of the test sample being contaminated is greater than a predetermined contamination threshold.

[0189] Example 38. The electronic device according to any one of Examples 37, wherein the action further includes:

[0190] Obtain training sample sequences, wherein the detection sample sequences include SNP site sequencing data of the training samples;

[0191] Based on the training sample sequences, identify the SNP sites in the training sample sequences that conform to the predetermined mutation direction;

[0192] Based on the identified SNP sites, a filtering baseline is determined; and

[0193] The filtering threshold is determined based on the filtering baseline and the SNP site.

[0194] Example 39. An electronic device according to any one of Examples 37-38, wherein acquiring the training sample sequence comprises:

[0195] For training samples from a specific population, SNP sites with variant allele frequencies (AF) falling within a predetermined range are selected.

[0196] Example 40. An electronic device according to any one of Examples 37-39, wherein the predetermined mutation direction includes at least one of mutation from adenine A to thymine T or mutation from thymine T to adenine A.

[0197] Example 41. An electronic device according to any one of Examples 37-40, wherein the training sample sequence comprises an uncontaminated training sample sequence and a mixed training sample sequence, and the mixed training sample sequence comprises uncontaminated training sample sequences with different parental sources at a predetermined ratio.

[0198] Example 42. An electronic device according to any one of Examples 37-41, wherein the predetermined ratio comprises simulated mixing according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}.

[0199] Example 43. An electronic device according to any one of Examples 37-42, wherein determining the filtering baseline based on the determined SNP site comprises:

[0200] Select the uncontaminated training sample sequence;

[0201] Based on the uncontaminated training sample sequence, simulated mixing is performed according to a predetermined mixing gradient to form a mixed sample sequence;

[0202] Based on the mixed sample sequences, the relationship between the sequencing depth of SNP sites and the detected AFs in the mixed sample sequences was statistically analyzed; and

[0203] Based on the statistical results, the filtering baseline is determined.

[0204] Example 44. An electronic device according to any one of Examples 37-43, wherein determining the filtering threshold based on the filtering baseline and the SNP site includes:

[0205] Based on the filtering baseline, calculate the quantiles corresponding to different sequencing depths of the mixed sample sequences;

[0206] The mixed sample sequences are filtered based on the quantiles and different predetermined filtering thresholds, respectively.

[0207] The signal-to-noise ratio of the SNP sites in the mixed sample sequences after filtering with different predetermined filtering thresholds was statistically analyzed; and

[0208] The filtering threshold is determined based on the signal-to-noise ratio.

[0209] Example 45. An electronic device according to any one of Examples 37-44, wherein the filtering threshold comprises an M*N matrix, where M corresponds to different mixing gradients and N corresponds to different sequencing depths.

[0210] Example 46. An electronic device according to any one of Examples 37-45, wherein determining the feature values ​​of the detection sample sequence based on the filtered detection sample sequence comprises:

[0211] Based on the variant readings and total sequencing depth at all SNP sites of the filtered test sample sequence, an initial feature matrix of the test sample sequence is calculated, wherein the initial feature matrix includes an M'*N' matrix, where M' corresponds to different mixing gradients and N' corresponds to different sequencing depths;

[0212] Remove the initial feature values ​​corresponding to the predetermined sequencing depth from the initial feature matrix;

[0213] Remove the initial eigenvalues ​​corresponding to the predetermined mixed gradient from the initial feature matrix; and

[0214] The feature values ​​of the detection sample sequence are generated based on the initial feature matrix after removing the corresponding initial feature values.

[0215] Example 47. An electronic device according to any one of Examples 37-46, wherein the training samples include a training sample set and a verification sample set, and the verification sample set includes a first verification sample set and a second verification sample set, wherein the first verification sample set includes simulated training samples generated by computer simulation, and wherein the training sample set and the verification sample set have no identical samples.

[0216] Example 48. An electronic device according to any one of Examples 37-47, wherein the machine learning model is based on an XGBoost model, and the action further includes:

[0217] The training sample sequence is filtered based on a determined filtering threshold;

[0218] Based on the filtered training sample sequence, the feature values ​​of the training sample sequence are determined;

[0219] The machine learning model is trained based on the feature values ​​of the training sample sequence; and

[0220] The trained machine learning model is generated in response to the loss function of the machine learning model converging to a predetermined residual threshold.

[0221] Example 49. An electronic device according to any one of Examples 37-48, wherein the machine learning model comprises a plurality of model gradient boosting decision trees, and the electronic device further comprises:

[0222] In response to the prediction errors of the previous decision tree of the machine learning model, a new decision tree is generated to bring the loss function of the machine learning model to converge.

[0223] Example 50. The electronic device according to any one of Examples 37-49, wherein the operation further includes:

[0224] The feature values ​​of the detected sample sequence are corrected based on the feature mean and standard deviation of the uncontaminated sample sequence.

[0225] Example 51. The electronic device according to any one of Examples 37-50, wherein the operation further includes:

[0226] In response to the probability that the test sample is contaminated being less than or equal to a predetermined contamination threshold, the test sample is determined to be uncontaminated.

[0227] Example 52. An electronic device according to any one of Examples 37-51, wherein the predetermined contamination threshold is greater than or equal to 50%, and the filtration threshold is greater than the Q70 quantile, and the predetermined residual threshold is less than or equal to 5%.

[0228] Example 53. An electronic device according to any one of Examples 37-52, wherein removing the initial feature value corresponding to the predetermined sequencing depth from the initial feature matrix includes removing the initial feature value corresponding to the interval above depth 350.

[0229] Example 54. An electronic device according to any one of Examples 37-53, wherein removing the initial eigenvalues ​​corresponding to a predetermined mixed gradient from the initial feature matrix includes removing the initial eigenvalues ​​corresponding to more than 10% of the mixed gradients.

[0230] Example 55. A computer-readable storage medium having stored thereon one or more computer instructions, wherein the one or more computer instructions are executed by a processor to implement the method according to any one of Examples 1 to 18.

[0231] Example 56. A computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform the method according to any one of Examples 1 to 18.

[0232] Although this disclosure has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for detecting sample contamination, comprising: Based on a defined filtering threshold, the test sample sequences are filtered, wherein the test sample sequences include single nucleotide polymorphism (SNP) site sequencing data of the test samples. Based on the filtered detection sample sequence, the feature values ​​of the detection sample sequence are determined; Based on the feature values ​​of the detected sample sequence and the trained machine learning model, the likelihood of the detected sample being contaminated is determined. as well as The test sample is determined to be contaminated if the probability of the test sample being contaminated is greater than a predetermined contamination threshold.

2. The method according to claim 1, wherein the method further comprises: Obtain training sample sequences, wherein the training sample sequences include SNP site sequencing data of the training samples; Based on the training sample sequences, identify the SNP sites in the training sample sequences that conform to the predetermined mutation direction; Based on the identified SNP sites, a filtering baseline is determined; as well as The filtering threshold is determined based on the filtering baseline and the SNP site.

3. The method according to claim 2, wherein obtaining the training sample sequence comprises: For training samples from a specific population, SNP sites with variant allele frequencies (AF) falling within a predetermined range are selected.

4. The method of claim 3, wherein the predetermined mutation direction includes at least one of mutation from adenine A to thymine T or mutation from thymine T to adenine A.

5. The method of claim 2, wherein the training sample sequence comprises an uncontaminated training sample sequence and a mixed training sample sequence, and the mixed training sample sequence comprises uncontaminated training sample sequences with different parental sources at a predetermined ratio.

6. The method of claim 5, wherein the predetermined ratio comprises performing simulated mixing according to a mixing gradient of {0.05%, 0.1%, 0.2%, 0.5%, 1%, 2%, 10%}.

7. The method of claim 2, wherein determining the filtering baseline based on the determined SNP site comprises: Select the uncontaminated training sample sequence; Based on the uncontaminated training sample sequence, simulated mixing is performed according to a predetermined mixing gradient to form a mixed sample sequence; Based on the mixed sample sequences, the relationship between the sequencing depth of SNP sites in the mixed sample sequences and the detected AFs was statistically analyzed; as well as Based on the statistical results, the filtering baseline is determined.

8. The method of claim 7, wherein determining the filtering threshold based on the filtering baseline and the SNP site comprises: Based on the filtering baseline, calculate the quantiles corresponding to different sequencing depths of the mixed sample sequences; The mixed sample sequences are filtered based on the quantiles and different predetermined filtering thresholds, respectively. The signal-to-noise ratio of the SNP sites in the mixed sample sequences after being filtered by different predetermined filtering thresholds is statistically analyzed. as well as The filtering threshold is determined based on the signal-to-noise ratio.

9. The method according to claim 8, wherein the filtering threshold comprises an M*N matrix, where M corresponds to different mixing gradients and N corresponds to different sequencing depths.

10. The method of claim 9, wherein determining the feature values ​​of the detection sample sequence based on the filtered detection sample sequence comprises: Based on the variant readings and total sequencing depth at all SNP sites of the filtered test sample sequence, an initial feature matrix of the test sample sequence is calculated, wherein the initial feature matrix includes an M'*N' matrix, where M' corresponds to different mixing gradients and N' corresponds to different sequencing depths; Remove the initial feature values ​​corresponding to the predetermined sequencing depth from the initial feature matrix; Remove the initial feature values ​​corresponding to the predetermined mixed gradient from the initial feature matrix; as well as The feature values ​​of the detection sample sequence are generated based on the initial feature matrix after removing the corresponding initial feature values.

11. The method of claim 2, wherein the training samples include a training sample set and a validation sample set, and the validation sample set includes a first validation sample set and a second validation sample set, wherein the first validation sample set includes simulated training samples generated by computer simulation, and the training sample set and the validation sample set have no identical samples.

12. The method of claim 2, wherein the machine learning model is based on the XGBoost model, and the method further comprises: The training sample sequence is filtered based on a determined filtering threshold; Based on the filtered training sample sequence, the feature values ​​of the training sample sequence are determined; The machine learning model is trained based on the feature values ​​of the training sample sequence; as well as The trained machine learning model is generated in response to the loss function of the machine learning model converging to a predetermined residual threshold.

13. The method of claim 12, wherein the machine learning model comprises multiple model gradient boosting decision trees, and the method further comprises: In response to the prediction errors of the previous decision tree of the machine learning model, a new decision tree is generated to bring the loss function of the machine learning model to converge.

14. The method according to claim 1, further comprising: The feature values ​​of the detected sample sequence are corrected based on the feature mean and standard deviation of the uncontaminated sample sequence.

15. The method according to claim 1, further comprising: In response to the probability that the test sample is contaminated being less than or equal to a predetermined contamination threshold, the test sample is determined to be uncontaminated.

16. The method of claim 12, wherein the predetermined contamination threshold is greater than or equal to 50%, the filtration threshold is greater than the Q70 quantile, and the predetermined residual threshold is less than or equal to 5%.

17. The method of claim 10, wherein removing the initial feature value corresponding to the predetermined sequencing depth from the initial feature matrix includes removing the initial feature value corresponding to the interval above depth 350.

18. The method of claim 10, wherein removing the initial feature values ​​corresponding to the predetermined mixed gradients from the initial feature matrix includes removing the initial feature values ​​corresponding to more than 10% of the mixed gradients.

19. An apparatus for detecting sample contamination, comprising: A filtering module configured to filter sample sequences based on a defined filtering threshold, wherein the detected sample sequences include single nucleotide polymorphism (SNP) site sequencing data of the detected samples. A determination module, configured to determine feature values ​​of the detected sample sequence based on the filtered detected sample sequence; The second determining module is configured to determine the likelihood that the detection sample is contaminated based on the feature values ​​of the detection sample sequence and the trained machine learning model. as well as A third determining module is configured to determine that the test sample is contaminated in response to the possibility that the test sample is contaminated being greater than a predetermined contamination threshold.

20. An electronic device for detecting sample contamination, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, which, when executed by the processor, cause the device to perform the method according to any one of claims 1 to 18.

21. A computer program product tangibly stored on a computer-readable medium and comprising machine-executable instructions that, when executed, cause a machine to perform the method according to any one of claims 1 to 18.