Sample quality detection method and device, electronic device, and storage medium

CN122930184APending Publication Date: 2026-10-16BGI WUHAN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510431404.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

此外,样本的DNA提取过程中也可能会引入杂质,从而影响后续的测序和分析结果

Benefits of technology

[0065] The sample quality detection method, apparatus, electronic device, and storage medium proposed in this application preprocess the raw sequencing data by filtering out incomplete reads. Clean sequencing data for each sample is obtained by quality control of the preprocessed raw sequencing data. The clean sequencing data is then compared with known genomic data to obtain sequence alignment data. Therefore, this application uses known genomic data as a reference genome. Compared to methods using control samples in related technologies, this application reduces alignment costs and can simultaneously complete the quality detection and evaluation of a large number of samples in a faster time. Furthermore, this application performs quality detection on the sample based on contamination detection parameters, variant detection parameters, sequence alignment parameters in the sequence alignment data, and quality control indicators. That is, this application performs quality detection on the sample through multiple stages and dimensions, thereby improving the accuracy and efficiency of quality detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122930184A_ABST
    Figure CN122930184A_ABST
Patent Text Reader

Abstract

The present disclosure provides a sample quality detection method and device, an electronic device and a storage medium. The sample quality detection method comprises: obtaining original sequencing data of each to-be-detected sample in a sample set, filtering incomplete reads in the original sequencing data, and performing quality control on the original sequencing data to obtain clean sequencing data and quality control index parameters; aligning the clean sequencing data of each to-be-detected sample with known genome data to obtain sequence alignment data of each to-be-detected sample; performing variation detection on each to-be-detected sample according to the sequence alignment data to obtain variation detection parameters of each to-be-detected sample; performing contamination detection on each to-be-detected sample according to the sequence alignment data and the variation detection parameters to obtain contamination detection parameters of each to-be-detected sample; and performing quality detection on each to-be-detected sample according to the contamination detection parameters, the variation detection parameters, the sequence alignment data and the quality control index parameters. The embodiments of the present application can improve the accuracy of sample quality detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of bioinformatics, specifically to a sample quality detection method and apparatus, electronic equipment, and storage medium. Background Technology

[0002] Currently, in large-scale genomics studies and similar scenarios, the number of research samples is enormous, involving multiple data collection points and sample processing procedures. Therefore, sample quality control is particularly important. Samples may be affected by various factors such as temperature and humidity during collection, storage, and transportation. Furthermore, impurities may be introduced during DNA extraction, thus affecting subsequent sequencing and analysis results.

[0003] However, the methods for quality testing of samples in related technologies suffer from low accuracy. Summary of the Invention

[0004] The main objective of this application is to provide a sample quality detection method, apparatus, electronic device, and storage medium, which aims to improve the accuracy of sample quality detection.

[0005] To achieve the above objectives, a first aspect of this application provides a sample quality detection method, the method comprising:

[0006] The raw sequencing data of each sample to be tested in the sample set is obtained. Incomplete reads in the raw sequencing data of each sample to be tested are filtered out, and the raw sequencing data of each sample to be tested after filtering is quality controlled to obtain clean sequencing data and quality control index parameters for each sample to be tested.

[0007] The clean sequencing data of each sample to be tested is compared with known genome data to obtain the sequence alignment data of each sample to be tested.

[0008] Based on sequence alignment data, mutation detection is performed on each test sample to obtain the mutation detection parameters for each test sample.

[0009] Contamination detection is performed on each sample based on sequence alignment data and variant detection parameters to obtain contamination detection parameters for each sample.

[0010] Quality testing is performed on each sample based on contamination detection parameters, mutation detection parameters, sequence alignment data, and quality control index parameters.

[0011] In some embodiments, pollution detection parameters include external pollution detection parameters;

[0012] Contamination detection is performed on each sample based on sequence alignment data and variant detection parameters to obtain contamination detection parameters, including:

[0013] The sequence alignment data and variant detection parameters corresponding to each sample to be tested are compared with the preset parameter threshold, and the first contamination detection result of each sample to be tested is determined based on the comparison results.

[0014] When it is determined from the first pollution detection result that the sample set includes multiple suspected pollutant samples to be tested, determine the number of first sequencing fragments of the pollutant species in each sample to be tested.

[0015] The exogenous pollution detection parameters for each sample are calculated based on the number of first sequencing fragments corresponding to each sample, the total number of sequencing fragments for each sample, and the preset weights of pollutant species.

[0016] In some embodiments, the contamination detection parameters also include the probability of cross-contamination;

[0017] Each sample is tested for contamination based on sequence alignment data and variant detection parameters to obtain contamination detection parameters, which also include:

[0018] The single nucleotide polymorphism sites for each sample to be tested were determined based on sequence alignment data.

[0019] For each sample to be tested, the first likelihood under the contamination assumption and the second likelihood under the no-contamination assumption are calculated based on the genotype frequency and genotype likelihood of each corresponding single nucleotide polymorphism site.

[0020] The cross-contamination probability of each test sample is calculated based on the first likelihood, second likelihood, and prior contamination probability of each test sample.

[0021] In some embodiments, quality testing is performed on each sample based on contamination detection parameters, variant detection parameters, sequence alignment data, and quality control index parameters, including:

[0022] The quality score of each test sample is calculated based on the pollution detection parameters, mutation detection parameters, sequence alignment data and quality control index parameters corresponding to each test sample.

[0023] Multiple test samples are sorted according to quality scores;

[0024] Based on the sorting results, the contaminated test samples are identified from multiple test samples.

[0025] In some embodiments, quality testing is performed on each sample based on contamination detection parameters, variant detection parameters, sequence alignment data, and quality control index parameters, including:

[0026] Based on the contamination detection parameters, mutation detection parameters, sequence alignment data, and quality control index parameters corresponding to each sample to be tested, the parameters are compared with the preset index thresholds corresponding to each parameter to encode the contamination detection for each sample to be tested.

[0027] Based on the pollution detection code, the contaminated sample is identified from multiple samples to be tested.

[0028] In some embodiments, sequence alignment data includes alignment rates;

[0029] The clean sequencing data of each sample to be tested is compared with known genomic data to obtain the sequence alignment data of each sample to be tested, including:

[0030] The clean sequencing data of each sample to be tested is compared with the known genome data to obtain the number of first reads in the clean sequencing data that are successfully matched with the known genome data.

[0031] The comparison rate is calculated based on the number of the first read segment and the total number of read segments for each sample to be tested.

[0032] In some embodiments, sequence alignment data includes repetition rates;

[0033] The clean sequencing data of each sample to be tested is compared with known genomic data to obtain the sequence alignment data of each sample to be tested, including:

[0034] The clean sequencing data of each sample to be tested is compared with the known genome data to obtain the number of repeat reads of each sample to be tested, as well as the number of second reads in the clean sequencing data that are successfully matched with the known genome data.

[0035] The repetition rate is calculated based on the number of repeated segments and the number of second-order segments.

[0036] In some embodiments, sequence alignment data includes sequencing depth;

[0037] The clean sequencing data of each sample to be tested is compared with known genomic data to obtain the sequence alignment data of each sample to be tested, including:

[0038] The clean sequencing data of each sample to be tested is compared with the known genome data to obtain the total number of base pairs that are successfully matched with the known genome data for each sample to be tested.

[0039] The sequencing depth is calculated based on the total number of paired bases and the effective length of the known genome data.

[0040] In some embodiments, the variant detection parameters include a first ratio and / or a second ratio;

[0041] Based on sequence alignment data, variant detection is performed on each test sample to obtain variant detection parameters for each test sample, including:

[0042] Based on sequence alignment data, mutation detection is performed on each sample to be tested to obtain the number of heterozygous sites and the total number of detected sites in each sample to be tested. The first ratio is calculated based on the number of heterozygous sites and the total number of detected sites.

[0043] And / or, based on sequence alignment data, perform mutation detection on each test sample to obtain the number of base transitions and base transversions in each test sample, and calculate the second ratio based on the number of base transitions and base transversions.

[0044] In some embodiments, quality control parameters include the percentage of consecutive bases. Quality control is performed on the raw sequencing data of each sample after filtering to obtain clean sequencing data and quality control parameters for each sample, including:

[0045] For each sample to be tested, when it is determined that the filtered raw sequencing data contains a predetermined number of consecutive target bases, the predetermined number of consecutive target bases are removed from the filtered raw sequencing data to obtain clean sequencing data for each sample to be tested.

[0046] For each sample to be tested, the number of second reads containing a predetermined number of consecutive target bases is determined based on the filtered raw sequencing data.

[0047] The percentage of consecutive bases is calculated based on the number of second reads and the total number of reads for each sample to be tested.

[0048] In some embodiments, quality control parameters include the proportion of adapter sequence reads. Quality control is performed on the raw sequencing data of each filtered sample to obtain clean sequencing data and quality control parameters for each sample, including:

[0049] The adapter sequences were removed from the filtered raw sequencing data of each test sample to obtain clean sequencing data for each test sample.

[0050] For each sample to be tested, the number of third reads containing adapter sequences is determined based on the filtered raw sequencing data;

[0051] The proportion of connector sequence reads is calculated based on the number of third reads and the total number of reads for each test sample.

[0052] In some embodiments, quality control parameters include the proportion of non-short sequences. Quality control is performed on the raw sequencing data of each filtered sample to obtain clean sequencing data and quality control parameters for each sample, including:

[0053] Based on the preset sequence length, the raw sequencing data of each test sample after filtering is short-sequenced to obtain clean sequencing data corresponding to each test sample.

[0054] For each sample to be tested, the number of fourth reads containing non-short sequences is determined based on the filtered raw sequencing data and the preset sequence length.

[0055] The proportion of non-short sequences is calculated based on the number of fourth reads and the total number of reads for each test sample.

[0056] To achieve the above objectives, a second aspect of this application provides a sample quality detection device, the device comprising:

[0057] The sequencing data processing unit is used to acquire the raw sequencing data of each sample to be tested in the sample set, filter out incomplete reads in the raw sequencing data of each sample to be tested, and perform quality control on the raw sequencing data of each sample to be tested after filtering, so as to obtain the clean sequencing data and quality control index parameters of each sample to be tested.

[0058] The data alignment unit is used to align the clean sequencing data of each sample to be tested with known genome data to obtain the sequence alignment data of each sample to be tested.

[0059] The variant detection unit is used to perform variant detection on each sample to be tested based on sequence alignment data, and obtain the variant detection parameters for each sample to be tested.

[0060] The contamination detection unit is used to perform contamination detection on each sample based on sequence alignment data and variant detection parameters, and to obtain the contamination detection parameters for each sample.

[0061] The quality inspection unit is used to perform quality inspection on each sample based on contamination detection parameters, variation detection parameters, sequence alignment data, and quality control index parameters.

[0062] To achieve the above objectives, a third aspect of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0063] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.

[0064] To achieve the above objectives, a fifth aspect of this application provides a computer program product comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the method described in the first aspect.

[0065] The sample quality detection method, apparatus, electronic device, and storage medium proposed in this application preprocess the raw sequencing data by filtering out incomplete reads. Clean sequencing data for each sample is obtained by quality control of the preprocessed raw sequencing data. The clean sequencing data is then compared with known genomic data to obtain sequence alignment data. Therefore, this application uses known genomic data as a reference genome. Compared to methods using control samples in related technologies, this application reduces alignment costs and can simultaneously complete the quality detection and evaluation of a large number of samples in a faster time. Furthermore, this application performs quality detection on the sample based on contamination detection parameters, variant detection parameters, sequence alignment parameters in the sequence alignment data, and quality control indicators. That is, this application performs quality detection on the sample through multiple stages and dimensions, thereby improving the accuracy and efficiency of quality detection. Attached Figure Description

[0066] The accompanying drawings are provided to further understand the technical solutions of this disclosure and constitute a part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.

[0067] Figure 1 This is a flowchart of the sample quality detection method provided in the embodiments of this application;

[0068] Figure 2 This is a schematic diagram of the unloading data provided in the embodiments of this application;

[0069] Figure 3 This is a schematic diagram of the quality information provided in the embodiments of this application;

[0070] Figure 4 This is a flowchart of an embodiment of determining clean sequencing data and quality parameters provided in this application.

[0071] Figure 5 Another flowchart of the embodiment for determining clean sequencing data and quality parameters provided in this application;

[0072] Figure 6 Another flowchart of the embodiment for determining clean sequencing data and quality parameters provided in this application;

[0073] Figure 7 yes Figure 1A flowchart of an embodiment of step S102;

[0074] Figure 8 yes Figure 1 Another embodiment of step S102 is shown in the flowchart.

[0075] Figure 9 yes Figure 1 Another embodiment of step S102 is shown in the flowchart.

[0076] Figure 10 yes Figure 1 A flowchart of an embodiment of step S103;

[0077] Figure 11 yes Figure 1 A flowchart of an embodiment of step S104;

[0078] Figure 12 yes Figure 1 Another embodiment of step S104 is shown in the flowchart.

[0079] Figure 13 yes Figure 1 A flowchart of an embodiment of step S105;

[0080] Figure 14 This is a schematic diagram of the continuous pollution scoring matrix provided in the embodiments of this application;

[0081] Figure 15 yes Figure 1 Another embodiment of step S105 is shown in the flowchart.

[0082] Figure 16 This is a flowchart of a specific embodiment of the sample quality detection method provided in this application.

[0083] Figure 17 This is a schematic diagram of the sample quality detection device provided in the embodiments of this application;

[0084] Figure 18 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0085] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.

[0086] Currently, in large-scale genomics studies and similar scenarios, the number of research samples is enormous, involving multiple data collection points and sample processing procedures. Therefore, sample quality control is particularly important. Samples may be affected by various factors such as temperature and humidity during collection, storage, and transportation. Furthermore, impurities may be introduced during DNA extraction, thus affecting subsequent sequencing and analysis results.

[0087] In related technologies, high-throughput sequencing of both the sample to be tested and control samples is used for quality control of the sample to be tested. However, this quality control method suffers from high testing costs. Furthermore, the methods in these technologies also suffer from low testing accuracy.

[0088] Based on this, embodiments of this application provide a sample quality detection method and apparatus, electronic device and storage medium, which can improve the accuracy and efficiency of the sample quality detection method.

[0089] The sample quality detection method provided in this application relates to the field of bioinformatics. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the sample quality detection method, but is not limited to the above forms.

[0090] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0091] The sample quality detection method provided in the embodiments of this application will be described below.

[0092] Reference Figure 1 In some embodiments, the sample quality detection method provided in this application includes, but is not limited to, steps S101 to S105.

[0093] Step S101: Obtain the raw sequencing data of each sample to be tested in the sample set, filter out incomplete reads in the raw sequencing data of each sample to be tested, and perform quality control on the raw sequencing data of each sample to be tested after filtering, so as to obtain the clean sequencing data and quality control index parameters of each sample to be tested.

[0094] Step S102: Align the clean sequencing data of each sample to be tested with known genomic data to obtain the sequence alignment data of each sample to be tested.

[0095] Step S103: Perform mutation detection on each sample to be tested based on sequence alignment data to obtain the mutation detection parameters for each sample to be tested.

[0096] Step S104: Perform contamination detection on each sample to be tested based on sequence alignment data and variant detection parameters to obtain contamination detection parameters for each sample to be tested.

[0097] Step S105: Perform quality testing on each sample to be tested based on contamination detection parameters, mutation detection parameters, sequence alignment data, and quality control index parameters.

[0098] Steps S101 to S105, as illustrated in this embodiment, preprocess the raw sequencing data by filtering out incomplete reads. Clean sequencing data for each sample is obtained by quality control of the preprocessed raw sequencing data. The clean sequencing data is then compared with known genomic data to obtain sequence alignment data. Therefore, this embodiment uses known genomic data as a reference genome. Compared to methods using control samples in related technologies, this embodiment reduces alignment costs and can complete quality testing of a large number of samples simultaneously and quickly. Furthermore, this embodiment performs quality testing on the sample based on contamination detection parameters, variant detection parameters, sequence alignment parameters in the sequence alignment data, and quality control indicators. That is, this embodiment performs quality testing on the sample through multiple stages and dimensions, thus improving the accuracy of quality testing.

[0099] In step S101 of some embodiments, the sample set may refer to a collection of samples to be tested, and the samples to be tested may refer to samples to be subjected to quality testing. Raw sequencing data may refer to the results obtained by sequencing the samples to be tested using next-generation sequencing technology. For example, raw test data may refer to the raw data output from the sequencer, which typically has a .fastq or .fq file extension. Sequencing can refer to the process of determining the sequence composition of biomolecules (such as DNA, RNA, or proteins) through experimental techniques and performing computational analysis based on the generated sequence data. Sequencing technologies can include first-generation sequencing, second-generation sequencing, and third-generation sequencing. First-generation sequencing has high accuracy but low throughput and is often used for small fragment sequencing. Second-generation sequencing technology has high throughput and low cost, supporting whole-genome sequencing and targeted sequencing. Third-generation sequencing technology directly reads long, continuous sequences and is suitable for analyzing complex genome structures.

[0100] like Figure 2 As shown, the original offline data includes the following:

[0101] The first line, starting with "@", is the unique identifier for this read segment.

[0102] The second line contains five letters: A, G, C, T, and N, which represent the base sequence of the corresponding read in the sequencer's data. A represents adenine, G represents guanine, C represents cytosine, T represents thymine, and N represents an unrecognized base.

[0103] The third line, starting with "+", is the remarks line.

[0104] The fourth row shows the pheed quality score (Q-value) of the sequencing reads. This Q-value describes the reliability of each sequencing base in the second row of sequencing data. The reliability can be represented by control symbols in the ASCII code table. Specifically, for each base in the second row, the pheed quality score (Q-value) can be calculated using the following formula 1.

[0105] Q = -10 * log 10 p (Formula 1)

[0106] Here, p represents the probability that an error will occur (i.e., a mis-sequencing) at the corresponding base position during sequencing. Thus, the quality information corresponding to the Q value can be expressed as follows: Figure 3 As shown. By Figure 3 It can be seen that when the Q value is equal to 10, it means that the base sequencing accuracy at the corresponding position is 90%. The Q value is added to a fixed value (such as 33 or 64), and the ASCII code corresponding to the sum is used as the character at the corresponding position in the fourth row.

[0107] Therefore, Figure 2The output data for two read segments is shown. It's understandable that, assuming complete data, the fourth line should contain the exact same number of characters as the second line. Therefore, an incomplete read segment can refer to a read segment with an incomplete number of lines (e.g., a read segment lacking the aforementioned four lines of information), or a situation where the number of characters in the second and fourth lines is inconsistent. Specifically, for any test sample S, a score w can be set. s Perform a segment integrity check. For example, the score w of the sample S to be tested can be calculated according to the following formula 2. s .

[0108]

[0109] in, l m This represents the row number of any read segment m in the sample S to be tested. If the row number of read segment m is 4, then... otherwise, akin, l m2 The number of characters in the second line of any segment m in the sample S to be tested is represented by l. m4 This represents the number of characters in the fourth line of any read segment m in the test sample S. If the number of characters in the second line of the data corresponding to read segment m is equal to the number of characters in the fourth line, then... otherwise, R represents the number of reads measured in the sample S to be tested. The specific value of R can be determined by counting the number of rows starting with the symbol "@" in the raw sequencing data. Therefore, the fraction w... s The value range of is [0,1]. Therefore, for the sample S to be tested, if the corresponding score w s A score of 1 indicates that the original sequencing data of the sample S is complete. If the corresponding score w... s A value less than 1 indicates the presence of incomplete reads in the raw sequencing data of the sample S. In this case, incomplete reads need to be filtered out. Specifically, reads with fewer than 4 rows in the raw sequencing data, and reads where the number of characters in the second and fourth rows are unequal, need to be removed. It's understandable that paired-end sequencing data requires filtering reads from both sequencing files simultaneously. The raw sequencing data filtered for incomplete reads is denoted as raw_data_1, and this raw_data_1 can be used as input data for subsequent analysis.

[0110] For each sample to be tested, quality control is performed on the raw sequencing data (raw_data_1). Quality control refers to the process of assessing and screening the raw sequencing data (raw_data_1). Quality control removes low-quality data to reduce its impact on subsequent analyses. Clean sequencing data refers to the sequencing data after removing low-quality data from the raw sequencing data (raw_data_1). Quality control parameters refer to relevant parameters that can be calculated during the quality control process.

[0111] Reference Figure 4 In some embodiments, the quality control parameters may include the percentage of consecutive bases. Quality control is performed on the raw sequencing data of each filtered sample to obtain clean sequencing data and quality control parameters for each sample. This process may include, but is not limited to, steps S401 to S403.

[0112] Step S401: For each sample to be tested, when it is determined that the filtered raw sequencing data contains a predetermined number of consecutive target bases, the predetermined number of consecutive target bases are removed from the filtered raw sequencing data to obtain clean sequencing data for each sample to be tested.

[0113] Step S402: For each sample to be tested, determine the number of second reads containing a predetermined number of consecutive target bases based on the filtered raw sequencing data.

[0114] Step S403: Calculate the percentage of consecutive bases based on the number of second reads and the total number of reads for each sample to be tested.

[0115] In step S401 of some embodiments, for each sample to be tested, the raw sequencing data raw_data_1 corresponding to the sample can be detected to determine whether a preset number of target bases appear consecutively in the raw sequencing data raw_data_1. When it is determined that the preset number of target bases appears in the raw sequencing data raw_data_1, the consecutive target bases are removed from the raw sequencing data raw_data_1. For example, assuming the target base is A and the preset number is N. threshold For example, for the sample S to be tested, remove all samples containing a consecutive A number of not less than N from the raw sequencing data raw_data_1 corresponding to the sample S. threshold The bases. It is understandable that the preset quantity N... threshold The specific value can be adaptively set according to actual needs, and this application embodiment does not impose specific limitations on it. For example, under normal circumstances, the preset quantity N threshold The value range is 8 to 10. When the quality of the raw sequencing data raw_data_1 is high, a preset number N can be set. thresholdThe value is 10. When the quality of the raw sequencing data (raw_data_1) is low, a preset number N can be set. threshold The value is 8, to more strictly remove possible erroneous sequences.

[0116] It is understandable that step S401 can be used to detect and remove the content of PolyA (or PolyG, PolyT) in the raw sequencing data raw_data_1, thereby obtaining clean sequencing data for each sample to be tested.

[0117] In step S402 of some embodiments, for each test sample, the number of consecutive target bases in the raw sequencing data raw_data_1 corresponding to the test sample is counted to obtain the second read count. The second read count can refer to the total number of reads in the test sample that contain consecutive target bases. For example, the second read count can refer to the total number of reads containing PolyA (or PolyG, PolyT).

[0118] In step S403 of some embodiments, for each sample to be tested, the percentage of consecutive bases p poly It can refer to the ratio of the number of the second reading segment to the total number of reading segments corresponding to the sample being tested.

[0119] The benefit of steps S401 to S403 is that, in next-generation sequencing, long repetitive sequences are prone to sequencing errors or corresponding sample contamination. Therefore, by calculating the proportion of consecutive bases p... poly It can quantify the degree of sample contamination.

[0120] Reference Figure 5 In other embodiments, the quality control parameters may include the proportion of adapter sequence reads. Quality control is performed on the raw sequencing data of each filtered sample to obtain clean sequencing data and quality control parameters for each sample. This process may include, but is not limited to, steps S501 to S503.

[0121] Step S501: Remove adapter sequences from the filtered raw sequencing data of each sample to be tested to obtain clean sequencing data corresponding to each sample to be tested.

[0122] Step S502: For each sample to be tested, determine the number of third reads containing adapter sequences based on the filtered raw sequencing data.

[0123] Step S503: Calculate the proportion of connector sequence reads based on the number of third reads and the total number of reads for each sample to be tested.

[0124] In step S501 of some embodiments, for each test sample, the adapter content of the raw sequencing data raw_data_1 corresponding to the test sample can be detected based on the first n bases of the predefined adapter sequence to identify adapter remnants in the raw sequencing data raw_data_1. The adapter sequences in the raw sequencing data raw_data_1 are then removed to obtain the corresponding clean sequencing data. For example, adapter sequence removal can be performed using tools such as fastp (fastp can quickly remove adapter sequences and supports multi-threading; fastp is suitable for large-scale data), cutadapt (cutadapt can flexibly configure aptamer sequences and supports trimming of overlapping regions, suitable for complex experimental designs), Trimmomatic (Trimmomatic supports low-complexity filtering and end trimming), and BBmap (BBmap is based on Bowtie's mapping algorithm and detects adapter remnants through alignment, suitable for high-precision requirements). It is understood that the specific value of n can be adaptively set according to actual needs, and this embodiment of the application does not specifically limit this.

[0125] In step S502 of some embodiments, for each test sample, the third number of reads may refer to the total number of reads containing the connector sequence in the test sample.

[0126] In step S503 of some embodiments, for each sample to be tested, the proportion of adapter sequence reads p adapter It can refer to the ratio of the number of third reading segments to the total number of reading segments corresponding to the test sample.

[0127] The benefit of steps S501 to S503 is that removing the adapter sequence increases the proportion of effective reads and reduces noise interference. This reduces subsequent false counts caused by adapters mapping to the reference genome. Furthermore, the proportion of adapter sequence reads (p)... adapter It can reflect the proportion of adapter residues in the raw sequencing data raw_data_1.

[0128] Reference Figure 6 In other embodiments, the quality control parameters may include the proportion of non-short sequences. Quality control is performed on the raw sequencing data of each filtered sample to obtain clean sequencing data and quality control parameters for each sample. This process may include, but is not limited to, steps S601 to S603.

[0129] Step S601: Short sequences are removed from the filtered raw sequencing data of each sample to be tested according to the preset sequence length to obtain clean sequencing data corresponding to each sample to be tested.

[0130] Step S602: For each sample to be tested, determine the number of fourth reads containing non-short sequences based on the filtered raw sequencing data and the preset sequence length.

[0131] Step S603: Calculate the proportion of non-short sequences based on the number of fourth reads and the total number of reads for each test sample.

[0132] In step S601 of some embodiments, for each sample to be tested, short sequence removal may refer to removing sequences shorter than a preset sequence length from the corresponding raw sequencing data raw_data_1. min The read segment. In this way, clean sequencing data for the corresponding sample can be obtained. It is understandable that the preset sequence length l min The specific value can be set adaptively according to actual needs, and this application embodiment does not impose specific limitations on it.

[0133] In step S602 of some embodiments, for each test sample, the fourth read count may refer to the presence of a non-short sequence (i.e., a length equal to or greater than a preset sequence length l) in the test sample. min The total number of reading segments.

[0134] In step S603 of some embodiments, for each test sample, the proportion of non-short sequences p s It can refer to the ratio of the number of fourth reading segments to the total number of reading segments corresponding to the test sample.

[0135] The benefit of steps S601 to S603 is that short sequences may be random error products during the sequencing process, therefore, removing short sequences can improve the quality of sequencing data. Furthermore, by controlling the proportion of non-short sequences (p...) s It can reflect the proportion of valid reads in the raw sequencing data (raw_data_1) and demonstrate the cleanliness of the raw sequencing data (raw_data_1).

[0136] In step S102 of some embodiments, clean sequencing data can be denoted as clean_data. Known genome data can refer to genome sequences that have been extensively studied, validated, and publicly published. For example, known human genome data can refer to genome hg38 (GRCh38) or genome hg19 (GRCh37). The known genome data is used as a reference genome. For each sample to be tested, the corresponding clean sequencing data (clean_data) is aligned to the known genome data to obtain the corresponding sequence alignment data. Sequence alignment data can refer to a file including sequence alignment parameters, such as a BAM file.

[0137] Reference Figure 7In some embodiments, the sequence alignment data includes the alignment rate, that is, the sequence alignment parameters include the alignment rate. Step S102 may include, but is not limited to, steps S701 to S702.

[0138] Step S701: Compare the clean sequencing data of each sample to be tested with the known genome data to obtain the number of first reads that are successfully matched with the known genome data in the clean sequencing data.

[0139] Step S702: Calculate the comparison rate based on the number of the first read segment and the total number of read segments for each test sample.

[0140] In step S701 of some embodiments, for each sample to be tested, the corresponding clean sequencing data (clean_data) is compared with known genomic data to determine the position of each sequence fragment in the clean sequencing data (clean_data) on the known genomic data. For each sample to be tested, the first read count can refer to the number of reads in the clean sequencing data (clean_data) corresponding to that sample that have been successfully aligned with the known genomic data.

[0141] In step S702 of some embodiments, for each test sample, the total number of reads can refer to the total number of reads contained in the test sample, and the first number of reads can be obtained from the clean sequencing data clean_data corresponding to the test sample. The alignment rate Ms can refer to the proportion of reads in the test sample that have been successfully aligned to known genomic data out of the total number of reads. Therefore, the alignment rate Ms can be calculated from the first number of reads and the total number of reads.

[0142] The advantage of steps S701 to S702 is that a high alignment rate indicates high-quality clean sequencing data (clean_data) for the sample to be tested, meaning most reads in the sample can be correctly mapped to the reference genome, making the sample suitable for subsequent analysis. A low alignment rate indicates potential contamination of the sample, incomplete reference genome, or sequencing errors. Furthermore, this embodiment uses known genomic data as a reference genome, which reduces sample testing costs compared to methods using control samples in related technologies.

[0143] Reference Figure 8 In some embodiments, the sequence alignment data includes the repetition rate, that is, the sequence alignment parameters include the repetition rate. Step S102 may include, but is not limited to, steps S801 to S802.

[0144] Step S801: Compare the clean sequencing data of each sample to be tested with the known genome data to obtain the number of repeat reads of each sample to be tested, and the number of second reads in the clean sequencing data that are successfully matched with the known genome data.

[0145] Step S802: Calculate the repetition rate based on the number of repeated read segments and the number of second read segments.

[0146] In step S801 of some embodiments, for each test sample, the corresponding clean sequencing data (clean_data) is compared with known genomic data to determine the position of each sequence fragment in the clean sequencing data (clean_data) on the known genomic data. For each test sample, the number of duplicate reads can refer to the number of reads identified as duplicates (e.g., multiple mappings to the same position, or duplicate fragments from the same PCR amplification fragment) during the comparison with the known genomic data. For each test sample, the number of second reads can refer to the number of reads in the clean sequencing data (clean_data) corresponding to that test sample that were successfully aligned to the known genomic data.

[0147] In step S802 of some embodiments, the repetition rate Du s This can refer to the proportion of repetitive fragments in the net sequencing data (clean_data) of the sample being tested. Therefore, the repetition rate (Du) s It can be calculated based on the number of repeated read segments and the number of second read segments.

[0148] The benefit of steps S801 to S802 is that a low repetition rate indicates high diversity and more comprehensive coverage of the sequencing library. Based on this, it suggests that the corresponding sample is suitable for subsequent variant detection, etc.

[0149] Reference Figure 9 In some embodiments, the sequence alignment data includes sequencing depth, i.e., the sequence alignment parameters include sequencing depth. Step S102 may include, but is not limited to, steps S901 to S902.

[0150] Step S901: Align the clean sequencing data of each sample with known genomic data to obtain the total number of aligned bases of each sample with known genomic data.

[0151] Step S902: Calculate the sequencing depth based on the total number of paired bases and the effective length of the known genome data.

[0152] In step S901 of some embodiments, for each sample to be tested, the corresponding clean sequencing data (clean_data) is compared with known genomic data to determine the position of each sequence fragment in the clean sequencing data (clean_data) on the known genomic data. For each sample to be tested, the total number of aligned bases can refer to the total number of bases in all sequencing reads in the clean sequencing data (clean_data) corresponding to that sample. The total number of aligned bases can be calculated based on the total number of reads in the sample and the length of each read.

[0153] In step S902 of some embodiments, the effective length of the known genome data can refer to the total length of the known genome data (in base pairs, bp). Based on the total number of base pairs corresponding to each test sample and the effective length of the known genome data, the sequencing depth De corresponding to that test sample can be calculated. s .

[0154] The advantage of steps S901 to S902 is that sequencing depth can reflect the number of times each base in the sample is randomly covered. Higher sequencing depth indicates more coverage times, and a greater probability of detecting lower abundance contaminant sequences.

[0155] In step S103 of some embodiments, for each test sample, variant detection is performed based on the sequence alignment data corresponding to that test sample. Variance detection can refer to the process of identifying all potential variant sites in the genome based on sequence alignment data (such as BAM files). Variance detection parameters corresponding to each test sample can be obtained based on the variant detection.

[0156] Reference Figure 10 In some embodiments, the mutation detection parameters include a first ratio and / or a second ratio. Step S103 may include, but is not limited to, steps S1001 and S1002.

[0157] Step S1001: Perform mutation detection on each sample to be tested based on sequence alignment data to obtain the number of heterozygous sites and the total number of detected sites in each sample to be tested, and calculate the first ratio based on the number of heterozygous sites and the total number of detected sites.

[0158] Step S1002: Perform mutation detection on each sample to be tested based on sequence alignment data to obtain the number of base transitions and the number of base transversions in each sample to be tested, and calculate the second ratio based on the number of base transitions and the number of base transversions.

[0159] In step S1001 of some embodiments, for each sample to be tested, the number of heterozygous sites can refer to the total number of heterozygous sites in that sample. A heterozygous site can refer to a site at a specific location in the genome where two different alleles exist. For example, if a site is A / A in known genomic data but A / T in the clean sequencing data of the sample to be tested, then that site is a heterozygous site. The total number of detected sites can refer to the total number of all detected sites in the clean sequencing data of the sample to be tested. The number of heterozygous sites and the total number of detected sites can be obtained from sequence alignment data. The first ratio can refer to the heterozygous site ratio He. s Hemizygosity s It can be used to represent the proportion of heterozygous sites to the total number of detected sites.

[0160] In step S1002 of some embodiments, for each test sample, the number of base transitions can refer to the total number of bases that have undergone transitions in the test sample, and the number of base transversions can refer to the total number of bases that have undergone transversions in the test sample. Transitions and transversions are results obtained by aligning the test sample with known genomic data. A transition can refer to a substitution within the same base category, for example, the test sample is A, and the base aligned in the known genomic data is G. Or, the test sample is C, and the base aligned in the known genomic data is T. A transversion can refer to a substitution between different base categories, for example, the test sample is A, and the base aligned in the known genomic data is T. Or, the test sample is C, and the base aligned in the known genomic data is G. The number of base transitions and the number of base transversions can be obtained from sequence alignment data. The second ratio can refer to the transition to transversion ratio TT. s Conversion and Transformation Ratio TT s = Number of base transitions / Number of base transversions, the ratio of transitions to transversions TT s It can be used to measure the frequency relationships between different types of mutations.

[0161] The advantage of steps S1001 to S1002 is that the first and second proportions are important indicators in genomic analysis, and abnormalities in the first and second proportions can reflect the specificity of mutation mechanisms, environmental exposures, sample quality, or biological processes.

[0162] In step S104 of some embodiments, contamination detection may refer to a preliminary judgment of the contamination status of the sample to be tested, in order to determine whether there is a sample to be tested that is suspected of being contaminated. Contamination detection parameters may refer to detection parameters calculated during the contamination detection process.

[0163] Reference Figure 11In some embodiments, the pollution detection parameters include external pollution detection parameters. Step S104 may include, but is not limited to, steps S1101 to S1103.

[0164] Step S1101: Compare the sequence alignment data and variant detection parameters corresponding to each sample to be tested with the preset parameter threshold, and determine the first contamination detection result of each sample to be tested based on the comparison result.

[0165] Step S1102: When it is determined from the first contamination detection result that the sample set includes multiple suspected contaminated samples to be tested, determine the number of first sequencing fragments of the contaminant species in each sample to be tested.

[0166] Step S1103: Calculate the exogenous pollution detection parameters for each sample based on the number of first sequencing fragments corresponding to each sample, the total number of sequencing fragments for each sample, and the preset weights of pollutant species.

[0167] In step S1101 of some embodiments, different preset parameter thresholds can be set for the sequence alignment parameters and variant detection parameters corresponding to the sequence alignment data. For each sample to be tested, the sequence alignment parameters (including alignment rate, repetition rate, and sequencing depth) and variant detection parameters (including a first ratio and a second ratio, i.e., the ratio of heterozygous sites and the ratio of transitions and transversions) corresponding to the sample to be tested can be compared with the corresponding preset parameter thresholds to obtain the first contamination detection result of the sample to be tested. The first contamination result can represent the result obtained by performing preliminary contamination detection on the corresponding sample to be tested, that is, the first contamination result can indicate whether the corresponding sample to be tested is a suspected contaminated sample to be tested.

[0168] Specifically, the first pollution detection result can be determined by the following method:

[0169] When the comparison rate is less than the comparison threshold (i.e., the preset parameter threshold includes the comparison threshold, which can be set to 90%), the corresponding test sample is determined to be a suspected contaminated test sample.

[0170] When the proportion of heterozygous sites is greater than the first proportion threshold (i.e., the preset parameter threshold includes the first proportion threshold, which can be set to 1%), the corresponding test sample is determined to be a suspected contaminated test sample.

[0171] When the conversion to transversion ratio is greater than the second ratio threshold (i.e., the preset parameter threshold includes the second ratio threshold, which can be set to 2.4), the corresponding test sample is determined to be a suspected contaminated test sample.

[0172] It is understood that the above-mentioned preset parameter thresholds can be set adaptively according to actual needs, and this application embodiment does not specifically limit them.

[0173] In step S1102 of some embodiments, a suspected contamination list can be constructed. This list is used to count the test samples for which the first contamination detection result indicates suspected contamination. When the suspected contamination list includes multiple test samples, i.e., when multiple suspected contamination test samples exist in the sample set, the number of first sequencing fragments for each test sample (suspected contamination test sample or non-suspected contamination test sample) in the sample set is determined. For each test sample, the number of first sequencing fragments can refer to the number of sequencing fragments of the contaminant species in that test sample. The contaminant species can refer to species in the test sample that are not the target analytical object; contaminant species can interfere with or mislead the detection results.

[0174] In step S1103 of some embodiments, for each sample to be tested, the exogenous pollution detection parameter CI of the sample to be tested can be calculated based on the number of first sequencing fragments corresponding to the sample to be tested, the total number of sequencing fragments, the preset weights of pollutant species, and Formula 3.

[0175] CI=∑(N j / N t *W j ) (Formula 3)

[0176] Where, N j N represents the number of the first sequencing fragments of pollutant species j. t W represents the total number of sequencing fragments in the sample to be tested. j This represents the preset weight of contaminant species j. The preset weight can be set according to the degree of influence of the contaminant species on the sample to be tested. For example, a higher weight can be set for common contaminant species. This embodiment of the application does not specifically limit this. Specifically, for contaminant species that are known to seriously interfere with the detection results of the sample to be tested (such as certain microorganisms that can produce a large amount of enzymes that affect subsequent molecular experiments, species whose gene sequences are highly similar to those of non-contaminant species and are prone to misjudgment), a higher preset weight is given, and the value range can be [0.5, 1]. For common contaminant species, the preset weight value range can be [0.2, 0.5]. For rare contaminant species that have a small impact on the analysis, the preset weight value range can be [0.05, 0.2].

[0177] It is understandable that when the external pollution detection parameter CI is greater than the preset threshold (e.g., 0.005), the corresponding sample to be tested is determined to be a suspected contaminated sample.

[0178] The advantage of steps S1101 to S1103 is that it can determine whether there is exogenous contamination in the sample to be tested. Exogenous contamination can refer to the accidental introduction of substances from non-target sources into the sample to be tested.

[0179] Reference Figure 12In some embodiments, the contamination detection parameters may also include the cross-contamination probability. Step S104 may also include steps S1201 to S1203.

[0180] Step S1201: Determine the single nucleotide polymorphism sites for each sample to be tested based on sequence alignment data;

[0181] Step S1202: For each sample to be tested, calculate the first likelihood under the contamination assumption and the second likelihood under the no-contamination assumption based on the genotype frequency and genotype likelihood of each corresponding single nucleotide polymorphism site.

[0182] Step S1203: Calculate the cross-contamination probability of each test sample based on the first likelihood, second likelihood, and prior contamination probability corresponding to each test sample.

[0183] In step S1201 of some embodiments, for each test sample, a single nucleotide polymorphism (SNP) site refers to a site in the test sample where a single base position is mutated (such as the transition or transversion described above). SNP sites can be determined from a BAM file.

[0184] In step S1202 of some embodiments, genotype frequency can refer to the proportion of a specific genotype (such as AA, AB, BB, etc.) in a population or sample. Genotype likelihood can refer to the probability of observing current experimental data (such as sequencing results or genotype frequencies) of the test sample under given genotypes (such as AA, AB, BB, etc.) and hypothetical conditions (such as no contamination or contamination). The first likelihood P(D|H1) can be calculated according to the following formula 4, and the second likelihood P(D|H0) can be calculated according to the following formula 5. The first likelihood P(D|H1) represents the likelihood under the contamination hypothesis (H1), and the second likelihood P(D|H0) represents the likelihood under the no-contamination hypothesis (H0).

[0185] P(D|H1)=∏ i [(1-θ)(P AAi F AAi +P BBi F BBi +P ABi F′ ABi )+θ(P AAi F′ AAi +

[0186] P BBi F′ BBi +P ABi )] (Formula 4)

[0187] P(D|H0)=∏(P AAi F AAi +P BBi F BBi +P ABi F ABi ) (Formula 5)

[0188] For each single nucleotide polymorphism site i, P AAi P represents the genotype likelihood of genotype AA. BBi P represents the genotype likelihood of genotype BB. ABi This represents the genotype likelihood of genotype AB. F AAi F represents the genotype frequency of genotype AA in the reference population. BBi F represents the genotype frequency of genotype BB in the reference population. ABi This represents the genotype frequency of genotype AB in the reference population. F′ AAi F′ represents the genotype frequency of genotype AA in the sample to be tested. BBi F′ represents the genotype frequency of genotype BB in the sample to be tested. ABi This represents the genotype frequency of genotype AB in the sample being tested. θ represents the contamination percentage, which can range from [0.05, 0.1]. D represents the observed data.

[0189] In step S1203 of some embodiments, for each sample to be tested, the cross-contamination probability P(H1|D) of the sample to be tested can be calculated according to the first likelihood P(D|H1), the second likelihood P(D|H0) corresponding to the sample to be tested, and the following formulas 6 and 7.

[0190]

[0191] P(D)=P(D|H0)P(H0)+P(D|H1)P(H1) (Formula 7)

[0192] Wherein, P(H1) represents the prior contamination probability, indicating the confidence level that the test sample is contaminated by default. The value range of the prior contamination probability P(H1) can be [0.05, 0.1]. Correspondingly, the value range of P(H0) can be [0.9, 0.95], and P(H0) represents the confidence level that the test sample is not contaminated by default.

[0193] The advantage of steps S1201 to S1203 is that it can determine whether cross-contamination exists in the test samples. For example, when the cross-contamination probability P(H1|D) is greater than the contamination threshold (e.g., set to 0.05), the corresponding test sample is determined to have cross-contamination. Cross-contamination can refer to the mixing of DNA (or RNA) between different test samples during the experiment.

[0194] In step S105 of some embodiments, for each sample to be tested, the sample to be tested can be quality tested according to the contamination detection parameters, mutation detection parameters, sequence alignment parameters obtained from sequence alignment data and quality control index parameters corresponding to the sample to be tested, that is, to determine whether the sample to be tested is contaminated.

[0195] Reference Figure 13 In some embodiments, step S105 may include, but is not limited to, steps S1301 to S1303.

[0196] Step S1301: Calculate the quality score of each sample based on the pollution detection parameters, variation detection parameters, sequence alignment data, and quality control index parameters corresponding to each sample to be tested.

[0197] Step S1302: Sort the multiple test samples according to the quality score;

[0198] Step S1303: Based on the sorting results, determine the contaminated test sample from multiple test samples.

[0199] In step S1301 of some embodiments, the parameters corresponding to any test sample S in the sample set can be constructed as follows: Figure 14 The diagram shows a continuous pollution scoring matrix. For each sample to be tested, the mean, sum, and other calculations are performed on the specific values ​​of each parameter in the matrix to obtain the quality score of the sample.

[0200] In steps S1302 and S1303 of some embodiments, the samples can be sorted according to the quality scores of all samples to be tested in the sample set to obtain a comprehensive detection ranking for each sample. The sorting can be in descending order, so that samples with higher rankings are more likely to have higher contamination levels. Depending on actual needs, a preset number of samples with higher rankings can be removed, thereby completing the detection and screening of sample contamination. It is understood that the preset number can be adaptively set according to actual needs, and this application does not specifically limit this.

[0201] Reference Figure 15 In some other embodiments, step S105 may include, but is not limited to, steps S1501 to S1502.

[0202] Step S1501: Based on the contamination detection parameters, mutation detection parameters, sequence alignment data, and quality control index parameters corresponding to each sample to be tested, compare them with the preset index thresholds corresponding to each parameter to encode the contamination detection for each sample to be tested.

[0203] Step S1502: Based on the contamination detection code, determine the contaminated sample from multiple samples to be tested.

[0204] In step S1501 of some embodiments, referring to Figure 14 , can be Figure 14 Each parameter (contamination detection parameter, mutation detection parameter, sequence alignment data, and quality control index parameter) is set with a preset index threshold. The contamination detection code of the sample to be tested can be determined based on the comparison result between the parameter and the corresponding preset index threshold. That is, the specific value of each parameter is converted into a code form such as 0 or 1 through the preset index threshold.

[0205] For example, if the alignment rate is less than 90%, the value is 1; otherwise, it is 0. If the proportion of heterozygous sites is greater than 1%, the value is 1; otherwise, it is 0. If the ratio of transformation to transversion is greater than 2.4, the value is 1; otherwise, it is 0. It is understood that the preset index thresholds can be adaptively set according to actual needs, and this application embodiment does not specifically limit them.

[0206] In step S1502 of some embodiments, step S1501 can convert the parameters into a string code consisting of 0s and 1s. The contamination detection codes corresponding to the samples to be tested are classified (e.g., based on the number of "0"s and "1"s in the contamination detection codes). The classification results and expert knowledge can be used to determine whether the sample to be tested is a contaminated sample. For example, a sample with all 0s can be designated as an uncontaminated sample, and a sample with all 1s as a contaminated sample, or the presence of even one "1" code can be considered a contaminated sample. This embodiment of the application does not specifically limit the scope of this method.

[0207] The sample quality detection method provided in this application reduces detection costs by using publicly available genomic data known at the population level to detect contamination in test samples, and can simultaneously complete the contamination detection of large-scale samples in a relatively short time. In next-generation sequencing, sample contamination is one of the key factors leading to data bias. This application, through multi-dimensional analysis of sequencing data, can accurately identify test samples contaminated by exogenous DNA (such as microbial DNA, DNA from other species, etc.) or cross-contamination. This reduces the interference of contaminated samples on subsequent data analysis, ensuring that the sequencing data used for subsequent analysis is pure and reliable, thus improving the accuracy and reliability of the sequencing data. Furthermore, this application helps maintain data consistency in large-scale sequencing projects. Whether it's sample collection from different batches or collaborative research involving multiple subjects, a unified quality control standard based on sequencing data alignment and variant detection ensures that the sample quality entering the analysis process is at the same high level. This results in better stability and reproducibility of subsequent data analysis results, reducing fluctuations in results caused by sample differences.

[0208] Reference Figure 16 In a specific embodiment, large-scale population genomics studies involve a vast number of samples and multiple data collection points and sample processing procedures; therefore, sample quality control is crucial. Samples may be affected by various factors (such as temperature and humidity) during collection, storage, and transportation. Furthermore, impurities may be introduced during DNA extraction, impacting subsequent sequencing and analysis results.

[0209] Based on this, this application provides a sample quality detection method, which is a multi-dimensional sample detection method to ensure accurate data for subsequent analysis and interpretation. The method specifically includes the following steps:

[0210] Step S1601: Preprocess the raw sequencing data of the sample to be tested.

[0211] In this embodiment, the raw sequencing data corresponding to the sample to be tested can be labeled as raw_data_0. R can be calculated according to the relevant parameter calculation formula in Formula 2. int =97,650, Rc=97,550. In the raw sequencing data raw_data_0, reads with incomplete line counts and inconsistent character counts between the second and fourth lines were removed, and the remaining raw sequencing data was labeled raw_data_1. The raw sequencing data raw_data_1 contains 95,400 reads. The raw sequencing data labeled raw_data_1 can be used as input data for subsequent analysis.

[0212] Understandably, during the process of removing incomplete reads from the raw sequencing data raw_data_0, the score w of the sample to be tested can be calculated according to Formula 2. s .

[0213] Step S1602: Perform quality control on the raw sequencing data to obtain clean sequencing data for each sample to be tested.

[0214] In this embodiment, for each sample's raw sequencing data (raw_data_1), FastP is selected for PolyA removal, and BBmap is selected for PolyT removal. The percentage of consecutive bases can be calculated according to the methods described in steps S401 to S403.

[0215] Secondly, adapter content detection and removal can be performed. For each sample to be tested, FASTP is used to remove adapter sequences from the raw sequencing data (raw_data_1). The proportion of adapter sequence reads can be calculated according to the methods described in steps S501 to S503.

[0216] Finally, short sequence removal can be performed. A minimum sequence length of l is set. min =15. For each sample to be tested, remove all data in the raw sequencing data raw_data_1 with a length shorter than l. min The proportion of non-short sequences can be calculated based on the methods described in steps S601 to S603.

[0217] Based on the three removal methods mentioned above, the quality control of the raw sequencing data raw_data_1 of the sample to be tested can be achieved, and clean sequencing data clean_data of the sample to be tested can be obtained.

[0218] Step S1603: Align the clean sequencing data of each sample to be tested with known genomic data to obtain sequence alignment parameters.

[0219] In this embodiment, for each sample to be tested, the clean sequencing data (clean_data) of that sample is aligned to known genomic data (e.g., aligned to the hg38 reference genome). After alignment, samtools sort (samtools sort refers to arranging according to the order of the reference genome to obtain an ordered BAM file) is used for sorting, picard (picard is a genome analysis toolkit used to process BAM format files and perform basic data conversion, quality control, and analysis tasks) is used for marking repetitive sequences, and GATK (GATK is a genome analysis toolkit) is used for local realignment and base quality recorrection (BQSR). Finally, the BAM file for each sample to be tested is obtained. Statistical analysis based on the BAM file yields sequence alignment parameters, including the alignment rate M. s , repetition rate Du s and sequencing depth De s .

[0220] Step S1604: Perform mutation detection on the sample to be tested to obtain mutation detection parameters.

[0221] In this embodiment, for each sample to be tested, based on the BAM file obtained in step S1603, the vcf file of the sample is obtained using GATK HaplotypeCaller (GATK HaplotypeCaller is used to detect SNPs and small insertions / deletions and generate candidate variant sites). The vcf file can contain a list of variant sites. Statistical analysis is performed on the vcf file to obtain variant detection parameters, which may include the proportion of heterozygous sites (He). s Conversion and Transversion Ratio TT s .

[0222] Step S1605: Detect exogenous contamination in the sample to be tested based on the mutation detection parameters and sequence alignment parameters.

[0223] In this embodiment, the presence of exogenous contamination in the sample is determined based on variant detection parameters and sequence alignment parameters. The determination criteria are as follows:

[0224] When the comparison rate is less than the comparison threshold (which can be set to 90%), the corresponding test sample is determined to be a suspected contaminated test sample.

[0225] When the proportion of heterozygous sites is greater than the first proportion threshold (the first proportion threshold can be set to 1%), the corresponding test sample is determined to be a suspected contaminated test sample.

[0226] When the conversion to transversion ratio is greater than the second ratio threshold (the second ratio threshold can be set to 2.4), the corresponding test sample is determined to be a suspected contaminated test sample.

[0227] A suspected contamination list can be constructed, which is used to count the samples to be tested whose first contamination detection result indicates suspected contamination. When multiple samples are counted in the suspected contamination list, the comprehensive contamination index (CI) of each sample can be calculated according to Formula 3. If the CI exceeds a set threshold (set to 0.005 in this embodiment), the corresponding sample is determined to have exogenous contamination and is removed from the list.

[0228] Step S1606: Perform cross-contamination detection on the sample to be tested.

[0229] In this embodiment, based on the BAM file obtained in step S1603, the cross-contamination degree (i.e., cross-contamination probability P(H1|D)) of the test sample is calculated. This embodiment uses a Bayesian statistical method to calculate the cross-contamination degree, obtaining the cross-contamination degree for each test sample. If the cross-contamination degree is greater than 0.05, the test sample is considered to have cross-contamination and is removed.

[0230] Step S1607: Perform quality testing on each sample to be tested based on contamination detection parameters, variation detection parameters, sequence alignment data, and quality control index parameters.

[0231] In this embodiment of the application, the parameters calculated based on the above steps are constructed as follows: Figure 14 The diagram shows a continuous contamination scoring matrix. For each sample, the average value of all parameters in the scoring matrix is ​​taken to obtain a comprehensive score T_score. Based on the comprehensive score T_score, all samples are sorted in descending order to obtain a comprehensive ranking for each sample. The top 1% of samples in the ranking are removed, completing the sample contamination screening.

[0232] Understandably, in some embodiments, the numerical values ​​corresponding to all parameters can be further converted into contamination detection codes. The contamination detection codes corresponding to all test samples are then classified, and based on the classification results and biological background knowledge, it is determined whether the test samples need to be removed.

[0233] It is understood that, depending on actual needs, machine learning algorithms can also be used for quality control and filtering of high-throughput sequencing data, using models to identify and remove possible sequencing errors or noise. Alternatively, machine learning algorithms can be combined with the methods described above for judgment, etc., which are not specifically limited in the embodiments of this application. In addition, other quality control indicators can be set to more comprehensively and accurately detect the quality of the samples to be tested.

[0234] Reference Figure 17 This application also provides a sample quality detection device, which includes:

[0235] The sequencing data processing unit 1701 is used to acquire the raw sequencing data of each sample to be tested in the sample set, filter out incomplete reads in the raw sequencing data of each sample to be tested, and perform quality control on the raw sequencing data of each sample to be tested after filtering, so as to obtain the clean sequencing data and quality control index parameters of each sample to be tested.

[0236] The data alignment unit 1702 is used to align the clean sequencing data of each sample to be tested with known genome data to obtain the sequence alignment data of each sample to be tested.

[0237] The variant detection unit 1703 is used to perform variant detection on each sample to be tested based on sequence alignment data, and obtain the variant detection parameters for each sample to be tested.

[0238] The contamination detection unit 1704 is used to perform contamination detection on each sample to be tested based on sequence alignment data and variant detection parameters, and to obtain the contamination detection parameters for each sample to be tested.

[0239] The quality inspection unit 1705 is used to perform quality inspection on each sample to be tested based on contamination detection parameters, variation detection parameters, sequence alignment data, and quality control index parameters.

[0240] It is evident that the content of the above-described sample quality detection method embodiments is applicable to the embodiments of this sample quality detection device. The specific functions implemented by this sample quality detection device embodiment are the same as those of the above-described sample quality detection method embodiments, and the beneficial effects achieved are also the same as those achieved by the above-described sample quality detection method embodiments.

[0241] Reference Figure 18 , Figure 18 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0242] The processor 1801 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0243] The memory 1802 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1802 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1802 and is called and executed by the processor 1801 to execute the sample quality detection method of the embodiments of this application.

[0244] The input / output interface 1803 is used to implement information input and output;

[0245] The communication interface 1804 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0246] Bus 1805 transmits information between various components of the device (e.g., processor 1801, memory 1802, input / output interface 1803, and communication interface 1804);

[0247] The processor 1801, memory 1802, input / output interface 1803 and communication interface 1804 are connected to each other within the device via bus 1805.

[0248] This application also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the sample quality detection method described above.

[0249] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described sample quality detection method.

[0250] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0251] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0252] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0253] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0254] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0255] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0256] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0257] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0258] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0259] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0260] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0261] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A sample quality detection method, characterized in that, The method includes: The raw sequencing data of each sample to be tested in the sample set is obtained, the incomplete reads in the raw sequencing data of each sample to be tested are filtered, and the raw sequencing data of each sample to be tested after filtering is quality controlled to obtain the clean sequencing data and quality control index parameters of each sample to be tested. The clean sequencing data of each sample to be tested is compared with known genome data to obtain the sequence alignment data of each sample to be tested. Based on the sequence alignment data, mutation detection is performed on each sample to be tested to obtain the mutation detection parameters for each sample to be tested. Contamination detection is performed on each sample to be tested based on the sequence alignment data and the variant detection parameters to obtain the contamination detection parameters for each sample to be tested. The quality of each sample to be tested is determined based on the pollution detection parameters, the mutation detection parameters, the sequence alignment data, and the quality control index parameters.

2. The method according to claim 1, characterized in that, The pollution detection parameters include external pollution detection parameters; The step of performing contamination detection on each sample to be tested based on the sequence alignment data and the variant detection parameters to obtain contamination detection parameters includes: The sequence alignment data and the mutation detection parameters corresponding to each sample to be tested are compared with a preset parameter threshold, and the first contamination detection result of each sample to be tested is determined based on the comparison result. When it is determined from the first pollution detection result that the sample set includes multiple suspected pollutant samples to be tested, the number of first sequencing fragments of the pollutant species in each sample to be tested is determined. The exogenous pollution detection parameters for each sample to be tested are calculated based on the number of the first sequencing fragments corresponding to each sample to be tested, the total number of sequencing fragments for each sample to be tested, and the preset weight of the pollutant species.

3. The method according to claim 2, characterized in that, The pollution detection parameters also include the probability of cross-contamination; The step of performing contamination detection on each sample to be tested based on the sequence alignment data and the variant detection parameters to obtain contamination detection parameters further includes: The single nucleotide polymorphism sites of each sample to be tested are determined based on the sequence alignment data. For each sample to be tested, a first likelihood under the contamination assumption is calculated based on the genotype frequency and genotype likelihood of each corresponding single nucleotide polymorphism site, and a second likelihood under the no-contamination assumption is calculated. The cross-contamination probability of each test sample is calculated based on the first likelihood, the second likelihood, and the prior contamination probability corresponding to each test sample.

4. The method according to claim 1, characterized in that, The step of performing quality testing on each sample based on the contamination detection parameters, the variation detection parameters, the sequence alignment data, and the quality control index parameters includes: The quality score of each test sample is calculated based on the contamination detection parameters, the variation detection parameters, the sequence alignment data, and the quality control index parameters corresponding to each test sample. The multiple test samples are sorted according to the quality score; Based on the sorting results, the contaminated test samples are identified from multiple test samples.

5. The method according to claim 1, characterized in that, The step of performing quality testing on each sample based on the contamination detection parameters, the variation detection parameters, the sequence alignment data, and the quality control index parameters includes: Each sample to be tested is coded for contamination detection based on the contamination detection parameters, mutation detection parameters, sequence alignment data, and quality control index parameters corresponding to each parameter, and these parameters are compared with the preset index thresholds corresponding to each parameter. Based on the pollution detection code, a contaminated sample is identified from multiple samples to be tested.

6. The method according to any one of claims 1 to 5, characterized in that, The sequence alignment data includes the alignment rate; The step of comparing the clean sequencing data of each sample to be tested with known genomic data to obtain the sequence alignment data of each sample to be tested includes: The clean sequencing data of each sample to be tested is compared with the known genome data to obtain the number of first reads in the clean sequencing data that are successfully matched with the known genome data; The comparison rate is calculated based on the number of the first read segments and the total number of read segments for each sample to be tested.

7. The method according to any one of claims 1 to 5, characterized in that, The sequence alignment data includes the repetition rate; The step of comparing the clean sequencing data of each sample to be tested with known genomic data to obtain the sequence alignment data of each sample to be tested includes: The clean sequencing data of each sample to be tested is compared with the known genome data to obtain the number of duplicate reads of each sample to be tested, and the number of second reads in the clean sequencing data that are successfully matched with the known genome data. The repetition rate is calculated based on the number of repeated read segments and the number of the second read segments.

8. The method according to any one of claims 1 to 5, characterized in that, The sequence alignment data includes sequencing depth; The step of comparing the clean sequencing data of each sample to be tested with known genomic data to obtain the sequence alignment data of each sample to be tested includes: The clean sequencing data of each sample to be tested is compared with the known genome data to obtain the total number of base pairs that are successfully matched with the known genome data for each sample to be tested; The sequencing depth is calculated based on the total number of paired bases and the effective length of the known genome data.

9. The method according to any one of claims 1 to 5, characterized in that, The mutation detection parameters include a first ratio and / or a second ratio; The step of performing mutation detection on each sample to be tested based on the sequence alignment data to obtain mutation detection parameters for each sample to be tested includes: Based on the sequence alignment data, each sample to be tested is subjected to mutation detection to obtain the number of heterozygous sites and the total number of detected sites in each sample to be tested. The first ratio is calculated based on the number of heterozygous sites and the total number of detected sites. And / or, based on the sequence alignment data, perform mutation detection on each sample to be tested to obtain the number of base transitions and the number of base transversions in each sample to be tested, and calculate the second ratio based on the number of base transitions and the number of base transversions.

10. The method according to any one of claims 1 to 5, characterized in that, The quality control parameters include the percentage of consecutive bases. The process of quality control of the filtered raw sequencing data of each sample to obtain clean sequencing data and quality control parameters for each sample includes: For each sample to be tested, when it is determined that the filtered raw sequencing data contains a predetermined number of consecutive target bases, the predetermined number of consecutive target bases are removed from the filtered raw sequencing data to obtain clean sequencing data for each sample to be tested. For each sample to be tested, the number of second reads containing the predetermined number of consecutive target bases is determined based on the filtered raw sequencing data. The percentage of consecutive bases is calculated based on the number of second reads and the total number of reads for each sample to be tested.

11. The method according to any one of claims 1 to 5, characterized in that, The quality control parameters include the proportion of adapter sequence reads. The process of quality control of the filtered raw sequencing data of each sample to be tested yields clean sequencing data and quality control parameters for each sample, including: The adapter sequences are removed from the filtered raw sequencing data of each sample to be tested to obtain clean sequencing data corresponding to each sample to be tested. For each sample to be tested, the number of third reads containing the adapter sequence is determined based on the filtered raw sequencing data. The proportion of read segments in the connector sequence is calculated based on the number of third read segments and the total number of read segments corresponding to each test sample.

12. The method according to any one of claims 1 to 5, characterized in that, The quality control parameters include the proportion of non-short sequences. The process of quality control of the filtered raw sequencing data of each sample to be tested yields clean sequencing data and quality control parameters for each sample, including: Based on a preset sequence length, the raw sequencing data of each test sample after filtering is short-sequenced to obtain clean sequencing data corresponding to each test sample. For each sample to be tested, the number of fourth reads containing non-short sequences is determined based on the filtered original sequencing data and the preset sequence length. The proportion of non-short sequences is calculated based on the number of fourth reads and the total number of reads for each test sample.

13. A sample quality detection device, characterized in that, The device includes: The sequencing data processing unit is used to acquire the raw sequencing data of each sample to be tested in the sample set, filter out incomplete reads in the raw sequencing data of each sample to be tested, and perform quality control on the filtered raw sequencing data of each sample to be tested to obtain clean sequencing data and quality control index parameters for each sample to be tested. The data alignment unit is used to align the clean sequencing data of each sample to be tested with known genome data to obtain the sequence alignment data of each sample to be tested. The mutation detection unit is used to perform mutation detection on each sample to be tested based on the sequence alignment data, and obtain the mutation detection parameters of each sample to be tested. A contamination detection unit is used to perform contamination detection on each sample to be tested based on the sequence alignment data and the variant detection parameters, and to obtain the contamination detection parameters for each sample to be tested. The quality inspection unit is used to perform quality inspection on each sample to be tested based on the contamination detection parameters, the variation detection parameters, the sequence alignment data, and the quality control index parameters.

14. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the sample quality detection method according to any one of claims 1 to 8.

15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the sample quality detection method according to any one of claims 1 to 8.

16. A computer program product comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the sample quality detection method according to any one of claims 1 to 8.