Protein sequence clustering method and system based on grouping
Protein sequence grouping is performed through segmentation and MinHash algorithms, combined with and search for optimization of grouping results, the calculation complexity and resource consumption problems of traditional clustering algorithms under large-scale data are solved, and efficient protein sequence clustering is achieved.
Patent Information
- Application Number
- CN202411487177.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-10-24
AI Technical Summary
Traditional protein sequence clustering algorithms have high computational complexity when processing large-scale data, resulting in increased time and excessive resource consumption, making it difficult to adapt to the needs of billions of sequences.
A group-based protein sequence clustering method is used to segment the protein sequence into subsequences, and hash mapping and grouping is used to reduce the computational complexity, and combine and search sets to combine and combine, and finally cluster the grouping results.
It significantly reduces the computational complexity and resource consumption, improves clustering speed and efficiency, maintains the accuracy of clustering results, adapts to the needs of large-scale data sets, and reduces false negative errors.
Smart Images

Figure CN119007838B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of protein sequence clustering, and in particular to a protein sequence clustering method and system based on grouping. Background Art
[0002] Protein clustering is a technique in bioinformatics that is used to group proteins based on the similarity of their sequences or structures. Through clustering, researchers can identify protein families with similar functions or evolutionary relationships, which can help researchers infer the functions of unknown proteins; clustering also helps identify evolutionarily conserved protein families and helps understand the evolutionary process of organisms; moreover, protein clustering can effectively reduce the number of sequences that need to be processed in downstream analysis, reduce data redundancy, and reduce computing and storage costs, which helps improve the efficiency of biological information analysis.
[0003] However, with the development of high-throughput sequencing technology, the scale of protein sequence data has exploded, which has brought many impacts on the clustering of protein sequences.
[0004] First, the large number of protein sequences will increase the time consumption of clustering algorithms, especially when faced with millions or even hundreds of millions of sequence data, the computational complexity will increase significantly. Taking the traditional greedy incremental clustering method as an example, this method compares the input sequence with the representative sequence of the established cluster. When the sequence meets the similarity standard with the representative sequence of a cluster, the sequence is added to the cluster; otherwise, the sequence becomes a new cluster representative. Since each sequence must be compared with the cluster representative, the time complexity is ,in, is the final number of clusters, is the sequence length. In protein sequence clustering, Usually with The size of the input sequence is similar, so the total running time increases almost quadratically as the input sequence increases. Increase.
[0005] Secondly, this will increase the demand for computing resources. Before processing clustering tasks, a large number of sequences need to be loaded into memory for fast comparison and clustering. The larger the data scale, the more memory is consumed, which will increase the time to access and process the sequences. In addition, since large-scale sequence data requires longer computing time, clustering requires more powerful computing resources, which may require more CPU cores and high-performance computing clusters.
[0006] Therefore, in the face of these challenges, the present invention needs to design a more efficient clustering algorithm to improve the clustering speed while minimizing resource consumption, so that the clustering of protein sequence data can better adapt to the needs of large-scale data sets and provide more powerful support for bioinformatics research. Summary of the invention
[0007] With the rapid increase in the number of protein sequences, the efficiency of traditional clustering algorithms has dropped significantly due to their high computational complexity, especially when processing billions of sequences. To solve this problem, the present invention designs a grouping-based protein sequence clustering method and system, aiming to reduce the computational complexity while maintaining the accuracy of the clustering results. The algorithm can effectively meet the clustering needs of large-scale data sets on the basis of optimizing the use of computing resources.
[0008] In one aspect, a protein sequence clustering method based on grouping is provided, comprising: (1) obtaining N protein sequences to be clustered; The protein sequences to be clustered are divided into several protein subsequences. All protein subsequences of the protein sequences to be clustered are summarized into the in a collection.
[0009] (2) For Each protein subsequence in the set is The hash function is used to perform hash mapping to obtain the hash value corresponding to each protein subsequence; select the The minimum value of the hash values corresponding to all protein subsequences in the set is taken as the The protein sequences to be clustered are MinHash value under a hash function.
[0010] (3) There are M kinds of hash functions in total, so we get The MinHash values of protein sequences to be clustered under M hash functions are obtained; and then the MinHash values of N protein sequences to be clustered under M hash functions are obtained.
[0011] (4) In Under the j-1 hash functions, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group; combined with the grouping results under the first j-1 hash functions, the grouping results initially formed under the j-th hash function are merged to obtain the grouping results under the j-th hash function.
[0012] (5) For M hash functions, repeat the process of (4) to obtain the final grouping result.
[0013] (6) Based on the final grouping results, the protein sequences in each group are clustered to obtain the clustering results.
[0014] On the other hand, a protein sequence clustering system based on grouping is provided, comprising: an acquisition module, which is configured to: acquire N protein sequences to be clustered; The protein sequences to be clustered are divided into several protein subsequences. All protein subsequences of the protein sequences to be clustered are summarized into the in a collection.
[0015] A mapping module is configured to: Each protein subsequence in the set is The hash function is used to perform hash mapping to obtain the hash value corresponding to each protein subsequence; select the The minimum value of the hash values corresponding to all protein subsequences in the set is taken as the The protein sequences to be clustered are MinHash value under a hash function.
[0016] The first judgment module is configured as follows: there are M kinds of hash functions in total, then the first The MinHash values of protein sequences to be clustered under M hash functions are obtained; and then the MinHash values of N protein sequences to be clustered under M hash functions are obtained.
[0017] The traversal module is configured as follows: Under the j-1 hash functions, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group; combined with the grouping results under the first j-1 hash functions, the grouping results initially formed under the j-th hash function are merged to obtain the grouping results under the j-th hash function.
[0018] The repetition module is configured to: for M types of hash functions, repeatedly traverse the module process to obtain a final grouping result.
[0019] The clustering module is configured to: cluster the protein sequences in each group according to the final grouping result to obtain a clustering result.
[0020] The above technical solution has the following advantages or beneficial effects: the large-scale protein clustering algorithm designed by this patent solves the scalability problem of traditional algorithms when clustering large-scale protein sequences, significantly reduces the computational complexity, and has no precision loss compared to traditional high-precision clustering methods; compared to low-precision clustering algorithms designed for large-scale data, this patent can effectively solve its precision loss and improve the sensitivity of clustering.
[0021] Specifically, the time complexity of sequence alignment of traditional classical clustering methods such as hierarchical clustering is , and the time complexity of the algorithm proposed in this patent is ,in is the number of groups. In practical applications, can be fixed to a constant of about 10, The size is close to The time complexity of the clustering method designed in this patent can be approximated as , when there are many sequences, it is significantly less complex than the traditional algorithm. Thanks to the reduced complexity, in actual tests, the efficiency of the software implemented based on this patented algorithm is significantly higher than the protein sequence clustering software based on the traditional algorithm.
[0022] The low-precision clustering algorithms currently designed for large-scale data, such as LinClust, use grouping schemes that have no strict mathematical guarantees and have a high probability of producing false negatives. The probability of a false negative for two sequences is For example, two sequences with a similarity of 90% are When is 10, the probability of a false negative is . BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0024] Figure 1 The figure is a flow chart of the overall method of the first embodiment.
[0025] Figure 2 This is a visualization diagram of the grouping process of Example 1.
[0026] Figure 3 This is a schematic diagram of constructing the MinHash value of the protein sequence in Example 1 under a specific hash function. DETAILED DESCRIPTION
[0027] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0028] Embodiment 1, as Figure 1 As shown, this embodiment provides a protein sequence clustering method based on grouping, including: S101: obtaining N protein sequences to be clustered; The protein sequences to be clustered are divided into several protein subsequences. All protein subsequences of the protein sequences to be clustered are summarized into the in a collection.
[0029] S102: Each protein subsequence in the set is The hash function is used to perform hash mapping to obtain the hash value corresponding to each protein subsequence; select the The minimum value of the hash values corresponding to all protein subsequences in the set is taken as the The protein sequences to be clustered are MinHash value under a hash function.
[0030] S103: There are M types of hash functions in total, so we get The MinHash values of protein sequences to be clustered under M hash functions are obtained; and then the MinHash values of N protein sequences to be clustered under M hash functions are obtained.
[0031] S104: Under the j-1 hash functions, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group; combined with the grouping results under the first j-1 hash functions, the grouping results initially formed under the j-th hash function are merged to obtain the grouping results under the j-th hash function.
[0032] S105: Repeat the process of S104 for M types of hash functions to obtain the final grouping result.
[0033] S106: Based on the final grouping result, cluster the protein sequences in each group to obtain a clustering result.
[0034] Furthermore, in S103, there are M types of hash functions, and the first The MinHash values of the protein sequences to be clustered under M hash functions include: judging whether all hash functions have participated in the hash mapping, if so, it means that the hash mapping is finished and enters S104; if not, the current hash function is replaced with the next hash function and the step of S102 is repeated.
[0035] Further, the Under the hash function, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group. Then, the protein sequences in each group are clustered to obtain the clustering result, and the method further includes: S104-5: judging whether the traversal of all hash functions has been completed, if so, the grouping is completed and the process goes to S105; if not, the current hash function is replaced with the next hash function and the step of S104 is repeated.
[0036] Furthermore, the S101: obtain N protein sequences to be clustered, wherein the protein sequences to be clustered include: a unique identifier of the protein, the length of the protein sequence and the amino acid sequence of the protein; the unique identifier of the protein is the record number of the protein in the database.
[0037] Further, the S101: The method comprises the following steps: segmenting a protein sequence to be clustered to obtain a plurality of protein subsequences, including: setting the size of a sliding window and a sliding step of the sliding window, sliding the sliding window from left to right on the protein sequence, and taking the data in the sliding window as a protein subsequence after segmentation for each sliding step. After sliding for a plurality of steps, a plurality of protein subsequences are obtained.
[0038] Further, the S102: Each protein subsequence in the set is A hash function is used to perform hash mapping to obtain a hash value corresponding to each protein subsequence; the hash function refers to: an integer hash function and a universal hash function.
[0039] Among them, the universal hash function uses xxHash as the basic hash function, combined with M random seed sequences generated by a pseudo-random number generator, to simulate the generation of M 64-bit random hash values.
[0040] Among them, the integer hash function first converts the amino acid sequence into a 64-bit integer code, and then uses the Jenkins hash algorithm to simulate the generation of M 64-bit random hash values based on the integer code and M random seed sequences generated by a pseudo-random number generator.
[0041] Further, the S102: selecting the The minimum value of the hash values corresponding to all protein subsequences in the set is taken as the The protein sequences to be clustered are The MinHash value under a hash function; the MinHash value refers to the minimum hash value.
[0042] Further, in S103: assuming that there are M types of hash functions, the first The MinHash values of protein sequences to be clustered under M hash functions, where the M hash functions are obtained by using xxHash or Jenkins hash algorithm as the basic hash function and combining M random seed sequences generated by the pseudo-random number generator mt19937 to simulate M different hash functions.
[0043] Furthermore, the S104: classifying the protein sequences to be clustered with the same MinHash value into the same group includes: using several queues to store grouping information, one queue corresponding to one group; for each MinHash value, first check whether it already exists in the queue, if so, add the protein sequence number to be clustered corresponding to the MinHash value to the corresponding queue; if it does not exist in the queue, it means that the current MinHash value is a new MinHash value; take the current MinHash value as a new group, and add the protein sequence number to be clustered corresponding to the MinHash value to the new queue.
[0044] Further, the S104: in the Under this hash function, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group. This process is called a round. After that, it also includes: after each round of traversal is completed, the grouping result of the current round is merged with the grouping result of the previous round through union-find to obtain the grouping result.
[0045] Furthermore, the grouping result of the current round is merged with the grouping result of the previous round by union-find, specifically including: at the end of each round, for the generated grouping results, all sequences except the head element in each queue are traversed in turn, with the purpose of merging all sets involved in one queue into one group.
[0046] Each time you traverse, you will perform a union-find merge between the current sequence and the head element of the queue: First, find the root nodes of the two elements through a search operation; if a sequence is a group by itself, its root node is itself. If the root nodes of the two sequences are the same, it means that they already belong to the same set, and no further operation is required, and the next element will be processed; if the root nodes are different, it means that they belong to different sets, and the two sets will be merged into one set.
[0047] When merging, compare the depths of the two root nodes. The greater the depth, the more sequences the set contains. Select the root node with the greater depth as the new root node to complete the set merge.
[0048] After traversing and merging all sequences, multiple tree structures are finally formed, representing the grouping results of the sequences.
[0049] Furthermore, the S106: clustering the protein sequences in each group to obtain a clustering result, wherein the clustering is performed using a greedy algorithm.
[0050] Furthermore, the S106: clustering the protein sequences in each group to obtain clustering results specifically includes: sorting the protein sequences in each group from long to short according to length, selecting the longest sequence as the cluster center, comparing the protein sequence to be clustered with the protein sequence of the cluster center, if the number of identical characters of the two protein sequences exceeds a set threshold, it indicates that the protein sequence to be clustered and the protein sequence of the cluster center are of the same category.
[0051] The beneficial effect of the above technical solution is that before clustering large-scale protein sequences, the protein sequences are first grouped. Through grouping, sequences with higher similarity can be grouped together in advance. In the subsequent clustering process, clustering analysis is performed on the sequences in a single group respectively, thereby reducing the complexity of the clustering algorithm and effectively reducing the computational and memory overhead of large-scale protein sequence clustering analysis.
[0052] For In the case of protein sequences, the time complexity of grouping is ,in Indicates the number of hash functions selected for grouping, Indicates the length of the sequence. A smaller value can ensure a higher grouping accuracy (i.e., the probability that sequences with potential similarity are grouped in the same group).
[0053] In principle, given a , the minimum Jaccard similarity allowed between sequences while ensuring a high accuracy rate for This means that when When the sequence similarity exceeds 10%, the grouping strategy of the present invention can correctly group the sequences.
[0054] In general, cluster analysis usually focuses on sequences with high similarity. The grouping scheme in the case of a smaller number can meet the clustering requirements. After grouping, the number of sequences in each group is usually much smaller than the number of original sequences, so the algorithm complexity of clustering after grouping will be greatly reduced.
[0055] The initial protein sequence is input in the format of a FASTA file. For each sequence, a sliding window method is used to construct a k-mer set of the sequence. The hash function is used to map the k-mers in the k-mer set to integer hash values one by one. Among the multiple hash values generated, the smallest hash value is selected as the MinHash value of the sequence under the current hash function. Therefore, they are grouped into the same group during the grouping process. The visualization process is as follows: Figure 2 After grouping, each group of sequences is clustered separately.
[0056] The principle of grouping is based on the MinHash algorithm, which calculates hash values for two k-mer sets and takes the minimum hash value for comparison. The probability that the two minimum hash values of two sets are equal is equal to their Jaccard similarity. In protein clustering, Jaccard similarity is used to measure the similarity of two protein sequences. By representing protein sequences as a set of k-mer sets, Jaccard similarity can quantify the shared features between them. The higher the similarity, the greater the overlap of the sequences, and the higher the possibility of being classified into the same category. Based on the above principles, the present invention can determine whether the sequences have potential similarities through the MinHash collision between the two sequences. Once any hash collision occurs between the sequences, they are classified into the same group.
[0057] Assume that the Jaccard similarity of two sequences is is 0.9. Under a specific hash function, the probability that two protein sequences with a similarity of more than 90% have the same MinHash value is , the probability of being unequal is 0.1; that is, the probability of being assigned to a group is 0.9, and the probability of not being assigned to a group is 0.1.
[0058] Assuming that M hash functions are used, as long as the MinHash values of two protein sequences are equal under any hash function, the two sequences will be divided into the same group. Therefore, only sequences without MinHash collision under M hash functions will be divided into different groups. The probability formula is .
[0059] When the Jaccard index is 0.9, the probability that two sequences with a similarity of 90% are divided into different groups is Under this classification strategy, based on the above theory, it can be effectively guaranteed that the sequences between groups are almost impossible to have a similarity of more than 90%. This means that in the clustering process, the sequences between groups do not belong to the same category.
[0060] The present invention uses the MinHash algorithm to construct a sketch of a protein sequence. Based on the input large-scale protein sequence FASTA file, a k-mer set is first constructed for each protein sequence using a sliding window method. Based on the obtained k-mer set, for each protein sequence, the hash function first maps the k-mer in the set to a hash value, and then selects the smallest hash value from it as the MinHash value under this hash function, such as Figure 3 As shown in the figure, assuming that M hash functions are used, each sequence will eventually get a MinHash value set of length M, which is the sketch of the sequence.
[0061] After generating the sketch of the protein sequence, the present invention groups the sequences according to the equal values in the MinHash value set. When grouping, it is necessary to traverse the MinHash values of all sequences corresponding to each hash function, and put the sequences with hash collision (having the same hash value) into the same group. This process is called a round. After each round of traversal, the grouping results of the current round and the previous round are dynamically merged through the union-find set.
[0062] In the grouping process, each round of traversal uses an unordered hash table unordered map to store grouping information. The present invention uses the MinHash value as the group ID. During traversal, for each MinHash value, the present invention first checks whether it already exists in the hash table map. If it exists, the ID of the current protein sequence is added to the corresponding queue; if it is a new MinHash value, the MinHash value is inserted into the map as a new group, and then the sequence ID is added to the queue to ensure efficient search and update in subsequent processing. Unordered hash table, where the key value of the hash table is MinHash (minimum hash value), and the value is a protein sequence list.
[0063] After each round of grouping is completed, based on the grouping result map obtained in the current round, the protein sequence IDs in each group are merged using the union-find method to ensure that these sequences belong to the same set. In this way, the grouping results of the current round can be dynamically merged with the results of the previous round, ensuring that the grouping information between different rounds is consistent and further optimizing the grouping structure.
[0064] To simplify the grouping process, only the custom protein sequence ID is retained as the unique identifier. After the final grouping information is generated, the corresponding sequence information (such as sequence name and content) is found according to the protein sequence ID within the group. The protein sequence information of each group is then organized into independent FASTA files and clustered separately. This method ensures that complete protein information can be retained for subsequent analysis while quickly grouping.
[0065] After obtaining the grouped sequences, the present invention can use a classical clustering algorithm for analysis. Here, the heuristic greedy incremental method is taken as an example to gradually build clusters for each group: first, a subsequence set with a length of k is built for all protein sequences.
[0066] Then, all sequences in each group are sorted by length, and the longest sequence among the unclustered sequences is selected as the representative sequence (clustering center), because generally speaking, the longer the sequence, the more effective information it contains.
[0067] When processing the sorted new sequences one by one, each sequence is compared with the existing cluster center. If the two sequences share a certain number of identical subsequences, a further global comparison is performed; otherwise, the current sequence becomes the new cluster center.
[0068] Only when the ratio of identical characters in the two sequences in the global comparison exceeds the clustering threshold are they classified into the same class. The clustering threshold is a similarity standard set by the present invention for determining whether two protein sequences should be classified into the same class.
[0069] Since there is no overlap in clustering information between the groups after grouping, there is no need for communication between cores when using a multi-core platform to parallelly process the clustering of each group of sequences. This grouping method effectively reduces communication overhead and allows multiple groups to perform calculations independently, thereby maximizing the efficiency of parallel processing. This design not only fully utilizes the computing power of the multi-core platform, but also ensures that no additional synchronization costs are incurred during parallel computing, thereby improving overall performance.
[0070] Embodiment 2: This embodiment provides a protein sequence clustering system based on grouping, including: an acquisition module, which is configured to: acquire N protein sequences to be clustered; The protein sequences to be clustered are divided into several protein subsequences. All protein subsequences of the protein sequences to be clustered are summarized into the in a collection.
[0071] A mapping module is configured to: Each protein subsequence in the set is The hash function is used to perform hash mapping to obtain the hash value corresponding to each protein subsequence; select the The minimum value of the hash values corresponding to all protein subsequences in the set is taken as the The protein sequences to be clustered are MinHash value under a hash function.
[0072] The first judgment module is configured as follows: there are M kinds of hash functions in total, then the first The MinHash values of protein sequences to be clustered under M hash functions are obtained; and then the MinHash values of N protein sequences to be clustered under M hash functions are obtained.
[0073] The traversal module is configured as follows: Under the j-1 hash functions, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group; combined with the grouping results under the first j-1 hash functions, the grouping results initially formed under the j-th hash function are merged to obtain the grouping results under the j-th hash function.
[0074] The repetition module is configured to: for M types of hash functions, repeatedly traverse the module process to obtain a final grouping result.
[0075] The clustering module is configured to: cluster the protein sequences in each group according to the final grouping result to obtain a clustering result.
[0076] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A grouping-based protein sequence clustering method characterized by: include: (1): Obtain N protein sequences to be clustered; For The protein sequences to be clustered are divided into several protein subsequences. All protein subsequences of the protein sequences to be clustered are summarized into the In a collection; (2): For Each protein subsequence in the set is The hash function is used to perform hash mapping to obtain the hash value corresponding to each protein subsequence; select the The minimum value of the hash values corresponding to all protein subsequences in the set is taken as the The protein sequences to be clustered are MinHash value under a hash function; (3): There are M kinds of hash functions, so we get The MinHash values of protein sequences to be clustered under M hash functions are obtained; and then the MinHash values of N protein sequences to be clustered under M hash functions are obtained; (4) In Under this hash function, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group; Combine the grouping results under the first j-1 hash functions, merge the grouping results initially formed under the jth hash function, and obtain the grouping results under the jth hash function; (5) Repeat the process of (4) for M hash functions to obtain the final grouping result; (6) Based on the final grouping results, the protein sequences in each group are clustered to obtain the clustering results.
2. The protein sequence clustering method based on grouping as claimed in claim 1, characterized in that: (3), there are M kinds of hash functions, so we get The MinHash values of protein sequences to be clustered under M hash functions, including: Determine whether all hash functions have participated in the hash mapping. If so, it means that the hash mapping is completed and go to (4); if not, replace the current hash function with the next hash function and repeat step (2).
3. The protein sequence clustering method based on grouping as claimed in claim 1, characterized in that: As stated in Under the hash function, after traversing the MinHash values corresponding to all protein sequences to be clustered and classifying the protein sequences to be clustered with the same MinHash value into the same group, the protein sequences in each group are clustered to obtain the clustering result, and the method further includes: (4-5): Determine whether all hash functions have been traversed. If so, the grouping ends and enters (5). If not, replace the current hash function with the next hash function and repeat step (4).
4. The protein sequence clustering method based on grouping as claimed in claim 1, characterized in that: Obtaining N protein sequences to be clustered, wherein the protein sequences to be clustered include: a unique identifier of the protein, a length of the protein sequence, and an amino acid sequence of the protein; the unique identifier of the protein is a record number of the protein in a database; For The method comprises the following steps: segmenting a protein sequence to be clustered to obtain a plurality of protein subsequences, including: setting the size of a sliding window and a sliding step of the sliding window, sliding the sliding window from left to right on the protein sequence, and taking the data in the sliding window as a protein subsequence after segmentation for each sliding step. After sliding for a plurality of steps, a plurality of protein subsequences are obtained.
5. The protein sequence clustering method based on grouping as claimed in claim 1, characterized in that: For Each protein subsequence in the set is A hash function is used to perform hash mapping to obtain the hash value corresponding to each protein subsequence; The hash function refers to: an integer hash function and a universal hash function; wherein the universal hash function uses xxHash as a basic hash function, combined with M random seed sequences generated by a pseudo-random number generator, to simulate the generation of M 64-bit random hash values; Among them, the integer hash function first converts the amino acid sequence into a 64-bit integer code, and then uses the Jenkins hash algorithm to simulate the generation of M 64-bit random hash values based on the integer code and M random seed sequences generated by a pseudo-random number generator.
6. The protein sequence clustering method based on grouping as claimed in claim 1, characterized in that: The protein sequences to be clustered with the same MinHash value are grouped into the same group, including: Use several queues to store group information, one queue corresponds to one group; For each MinHash value, first check whether it already exists in the queue. If it does, add the protein sequence number to be clustered corresponding to the MinHash value to the corresponding queue; If it does not exist in the queue, it means that the current MinHash value is a new MinHash value; the current MinHash value is used as a new group, and the protein sequence number to be clustered corresponding to the MinHash value is added to the new queue.
7. The protein sequence clustering method based on grouping as claimed in claim 1, characterized in that: In the Under this hash function, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group. This process is called a round. After that, it also includes: after each round of traversal is completed, the grouping result of the current round is merged with the grouping result of the previous round through union-find to obtain the grouping result.
8. The protein sequence clustering method based on grouping as claimed in claim 7, characterized in that: The method of merging the grouping result of the current round with the grouping result of the previous round by union-find specifically includes: At the end of each round, for the generated grouping results, all sequences except the head element in each queue are traversed in turn, with the goal of merging all sets involved in a queue into one group; Each time the traversal is performed, the current sequence is combined with the head element of the queue by a union-lookup operation: first, the root nodes of the two elements are found through a search operation; if a sequence is a group by itself, its root node is itself; if the root nodes of the two sequences are the same, it means that they already belong to the same set, and no further operation is required, and the next element is processed; if the root nodes are different, it means that they belong to different sets, and the two sets are merged into one set; When merging, compare the depths of the two root nodes. The greater the depth, the more sequences the set contains. Select the root node with the greater depth as the new root node to complete the set merge. After traversing and merging all sequences, multiple tree structures are finally formed, representing the grouping results of the sequences.
9. The protein sequence clustering method based on grouping as claimed in claim 1, characterized in that: Cluster the protein sequences in each group to obtain clustering results, including: The protein sequences of each group are sorted from long to short according to their length, and the longest sequence is selected as the clustering center. The protein sequence to be clustered is compared with the protein sequence of the clustering center. If the number of identical characters in the two protein sequences exceeds the set threshold, it means that the protein sequence to be clustered and the protein sequence of the clustering center are of the same category.
10. A grouping-based protein sequence clustering system characterized by: include: An acquisition module is configured to: acquire N protein sequences to be clustered; For The protein sequences to be clustered are divided into several protein subsequences. All protein subsequences of the protein sequences to be clustered are summarized into the In a collection; A mapping module is configured to: Each protein subsequence in the set is The hash function is used to perform hash mapping to obtain the hash value corresponding to each protein subsequence; select the The minimum value of the hash values corresponding to all protein subsequences in the set is taken as the The protein sequences to be clustered are MinHash value under a hash function; The first judgment module is configured as follows: there are M kinds of hash functions in total, then the first The MinHash values of protein sequences to be clustered under M hash functions are obtained; and then the MinHash values of N protein sequences to be clustered under M hash functions are obtained; The traversal module is configured as follows: Under this hash function, the MinHash values corresponding to all protein sequences to be clustered are traversed, and the protein sequences to be clustered with the same MinHash value are classified into the same group; Combine the grouping results under the first j-1 hash functions, merge the grouping results initially formed under the jth hash function, and obtain the grouping results under the jth hash function; A repeating module is configured to: for M hash functions, repeatedly traverse the module process to obtain a final grouping result; The clustering module is configured to: cluster the protein sequences in each group according to the final grouping result to obtain a clustering result.
