Methods for distinguishing strains in single-cell microbial genome sequencing results

By screening characteristic SNPs in single-cell microbial genome sequencing and automatically determining the optimal number of strains, combined with greedy algorithms to screen SAG, the problems of difficulty in automatic distinction, high contamination and low integrity in the existing technology are solved, and efficient and accurate strain distinction and genomic sequence assembly.

CN118737269BActive Publication Date: 2024-11-19MOBIDROP (ZHEJIANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411204676.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-11-19
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

The prior art is difficult to automatically distinguish the number of strains in single-cell microbial genome sequencing, and there are problems such as high contamination, low genomic sequence integrity, and inability to distinguish specific functionally related strains.

Method used

In the sequencing results of single-cell microbial genomes, the characteristic SNP is screened using preset filter conditions, hierarchical clustering is performed, and the algorithm to automatically determine the optimal number of strains is introduced, and the greedy algorithm is used to screen the SAG for assembly to improve the integrity of the assembly results. and accuracy.

Benefits of technology

It has achieved efficient and accurate distinction between strains, reduced contamination and information loss, and improved the integrity and recognition ability of genomic sequences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118737269B_ABST
    Figure CN118737269B_ABST
Patent Text Reader

Abstract

The present invention provides a method for distinguishing strains in the results of single-cell microbial genome sequencing. The present invention first finely filters the SNP information of SAG based on preset filtering conditions such as the detection depth of SNPs at different sites, the number of mutations, and the diversity of genes to obtain a feature matrix containing characteristic SNPs, hierarchically clusters the SAGs according to the feature matrix, and then uses an algorithm that can automatically determine the optimal number of strains to accurately distinguish strains in the hierarchical clustering results with high throughput, and then uses the comparison rate, coverage, relative coverage ratio, and effective coverage ratio of each SAG as the basis, and uses a greedy algorithm to efficiently select the optimal SAG assembly set from the SAG set of each strain, and obtains a high-quality strain-level genome sequence with high integrity and low contamination after assembly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of bioinformatics, and in particular relates to a method for distinguishing strains in single-cell microbial genome sequencing results. Background Art

[0002] Strains are smaller units of differentiation than species. Different strains may carry different genes and thus exhibit different biological characteristics. In microbiological research and applications, the identification and classification of strains is very important. The differences between different strains of the same species at the genetic level will directly affect their biological characteristics and behaviors, and these differences are of great significance in disease treatment, industrial fermentation, and ecological research.

[0003] However, current technology makes it difficult to detect strains in large quantities. Currently, strain detection is mainly based on multi-sequence analysis. This technology selects strains from a single microbial community for sequencing through gradient dilution, plate streaking and other methods. Although this technology can detect strains, the culture-based method can only be biased towards a few microbial strains that are easy to culture, and the cost is relatively high. In addition, the currently more commonly used metagenomic sequencing technology is usually unable to resolve strain-level genomes, and although microplate-based single-cell sequencing can produce strain-level genomes, it is limited by cost and has low throughput.

[0004] Single-cell microbial genomics technology (microbe-seq) is a technical means of high-throughput detection of the entire gene sequence of a single microorganism using a single-cell sequencing method. It was published in Science in 2022 (Wenshan Zheng et al., High-throughput, single-microbe genomics with strain resolution, applied to a human gut microbiome. Science 376, eabm1483 (2022). DOI: 10.1126 / science.abm1483). This technology uses a variety of droplet microfluidic operation technologies combined with bioinformatics analysis methods to obtain the genome information of thousands of single-cell microorganisms from complex microbial communities without cultivation, and distinguishes strains based on the difference between the reads of microorganisms in each droplet and the gene sequences of species in the single-cell microbial genome sequencing results. Compared with previous microbial genome detection technologies, single-cell microbial genome technology has significantly improved in throughput and resolution. It can not only quickly identify different strains, but also provide more detailed biological characteristics analysis based on the characteristic genes of each strain. In this article, a specific algorithm for distinguishing strains based on single-cell microbial sequencing data is provided. The algorithm first aligns the reads of SAG (single-amplified genome, which refers to the collection of single microbial sequencing sequences in a droplet) to the assembled genome at the species level, and obtains the SAG-SNP matrix of each species based on the SNP information (singlenucleotide polymorphism) of the species genome. Based on the SAG-SNP matrix, the SAG is hierarchically clustered and the SAG clustering tree is obtained. After specifying the number of differentiated strains, the SAG clustering tree is divided into corresponding subtrees to obtain the SAG list of each strain. The SNP information of each strain's SAG is counted to obtain the SNP genotype of each strain, and compared with the strain's genotype. If the similarity is greater than 90%, the SAG is classified as the strain and used for assembly to obtain the genome at the strain level.

[0005] However, the above-mentioned algorithm for distinguishing strains based on single-cell microbial sequencing data still has the following shortcomings:

[0006] (1) The number of strains needs to be manually determined. This method does not provide an algorithm that can automatically distinguish the number of strains, which makes the analysis somewhat subjective and cannot achieve large-scale automatic differentiation of strains. For high-throughput sequencing, this shortcoming limits the large-scale application of this technology.

[0007] (2) The strain assembly may be highly contaminated. This method uses all SAGs in the cluster tree that are divided into subtrees and have a similarity greater than 90% for subsequent assembly. However, some SAGs may have high contamination, which will result in poor quality of the assembled strain genome sequence.

[0008] (3) There is a certain gap preference (referring to the missing of a longer fragment in the gene sequence) in strain differentiation, resulting in low completeness. For SAGs with sequencing missing at the same position, the hierarchical clustering algorithm is more likely to cluster these SAGs together. However, the missing is not necessarily a strain characteristic, it may be that the sequencing does not cover the area. Assembling SAGs with missing regions in the same area will cause the genome of the region to be missing in the assembly result, resulting in a decrease in assembly completeness.

[0009] (4) Strains can only be distinguished based on all SNPs. In actual research, usually only a part of the genes is focused on, and these genes may have functions related to the phenotype. If the distinction is based on all SNPs, it may not be possible to distinguish strains related to specific functions.

[0010] (5) In some cases where the SNP characteristics are not obvious or the SAG coverage is low, the strain differentiation effect is poor, which is usually manifested as the inability to distinguish strains or a large number of SAGs cannot match the strain characteristics. Summary of the invention

[0011] In order to solve the above defects in the prior art, the present invention proposes a more accurate method to distinguish strains in the sequencing results of single-cell microbial genomes.

[0012] The technical solution adopted by the present invention is: a method for distinguishing strains in single-cell microbial genome sequencing results, comprising the following steps:

[0013] S1. Align each SAG to the species genome to obtain the SNP of each SAG relative to the species genome;

[0014] S2. Merge the SNPs of all SAGs to obtain a preliminary SNP matrix, filter the SNPs in the preliminary SNP matrix according to a preset filtering condition, and obtain a characteristic matrix containing characteristic SNPs;

[0015] S3. Perform hierarchical clustering of SAGs according to characteristic SNPs, divide the hierarchical clustering results into different numbers of strains, evaluate each division result using the WSS score as an evaluation index, and determine the optimal number of strains based on the evaluation results;

[0016] S4. Divide the hierarchical clustering results according to the optimal number of strains to obtain the SAG set of each strain;

[0017] S5. Calculate the coverage of each SAG in the SAG set of each strain aligned to the species genome;

[0018] S6. According to the alignment rate, coverage, relative coverage ratio, and effective coverage ratio of each SAG, a greedy algorithm is used to select the SAG for strain assembly from the SAG set to obtain a SAG assembly set;

[0019] S7. Assemble the reads in the SAG assembly set to obtain the genome sequence of the corresponding strain.

[0020] Combination Figure 1 The workflow shown in the figure is that the present invention first finely filters the SNP information of SAG in step S2 based on preset filtering conditions such as the detection depth of SNPs at different sites, the number of mutations, and the diversity of genotypes to obtain a feature matrix containing characteristic SNPs. On the one hand, this preprocessing method can more effectively process SAGs with unclear SNP characteristics or low coverage, thereby improving the accuracy of subsequent hierarchical clustering and reducing the risk of erroneous clustering; on the other hand, it can efficiently focus on specific genes, thereby distinguishing bacterial species with specific genes and providing more accurate strain genotype information. Subsequently, when dividing the SAG hierarchical clustering results in step S3, the present invention introduces an algorithm that can automatically determine the optimal number of strains. Based on the sequencing results of the single-cell microbial genome, the strains can be accurately distinguished with high throughput, avoiding the subjective bias caused by manual judgment of the number of strains. Step S4 divides the hierarchical clustering results according to the obtained optimal number of strains, and in step S5, calculates the coverage of each SAG in the SAG set of each strain after division. In the process of screening SAGs for assembly in step S6, the present invention creatively uses the alignment rate, coverage, relative coverage ratio and effective coverage ratio of each SAG as the basis, and adopts a greedy algorithm to efficiently and accurately select the optimal SAG assembly set, thereby effectively improving the integrity and accuracy of the assembly results in step S7, reducing contamination, and reducing information loss in the assembly process, thereby obtaining high-quality strain genome sequences.

[0021] Specifically, the preset filtering conditions are set according to the detection depth of SNPs at different sites, and / or the number of mutations of SNPs at different sites, and / or the gene to which the SNPs belong.

[0022] SNP sites with low detection depths in sequencing results are prone to lead to inaccurate analysis results. Therefore, in one or more specific embodiments of the present invention, the detection depths of SNPs at different sites are included in the preset filtering conditions to remove sites with too low detection depths, such as SNP sites with a detection depth lower than 5, thereby ensuring the reliability of the selected characteristic SNPs.

[0023] The difference in the number of mutations of a SNP at a certain site in the sequencing results may lead to the misclassification of the strain. Therefore, in one or more specific embodiments of the present invention, the number of mutations of SNPs at different sites is included in the preset filtering conditions to remove SNP sites with too few mutations, such as SNP sites with less than 1% mutations, so as to effectively identify mutations with biological significance and avoid mistaking random mutations for characteristic SNPs.

[0024] The existing technology can only distinguish strains based on all SNPs, and may not be able to distinguish strains related to specific functions. Therefore, in one or more specific embodiments of the present invention, the gene to which the SNP belongs is included in the preset filtering conditions. If a gene related to a specific function is of interest, the SNP that does not belong to the gene is removed, thereby efficiently and accurately distinguishing strains related to specific functions and improving the ability to identify different strains.

[0025] In summary, by comprehensively considering the detection depth of SNPs, the number of mutations and the diversity of the genes to which they belong, the present invention can significantly improve the quality of characteristic SNPs, thereby improving the accuracy of hierarchical clustering and reducing the risk of erroneous clustering. At the same time, it can also effectively focus on SNPs with biological significance, thereby improving the effect of strain differentiation, and also providing a good foundation for subsequent clustering and assembly processes, ensuring that the final genome sequence has higher integrity and accuracy and lower contamination.

[0026] Specifically, step S3 includes:

[0027] S3-1. Calculate the mean and standard deviation of each characteristic SNP in the characteristic matrix;

[0028] S3-2. Sort all characteristic SNPs by their standard deviations, select the first x SNP characteristics with decreasing standard deviations from the largest to form an analysis matrix, and perform hierarchical clustering on SAGs according to the analysis matrix;

[0029] S3-3. Determine the maximum number of strains Q traversed by the hierarchical clustering results;

[0030] S3-4. Divide the hierarchical clustering results by the number of n strains, where n is any integer between 1 and Q;

[0031] S3-5. The WSS score is used as an evaluation indicator to evaluate each division result. The calculation formula of the WSS score is:

[0032] ,

[0033] in,

[0034] WSS n is the WSS score when divided into n strain numbers;

[0035] FeatureCount is the number of SNP features in the analysis matrix;

[0036] Feature i is the value set of the i-th SNP feature in the analysis matrix;

[0037] ClusterCenter m,i To analyze the characteristic center of the ith SNP feature of the mth strain when the matrix is ​​divided into n strains, the average value of the ith SNP feature of the SAG set of the mth strain is used as ClusterCenter m,i ;

[0038] P m is the penalty score of the mth strain when the analysis matrix is ​​divided into n strains. m It is set according to the average value of each SNP feature in the analysis matrix, the number of SAGs in the analysis matrix, and the number of SAGs of the mth strain in the analysis matrix.

[0039] More specifically, in step S3-2, the parameter x is preferably not less than 500, more preferably not less than 3000, and further preferably 3000. In one or more specific embodiments, if the total number of characteristic SNPs in the characteristic matrix is ​​less than 500, all characteristic SNPs are included in the analysis matrix.

[0040] More specifically, in step S3-3, the maximum number of strains Q is not greater than 20. Experiments have found that when the maximum number of strains P exceeds 20, the accuracy of the division result cannot be improved.

[0041] In addition, in one or more specific embodiments, if in step S3-2, the total number of characteristic SNPs in the characteristic matrix is ​​less than the preset parameter x, all characteristic SNPs are included in the analysis matrix. In view of the situation where the total number of characteristic SNPs in the analysis matrix is ​​small, the present invention also proposes a calculation method that can automatically and accurately determine the maximum number of strains P, specifically, according to the number of SNP features in the analysis matrix and the upper limit value of the maximum number of strains P determined above, 20, to accurately determine a more appropriate maximum number of strains P. Preferably, the calculation formula for the maximum number of strains P is:

[0042] ,

[0043] in,

[0044] MaxStrainCount is the maximum number of strains Q;

[0045] FeatureCount is the number of SNP features in the analysis matrix.

[0046] It can be understood that, in a specific embodiment, if the number of SNP features in the analysis matrix is ​​30, the maximum number of strains P is determined to be 15 according to the above calculation formula.

[0047] More specifically, the P m The calculation formula is:

[0048] ,

[0049] in,

[0050] FeatureMean i is the average value of the ith SNP feature in the analysis matrix;

[0051] SAGCount is the number of SAGs in the analysis matrix;

[0052] SAGCount m The number of SAGs of strain number m in the analysis matrix;

[0053] R is the penalty coefficient, and the value range of R is 0.1~10.

[0054] Step S3 introduces an algorithm that can automatically determine the optimal number of strains, which can accurately distinguish strains with high throughput and avoid the subjective bias caused by manual judgment of the number of strains. The algorithm first selects x characteristic SNPs from the characteristic matrix according to the standard deviation of the characteristic SNP in steps S3-1 to S3-2 to form an analysis matrix, and then hierarchically clusters the SAG according to the analysis matrix. Among them, in order to ensure the quality of analysis, it is preferred to select no less than 500 characteristic SNPs to form the analysis matrix. If the total number of characteristic SNPs in the characteristic matrix is ​​less than the preset parameter x (such as 500), all characteristic SNPs are included in the analysis matrix. Subsequently, the maximum number of strains Q traversed by the hierarchical clustering results is determined. In order to ensure the quality of analysis, the maximum number of strains Q is preferably not more than 20. According to the determined maximum number of strains Q, the hierarchical clustering results are divided into 1 to Q strains, that is, divided into 1 strain, 2 strains, 3 strains, ..., until Q strains, a total of Q types of division results. Then, each division result is evaluated using the WSS (Within Sum of Square) score as an evaluation index. Among them, the WSS score is mainly measured by calculating the distance between a certain SNP feature and the feature center of the strain to which it is divided (ward distance, i.e., the sum of squared deviations) to measure the quality of each division result. If the SNP features in each strain in a certain division result are relatively close to their respective feature centers, the WSS score will be relatively small, indicating that this division result is good. Based on the idea of ​​variance analysis, if the strain division is correct, the sum of squared deviations within the corresponding strain should be small and the sum of squared deviations between different strains should be large. In a specific embodiment, the optimal number of strains can be determined by drawing a WSS score-strain number curve (refer to Figure 2 ), generally the number of strains with significantly smaller WSS scores is selected as the optimal number of strains. It is worth noting that in order to more accurately divide the strains, the present invention also combines the penalty score P in the general WSS score calculation method. m The penalty score is set according to the average value of each SNP feature in the analysis matrix, the number of SAGs in the analysis matrix, and the number of SAGs of the mth strain in the analysis matrix. The penalty score can balance the impact of different characteristic SNPs on the clustering results, making the clustering results more stable and reliable, and has a good auxiliary effect as verified by experiments. It is understandable that those skilled in the art can set the penalty score P according to the actual situation. m Select an appropriate penalty coefficient R to make the WSS score more consistent with the experimental requirements. The value range of R can be 0.1~10, preferably 0.5~5.

[0055] Specifically, in step S5, the coverage of each SAG alignment to the species genome is defined as:

[0056] ,

[0057] in,

[0058] R p is the coverage of SAG number p;

[0059] MappedCov p is the coverage length of SAG number p on the gene sequence of the species;

[0060] UnmappedCov p It is the length of reads that SAG number p has not been mapped to the gene sequence of the species.

[0061] Specifically, step S6 includes:

[0062] S6-1. Set the initialization state of the SAG assembly set. In the first round of the cycle, select the SAG with the largest coverage in the current SAG set p to add to the SAG assembly set, merge the coverage area, and obtain the first round of SAG assembly set;

[0063] Or in the current non-first round, select the SAG with the largest effective coverage ratio p in the current SAG set and add it to the SAG assembly set obtained in S6-3 in the previous round, merge the coverage area, and obtain the SAG assembly set of the current round;

[0064] S6-2. Calculate the first overlap length of the set of coverage areas of each SAG number q that is not currently included in the SAG assembly set and the set of coverage areas of SAG number p, and then calculate the relative coverage ratio of each SAG number q that is not currently included in the SAG assembly set relative to SAG number p based on the first overlap length, the set length of the coverage areas of SAG number p, and the read length of SAG number p that is not aligned to the species gene sequence;

[0065] S6-3. Select the q with the largest relative coverage ratio max SAG No. is added to the SAG assembly set obtained by S6-1, the coverage area is merged, and the SAG assembly set of the current round is obtained iteratively;

[0066] S6-4. Calculate the second overlap length of the set of coverage areas of each SAG number q' that is not currently included in the SAG assembly set and the set of coverage areas of the SAG assembly set obtained in S6-3, and then calculate the effective coverage ratio of each SAG number q' that is not currently included in the SAG assembly set relative to SAG number p based on the second overlap length, the set length of the coverage areas of the SAG assembly set obtained in S6-3, and the read length of SAG number p that is not aligned to the species gene sequence;

[0067] S6-5. Loop through steps S6-1 to S6-4 until preset assembly conditions are met to obtain a SAG assembly set; wherein the preset assembly conditions are set based on the total coverage length of the SAG assembly set, the number of SAGs in the SAG assembly set, and the alignment rate of the SAGs included in the SAG assembly set.

[0068] More specifically, in S6-2, the relative coverage ratio TR p, q The calculation formula is:

[0069] ,

[0070] in,

[0071] D p,q is the first superposition length of the set of coverage areas of each SAG number q that is not currently included in the SAG assembly set and the set of coverage areas of the SAG number p;

[0072] C p is the set of coverage areas of SAG number p.

[0073] More specifically, in S6-4, the effective coverage ratio R q’, a The calculation formula is:

[0074] ,

[0075] in,

[0076] D q’, a is the second superposition length of the set of coverage areas of each SAG with number q' that is not included in the SAG assembly set in the current round a and the set of coverage areas of the SAG assembly set obtained in S6-3;

[0077] C a It is the set of coverage areas of the SAG assembly set obtained by S6-3 in the current round a.

[0078] More specifically, the preset assembly condition is any one of the following (1) to (4):

[0079] (1) The coverage area of ​​the SAG assembly set accounts for more than 95% of the gene sequence length of the species;

[0080] (2) The number of SAGs in the SAG assembly set is greater than a set SAG number threshold, and the SAG number threshold is preferably 50;

[0081] (3) The alignment rate of the SAGs included in the SAG assembly set in round a+1 to the species genome is less than the set alignment rate threshold, and the alignment rate threshold is preferably 50%;

[0082] (4) All SAGs are included in the SAG assembly set.

[0083] In step S6, the present invention creatively uses the alignment rate, coverage, relative coverage ratio and effective coverage ratio of each SAG as the basis, and adopts a greedy algorithm to efficiently and accurately select the optimal SAG assembly set, which can effectively improve the integrity and accuracy of the assembly results, reduce contamination, and reduce information loss in the assembly process, thereby obtaining a high-quality strain genome sequence. In the prior art, in the process of screening SAGs for assembly, SAGs that are divided into subtrees in the clustering tree and have a similarity greater than 90% are directly used for subsequent assembly, which will cause SAGs with possible high contamination to be included in this range, thereby reducing the quality of the assembled strain genome sequence. To avoid this situation, the present invention sets a threshold for the alignment rate of the SAG included in the SAG assembly set to the species genome in the preset assembly conditions. If its alignment rate is less than the set alignment rate threshold, such as 50%, it is considered that such SAG is highly contaminated and should not be included in the SAG assembly set. Among them, the alignment rate of SAG to the species genome can be directly obtained by reference or calculated by BLAST (Basic Local Alignment Search Tool), which is a technical means well known to those skilled in the art and will not be explained in detail in this specification. In order to improve the completeness and accuracy of the assembly results, the present invention, while considering the reads length of the SAG that is not aligned to the species gene sequence, combines the coverage and effective coverage ratio of each SAG, more accurately evaluates the contribution of each SAG to the assembly, and incorporates SAGs with different coverage ranges into the SAG assembly set as much as possible, so that the SAG assembly set comprehensively covers the target genome. In addition, through the hierarchical clustering algorithm, the prior art makes it easier to cluster SAGs with sequencing missing at the same position together and use them for subsequent assembly, and the missing position is very likely to be an area not covered by sequencing, so this gap preference will cause the genome of this region to be missing in the assembly results, thereby resulting in a decrease in the completeness of the assembly. To solve this problem, the present invention also considers the reads length of the SAG that has not been aligned to the species gene sequence, and uses the relative coverage ratio of each SAG to judge the difference between the SAG that has not been included in the SAG assembly set and the SAG that has been included in the SAG assembly set, so as to include SAGs with different coverage ranges into the SAG assembly set as much as possible, and avoids the repeated inclusion of SAGs with the same coverage loss. It can be understood that in each cycle that has not met the preset assembly conditions, the SAG with the largest effective coverage ratio in the current cycle (the SAG with the largest coverage in the first cycle) and the SAG with the largest relative coverage ratio will be included in the SAG assembly set, and the above cycle steps will be repeated until the preset assembly conditions are met.In the setting of preset assembly conditions, the present invention flexibly sets multiple aspects such as the total coverage length of the SAG assembly set, the number of SAGs in the SAG assembly set, and the comparison rate of the SAGs included in the SAG assembly set, so as to better adapt to different assembly requirements and obtain assembly results with higher integrity, accuracy and lower contamination.

[0084] Specifically, step S7 also includes: adding the species genome sequence as an untrusted-contig or a trusted-contig to the SAG assembly set for assembly.

[0085] More specifically, step S7 also includes: adding the species genome sequence as an untrusted-contig to the SAG assembly set for filling gaps in the assembly process, and / or determining repeated sequences.

[0086] More specifically, step S7 also includes: adding the species genome sequence as a trusted-contig to the SAG assembly set for forming a de Bruijn graph during the assembly process.

[0087] In the assembly process corresponding to step S7, for some cases where SNP features are not obvious or SAG coverage is low, the prior art has a poor effect on distinguishing strains, which is usually manifested as being unable to distinguish strains, or a large number of SAGs cannot match strains. To solve this problem, the present invention proposes adding species genome sequences as supplementary fragments to the SAG assembly set for assembly during the assembly process. In one or more specific embodiments of the present invention, the species genome sequence is added as an untrusted-contig to the SAG assembly set to fill gaps and / or determine repeated sequences during the assembly process, thereby solving the problem that a large number of SAGs cannot match strains due to low SAG coverage, and effectively improving the effect of distinguishing strains. In one or more specific embodiments of the present invention, the species genome sequence is added as a trusted-contig to the SAG assembly set to form a De Bruijn graph during the assembly process. De Bruijn Graph is a graph structure used to represent and analyze sequence data, and is widely used in genome assembly and sequence splicing. It forms a graph structure by dividing the DNA sequence into subsequences (k-mers) of fixed length and connecting these k-mers as nodes. The edges between nodes represent the overlapping relationship between k-mers. By traversing this graph, adjacent k-mers can be spliced ​​into longer sequences (contigs), thereby achieving efficient genome assembly. Therefore, if there are large gaps in the assembly results, adding the species genome sequence as a trusted-contig to the SAG assembly set can fill such gaps, thereby forming a richer de Bruijn graph and effectively solving the problem of being unable to distinguish strains.

[0088] Specifically, step S7 also includes: according to the cleaning threshold, the contig obtained in the assembly process of step S7 is cleaned, and the cleaned contig is assembled to obtain the genome sequence of the corresponding strain; the cleaning threshold includes a length threshold and / or a coverage threshold; the length threshold is set according to the length of the contig; the coverage threshold is set according to the coverage of the contig to the species genome. It is understandable that when the length of the contig is less than the set length threshold, the contig is cleaned; when the coverage of the contig to the species genome is less than the set coverage threshold, the contig is cleaned.

[0089] Beneficial effects of the present invention: The present invention proposes a new method for more accurately distinguishing strains in single-cell microbial genome sequencing. In the selection of sequencing data, the present invention first finely filters the SNP information of SAG based on preset filtering conditions such as the detection depth of SNPs at different sites, the number of mutations, and the diversity of genes. On the one hand, it can more effectively process SAGs with unclear SNP characteristics or low coverage, thereby improving the accuracy of subsequent hierarchical clustering and reducing the risk of erroneous clustering; on the other hand, it can efficiently focus on specific genes, thereby distinguishing strains with specific genes, and providing more accurate strain genotype information. In the process of strain division, different from the prior art, the present invention introduces an algorithm for automatically determining the optimal number of strains, avoiding the subjective bias caused by manual judgment, and making the distinction of strains more efficient and accurate. In the process of screening SAGs for assembly, the present invention creatively uses the alignment rate, coverage, relative coverage ratio and effective coverage ratio of each SAG as the basis, and adopts a greedy algorithm to efficiently and accurately select the optimal SAG assembly set, which can effectively improve the integrity and accuracy of the assembly results, reduce contamination, and reduce information loss in the assembly process, thereby obtaining high-quality strain genome sequences. During the assembly process, the present invention proposes to add the species genome sequence as an untrusted-contig or a trusted-contig to the assembly, so as to better handle the situation where the SNP characteristics in the sequencing results are not obvious or the SAG coverage is low, and effectively improve the effect of strain differentiation. In summary, the present invention not only improves the ability to distinguish strains, but also provides a good foundation for the subsequent assembly process, ensuring the acquisition of high-quality strain-level genome sequences with high integrity and low contamination. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 A workflow diagram of the method provided by the present invention for distinguishing strains in single-cell microbial genome sequencing results.

[0091] Figure 2 It is the WSS score corresponding to the different numbers of strains in Example 1 of the present invention.

[0092] Figure 3 For Example 1 of the present invention Lactobacillus amylovorus UMAP dimensionality reduction plot of strains classified into species.

[0093] Figure 4 This is the UMAP dimensionality reduction graph of the strains divided into species_1 in Example 2 of the present invention and Comparative Example 2. DETAILED DESCRIPTION

[0094] The following is an explanation of the embodiments of the present invention by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied by other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other. In the embodiments of the present invention, the methods used are all conventional methods unless otherwise specified, and the reagents used can be obtained from commercial sources.

[0095] Embodiment 1:

[0096] Sequencing of single-cell microbial genomes Lactobacillus amylovorus Species, the method for distinguishing strains in the single-cell microbial genome sequencing results provided by the present invention is performed, and the specific steps are as follows.

[0097] S1. Align each SAG to the species genome and obtain the SNP of each SAG relative to the species genome.

[0098] S2. Merge the SNPs of all SAGs to obtain a preliminary SNP matrix, and filter the SNPs in the preliminary SNP matrix according to preset filtering conditions to obtain a characteristic matrix containing characteristic SNPs; the preset filtering conditions are: the detection depth of SNPs at different sites is not less than 5, and the number of mutations of SNPs at different sites is not less than 1%.

[0099] S3-1. Calculate the mean value FeatureMean of each feature SNP in the feature matrix i , standard deviation STD i .

[0100] Use the std function np.std of the numpy package of python to calculate the standard deviation STD of the i-th feature SNP i :

[0101] , where Feature i is the value set of the i-th SNP feature.

[0102] Calculate the mean value FeatureMean of the i-th feature SNP i :

[0103] .

[0104] S3-2. Sort all characteristic SNPs in descending order according to their standard deviations, select the first 3000 SNP characteristics with decreasing standard deviations from the largest to form an analysis matrix, and perform hierarchical clustering on SAGs based on the analysis matrix.

[0105] S3-3. Determine the maximum number of strains Q traversed by the hierarchical clustering results to be 20.

[0106] S3-4. Divide the hierarchical clustering results by the number of n strains, where n is any integer between 1 and 20;

[0107] S3-5. The 20 classification results were evaluated using the WSS score as the evaluation index, and the number of strains with the lowest WSS score was selected as the optimal number of strains. Figure 2 As shown, it can be seen that when the hierarchical clustering results are divided according to the number of 2 strains, the WSS score is the lowest, so the optimal number of strains is determined to be 2.

[0108] The calculation formula of the WSS score is:

[0109] ,

[0110] ,

[0111] in,

[0112] WSS n is the WSS score when divided into n strain numbers;

[0113] FeatureCount is the number of SNP features in the analysis matrix;

[0114] Feature i is the value set of the i-th SNP feature in the analysis matrix;

[0115] ClusterCenter m,i To analyze the characteristic center of the ith SNP feature of the mth strain when the matrix is ​​divided into n strains, the average value of the ith SNP feature of the SAG set of the mth strain is used as ClusterCenter m,i ;

[0116] SAGCount is the number of SAGs in the analysis matrix;

[0117] SAGCount m The number of SAGs of strain No. m in the analysis matrix;

[0118] R is the penalty coefficient, and the value range of R is 1.

[0119] S4. Divide the hierarchical clustering results according to the optimal number of strains 2 to obtain the SAG set of each strain. Specifically, use the cut_tree function of scipy.cluster.hierarchy to divide the tree into corresponding branches according to the two strain numbers. Each branch is considered to be a strain, and its SAG is all the leaf nodes of the branch.

[0120] S5. Calculate the coverage of each SAG in the SAG set of each strain aligned to the species genome. The coverage of each SAG aligned to the species genome is defined as:

[0121] ,

[0122] in,

[0123] R p is the coverage of SAG number p;

[0124] MappedCov p is the coverage length of SAG number p on the gene sequence of the species, which can be calculated by bedtools;

[0125] UnmappedCov p It is the length of reads that SAG number p has not been aligned to the gene sequence of the species, which can be calculated by pysam.

[0126] S6-1. Set the initialization state of the SAG assembly set: set the SAG assembly set to an empty set, and set the current SAG assembly set coverage area set to an empty set;

[0127] In the first cycle, the SAG with the largest coverage in the current SAG set is selected to be added to the SAG assembly set, and the coverage area is merged to obtain the SAG assembly set of the first round;

[0128] Or in the current non-first round, select the SAG with the largest effective coverage ratio p in the current SAG set and add it to the SAG assembly set obtained in S6-3 in the previous round (round a-1), merge the coverage area, and obtain the current SAG assembly set of round a:

[0129] ,

[0130] Among them, C a is the set of coverage areas in round a; C p is the set of coverage areas of SAG number p.

[0131] S6-2. Calculate the first overlap length of the set of coverage areas of each SAG number q that is not currently included in the SAG assembly set and the set of coverage areas of SAG number p, and then calculate the relative coverage ratio of each SAG number q that is not currently included in the SAG assembly set relative to SAG number p based on the first overlap length, the set length of the coverage areas of SAG number p, and the read length of SAG number p that is not aligned to the species gene sequence; the relative coverage ratio TR p, q The calculation formula is:

[0132] ,

[0133] ,

[0134] Among them, D p,q is the set C of coverage areas of each SAG with number q that is not currently included in the SAG assembly set q The set C of coverage areas of SAG with number p p The first superposition length.

[0135] S6-3. Select the q with the largest relative coverage ratio max SAG No. is added to the SAG assembly set obtained by S6-1, the coverage area is merged, and the current SAG assembly set of round a is obtained iteratively:

[0136] .

[0137] S6-4. Calculate the second overlap length of the set of coverage areas of each SAG number q' that is not currently included in the SAG assembly set and the set of coverage areas of the SAG assembly set obtained in S6-3, and then calculate the effective coverage ratio of each SAG number q' that is not currently included in the SAG assembly set relative to the SAG number p based on the second overlap length, the set length of the coverage areas of the SAG assembly set obtained in S6-3, and the read length of the SAG number p that is not aligned to the species gene sequence; the effective coverage ratio R q’, a The calculation formula is:

[0138] ,

[0139] ,

[0140] Among them, D q’, a is the set C of coverage areas of each SAG with number q' that is not included in the SAG assembly set in the current round a q’ The set C covering the area of ​​the SAG assembly obtained from S6-3 a The second overlap length.

[0141] S6-5. Execute steps S6-1 to S6-4 repeatedly until the preset assembly condition is met, and obtain a SAG assembly set; wherein the preset assembly condition is any one of the following (1) to (4):

[0142] (1) The coverage area of ​​the SAG assembly set accounts for more than 95% of the gene sequence length of the species;

[0143] (2) The number of SAGs in the SAG assembly set is greater than 50;

[0144] (3) The alignment rate of the SAG included in the SAG assembly set in round a+1 is less than 50%;

[0145] (4) All SAGs are included in the SAG assembly set.

[0146] S7. Use SPAdes software to assemble the reads in the SAG assembly set, and add the species genome sequence as an untrusted-contig to the SAG assembly set to fill gaps and / or determine repeated sequences during the assembly process, and add the species genome sequence as a trusted-contig to the SAG assembly set to form a de Bruijn graph during the assembly process; according to the cleaning threshold, the contigs obtained in the assembly process are cleaned, and the cleaned contigs are assembled to obtain the genome sequence of the corresponding strain; the cleaning threshold includes a length threshold and a coverage threshold, and the contigs that do not meet the length threshold or the coverage threshold are cleaned; wherein, the length threshold and the coverage threshold are specifically shown in Table 1.

[0147] Table 1. Setting of cleaning thresholds by different methods

[0148] bin_ID Coverage Threshold Example 2 Length Threshold Example 2 Coverage Threshold Comparison Example 1 Length Threshold Comparison Example 1 7_4717_strain_0 2.27908467 0 0.216536932 1000 7_4717_strain_1 0 6678.538 0.387855434 1000 7_4717_strain_U 0 6534.28 0.912425686 1000

[0149] After the above method, the following results were obtained: species Lactobacillus amylovorus The two strains were automatically distinguished into strain_0 and strain_1, and the remaining 15 SAGs were classified as the unknown strain strain_U. Both strains achieved an assembly with high completeness and low contamination (Table 2), and the two strains had obvious SNP characteristics (Table 3). Based on the SNP matrix, the two strains could be clearly distinguished by the UMAP (Uniform Manifold Approximation and Projection) dimensionality reduction algorithm ( Figure 3 ).

[0150] Table 2. Integrity, contamination and SAG number of different strains

[0151] bin_ID Completeness Pollution SAG quantity 7_4717_strain_0 98.94481 1.252319 709 7_4717_strain_1 98.29545 0.278293 349 7_4717_strain_U 98.94481 0.359462 15

[0152] Table 3. SNP characteristics of different strains

[0153] strain_0 strain_1 snp_1 1 -1 snp_2 1 -1 snp_3 1 -1 snp_4 1 -1 snp_5 1 -1 snp_6 1 -1 snp_7 1 -1 snp_8 1 -1 snp_9 1 -1 snp_10 1 -1 snp_11 1 -1 snp_12 1 -1 snp_13 1 -1 snp_14 1 -1 snp_15 1 -1

[0154] Example 2 and Comparative Example 1:

[0155] Example 2 and Comparative Example 1 respectively use the method provided by the present invention (the specific steps are the same as those in Example 1) and the prior art (Wenshan Zheng et al., High-throughput, single-microbe genomics with strain resolution, applied to a human gut microbiome. Science 376, eabm1483 (2022). DOI: 10.1126 / science.abm1483) to sequence the genome of a single-cell microorganism to obtain the species Basfia A porcinus (denoted as species_0) and species Escherichia coli (denoted as species_1) for strain differentiation, dividing both species into 2 strains (Table 5, where species_1_strain_0 represents strain 0 of species 1), and classifying the remaining SAGs as Unknown strain strain_U. The setting of the cleaning threshold in step S7 is shown in Table 4.

[0156] Table 4. Setting of cleaning thresholds by different methods

[0157] bin_ID Coverage Threshold Example 2 Length Threshold Example 2 Coverage Threshold Comparison Example 1 Length Threshold Comparison Example 1 species_0_strain_0 1.95874635 0 0.889212528 1000 species_0_strain_1 0.452658515 1931.292 0.766621776 1000 species_0_strain_U 1.52452316 398.162 0.689235189 1000 species_1_strain_0 0.41421051 542.648 0.988299328 1000 species_1_strain_1 0.24154592 1823.608 1.242342 1000 species_1_strain_U 0.274888045 1253.322 1.428749 1000

[0158] According to Table 5, according to the method provided by the present invention (Example 2), the number of SAGs classified as unknown in the two species is less than that in the prior art (Comparative Example 1), indicating that the method provided by the present invention has a higher utilization rate of SAGs and can include SAGs with different coverage ranges into the SAG assembly set as much as possible. After assembling two strains corresponding to two species respectively according to the method provided by the present invention, the obtained assembly results (Example 2) have a greater completeness than the prior art (Comparative Example 1), and a lower contamination than the prior art (Comparative Example 1).

[0159] Table 5. Completeness, contamination and number of SAGs of genome sequences assembled by different methods

[0160] bin_ID Completeness Example 2 Completeness comparison example 1 Pollution Example 2 Pollution Comparative Example 1 SAG Quantity Example 2 SAG quantity comparison 1 species_0_strain_0 100 90.72505 0 5.084746 1042 494 species_0_strain_1 100 36.88602 0 4.028409 1177 372 species_0_strain_U 98.55303 95.35813 0.727273 5.643595 2002 3355 species_1_strain_0 99.36343 79.93973 0.47619 6.970891 2335 395 species_1_strain_1 99.55274 22.18557 0.31962 1.998235 1313 18 species_1_strain_U 99.68419 84.69042 0.419147 1.797382 2639 5874

[0161] Further, Figure 4The two methods were compared to distinguish the strains of species_1 under UMAP dimensionality reduction. It can be seen that the corresponding Figure 4 In (a), strain 0 can be clearly distinguished from it, while strain 1 and unknown strain cannot be distinguished, but it can be seen that they are in similar positions. Therefore, it can be judged that the unknown strain may be the SAG composition of strain 1 with poor quality. Figure 4 In (b), the above characteristics cannot be seen, and the unknown strains (yellow dots) are diffused throughout the entire image, making it impossible to accurately distinguish the strains.

[0162] In summary, compared with the prior art, the method provided by the present invention has a higher utilization rate of SAG, reduces the information loss in the assembly process, provides a good foundation for the subsequent assembly process, and obtains high-quality strain-level genome sequences with higher completeness and lower contamination.

[0163] The embodiments described above are merely descriptions of preferred implementations of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope of the present invention.

Claims

1. A method for distinguishing strains in single-cell microbial genome sequencing results, characterized in that: The steps include: S1. Align each SAG to the species genome to obtain the SNP of each SAG relative to the species genome; S2. Merge the SNPs of all SAGs to obtain a preliminary SNP matrix, filter the SNPs in the preliminary SNP matrix according to a preset filtering condition, and obtain a characteristic matrix containing characteristic SNPs; S3. Perform hierarchical clustering of SAGs according to characteristic SNPs, divide the hierarchical clustering results into different numbers of strains, evaluate each division result using the WSS score as an evaluation index, and determine the optimal number of strains based on the evaluation results; S4. Divide the hierarchical clustering results according to the optimal number of strains to obtain the SAG set of each strain; S5. Calculate the coverage of each SAG in the SAG set of each strain aligned to the species genome; S6. According to the alignment rate, coverage, relative coverage ratio, and effective coverage ratio of each SAG, a greedy algorithm is used to select the SAG for strain assembly from the SAG set to obtain a SAG assembly set; S7. Assemble the reads in the SAG assembly set to obtain the genome sequence of the corresponding strain; Wherein, step S6 comprises: S6-1. Set the initialization state of the SAG assembly set. In the first round of the cycle, select the SAG with the largest coverage in the current SAG set p to add to the SAG assembly set, merge the coverage area, and obtain the first round of SAG assembly set; Or in the current non-first round, select the SAG with the largest effective coverage ratio p in the current SAG set and add it to the SAG assembly set obtained in S6-3 in the previous round, merge the coverage area, and obtain the SAG assembly set of the current round; S6-2. Calculate the first overlap length of the coverage area of ​​each SAG number q that is not currently included in the SAG assembly set and the coverage area of ​​SAG number p, and then calculate the relative coverage ratio of each SAG number q that is not currently included in the SAG assembly set relative to SAG number p based on the first overlap length, the set length of the coverage area of ​​SAG number p, and the read length of SAG number p that is not aligned to the species gene sequence; S6-3. Select the SAG with the largest relative coverage ratio qmax and add it to the SAG assembly set obtained in S6-1, merge the coverage areas, and iterate to obtain the SAG assembly set of the current round; S6-4. Calculate the second overlap length of the coverage area of ​​each SAG q' that is not currently included in the SAG assembly set and the coverage area of ​​the SAG assembly set obtained in S6-3, and then calculate the effective coverage ratio of each SAG q' that is not currently included in the SAG assembly set relative to SAG p based on the second overlap length, the set length of the coverage area of ​​the SAG assembly set obtained in S6-3, and the read length of SAG p that is not aligned to the species gene sequence; S6-5. Loop through steps S6-1 to S6-4 until preset assembly conditions are met to obtain a SAG assembly set; wherein the preset assembly conditions are set based on the total coverage length of the SAG assembly set, the number of SAGs in the SAG assembly set, and the alignment rate of the SAGs included in the SAG assembly set.

2. The method according to claim 1, characterized in that In step S2, the preset filtering conditions are set according to the detection depth of SNPs at different sites, and / or the number of mutations of SNPs at different sites, and / or the gene to which the SNPs belong.

3. The method according to claim 1, characterized in that Step S3 includes: S3-1. Calculate the mean and standard deviation of each characteristic SNP in the characteristic matrix; S3-2. Sort all characteristic SNPs by their standard deviations, select the first Q SNP characteristics with decreasing standard deviations from the largest to form an analysis matrix, and perform hierarchical clustering on SAGs according to the analysis matrix; S3-3. Determine the maximum number of strains Q traversed by the hierarchical clustering results; S3-4. Divide the hierarchical clustering results by the number of n strains, where n is any integer between 1 and Q; S3-5. The WSS score is used as an evaluation indicator to evaluate each division result. The calculation formula of the WSS score is: , in, WSS n is the WSS score when divided into n strain numbers; FeatureCount is the number of SNP features in the analysis matrix; Feature i is the value set of the i-th SNP feature in the analysis matrix; ClusterCenter m,i To analyze the characteristic center of the ith SNP feature of the mth strain when the matrix is ​​divided into n strains, the average value of the ith SNP feature of the SAG set of the mth strain is used as ClusterCenter m,i ; P m is the penalty score of the mth strain when the analysis matrix is ​​divided into n strains. m It is set according to the average value of each SNP feature in the analysis matrix, the number of SAGs in the analysis matrix, and the number of SAGs of the mth strain in the analysis matrix.

4. The method according to claim 3, characterized in that The P m The calculation formula is: , in, FeatureMean i is the average value of the ith SNP feature in the analysis matrix; SAGCount is the number of SAGs in the analysis matrix; SAGCount m The number of SAGs of strain number m in the analysis matrix; R is the penalty coefficient, and the value range of R is 0.1~10.

5. The method according to claim 1, characterized in that In step S5, the coverage of each SAG aligned to the species genome is defined as: , in, R p is the coverage of SAG number p; MappedCov p is the coverage length of SAG number p on the gene sequence of the species; UnmappedCov p It is the length of reads that SAG number p has not been mapped to the gene sequence of the species.

6. The method according to claim 1, characterized in that In S6-2, the calculation formula of the relative coverage ratio is: , in, D p,q is the first superposition length of the set of coverage areas of each SAG number q that is not currently included in the SAG assembly set and the set of coverage areas of the SAG number p; C p is the set of coverage areas of SAG number p; UnmappedCov p is the length of reads that SAG number p has not been mapped to the gene sequence of the species; In S6-4, the calculation formula of the effective coverage ratio is: , in, D q’, a is the second superposition length of the set of coverage areas of each SAG with number q' that is not included in the SAG assembly set in the current round a and the set of coverage areas of the SAG assembly set obtained in S6-3; C a is the set of coverage areas of the SAG assembly set obtained by S6-3 in the current round a; UnmappedCov p It is the length of reads that SAG number p has not been mapped to the gene sequence of the species.

7. The method according to claim 1, characterized in that The preset assembly condition is any one of the following (1) to (4): (1) The coverage area of ​​the SAG assembly set accounts for more than 95% of the gene sequence length of the species; (2) The number of SAGs in the SAG assembly set is greater than the set SAG number threshold; (3) The alignment rate of the SAG included in the SAG assembly set in round a+1 is less than the set alignment rate threshold; (4) All SAGs are included in the SAG assembly set.

8. The method according to claim 1, characterized in that Step S7 also includes: The species genome sequence is added as untrusted-contig or trusted-contig to the SAG assembly set for assembly.

9. The method according to claim 1, characterized in that Step S7 also includes: According to the cleaning threshold, the contigs obtained in the assembly process of step S7 are cleaned, and the cleaned contigs are assembled to obtain the genome sequence of the corresponding strain; The cleaning threshold includes a length threshold and / or a coverage threshold; The length threshold is set according to the length of the contig; The coverage threshold is set based on the coverage of the contig alignment to the species genome.