Protein family automatic clustering method, system and equipment and storage medium
By generating embedding vectors using a protein language model and combining them with a hierarchical clustering algorithm, the problems of insufficient distant homology identification and fixed parameter adaptability in protein family classification are solved, thus achieving more accurate protein family classification.
Patent Information
- Application Number
- CN202512038091.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies have limited ability to identify distant homologous proteins in protein family classification. Fixed clustering parameters lack adaptability, making it difficult to accurately identify distant homologous proteins with low sequence consistency, resulting in inaccurate classification results.
The protein language model is used to generate embedding vectors, Euclidean distance is used to measure protein sequence similarity, and a hierarchical clustering algorithm is used to construct a tree structure. Adaptive clustering parameters are used to perform layer-by-layer clustering until the clustering termination condition is reached.
It improves the ability to identify distant homologs, avoids the partitioning bias caused by fixed clustering parameters, and enhances the accuracy and adaptability of protein family partitioning.
Smart Images

Figure CN121905283A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of bioinformatics technology, and specifically relates to a method, system, device and storage medium for automatic clustering of protein families. Background Technology
[0002] Protein families are groups of proteins that originated from a common evolutionary ancestor. Members of the same family typically share a certain degree of similarity in sequence, structure, and function. Based on the closeness of their homology, protein families can be further divided into superfamilies, families, and subfamilies. The higher the level, the lower the sequence similarity and the more distant the evolutionary relationship among its members. In practical research, the Sequence Similarity Network (SSN) approach is often used to identify protein families and their internal hierarchical relationships. This method calculates the similarity score between pairwise protein sequences through sequence alignment and sets a connection threshold. Only when the alignment score is higher than the threshold are the two sequences connected using that score as the weight, thus constructing an SSN. Then, methods such as network clustering are used to divide the SSN into several independent modules, each typically representing a functionally or evolutionarily related protein family or subfamily.
[0003] With the rapid development of high-throughput sequencing technology, the number of protein sequences worldwide has grown exponentially, and public databases have accumulated massive amounts of protein information. In large-scale protein studies, it is typically necessary to first use sequence clustering tools such as MMseqs2 and CD-HIT to cluster the dataset based on the consistency between protein sequences. Then, a representative sequence is selected from each cluster according to the chosen clustering algorithm for redundancy removal and subsequent analysis, thereby reducing computational redundancy and analytical bias caused by repetitive sequences. After redundancy removal, a sequence similarity network (SSN) is constructed based on these representative sequences, and the SSNs are clustered under fixed clustering parameters to obtain family classification results. However, existing methods for constructing SSNs based on sequence alignment for family classification have the following limitations: 1. Limited ability to identify distant homology: When the similarity between protein sequences is higher than about 30%, alignment-based homology detection can reliably determine homology relationships. However, when the similarity is lower than 30%, sequence similarity-based methods struggle to accurately identify homology relationships, making it difficult to correctly detect distant homologous proteins. Therefore, in SSNs, the connections between low-consistency sequences are often weakened or lost, thus severing true homology relationships within the network.
[0004] 2. Using fixed clustering parameters for SSN family classification lacks adaptability; In the process of protein family classification, network-based clustering methods are often used to classify SSNs into families. However, different protein families vary significantly in terms of sequence conservation and functional diversity. If fixed clustering parameters are used, it may lead to some families being difficult to distinguish, or families being over-classified, affecting the accuracy of the classification results.
[0005] 3. Distant homologous sequences with low sequence similarity are difficult to analyze using SSNs. In ultra-large datasets containing multiple different protein families, redundancy removal is usually performed at a lower consistency threshold to control the number of proteins analyzed subsequently. However, this method results in low sequence similarity in the final dataset, thus affecting the effectiveness of SSN-based protein family segmentation. Summary of the Invention
[0006] This application provides an automatic clustering method, system, device, and storage medium for protein families, aiming to at least partially solve one of the aforementioned technical problems in the prior art.
[0007] To address the above problems, this application provides the following technical solution: An automated protein family clustering method, characterized by comprising: The protein sequences to be clustered are input into the protein language model for vector embedding to generate embedding vectors for the protein sequences. The distance between any two protein sequences is calculated based on the embedding vectors of the protein sequences, and the pairwise distance between the two protein sequences is obtained. The similarity between the protein sequences is measured based on the pairwise distance. Based on the similarity, a hierarchical clustering algorithm is used to perform bottom-up hierarchical clustering on the embedding vectors of all protein sequences to construct a tree structure of the protein sequences. Based on the tree structure of the protein sequence, the clustering is performed layer by layer according to the set clustering parameters. Classes that meet the clustering parameters are classified into the same protein family until the clustering termination condition is met, at which point the clustering ends.
[0008] The technical solution adopted in this application embodiment further includes: inputting the protein sequence to be clustered into the protein language model for vector embedding to generate the embedding vector of the protein sequence, specifically as follows: A single protein sequence containing m amino acids After inputting the protein language model, the output of the final layer of the protein language model is taken to obtain each residue. 1280-dimensional embedding vector Generate the protein sequence The dimension is ; The protein sequence is obtained by performing average pooling on the vector matrix. Embedded vector :
[0009] The technical solution adopted in this application embodiment further includes: calculating the distance between pairs of protein sequences based on the embedding vector of the protein sequence to obtain the pairwise distance between pairs of protein sequences, specifically: The two protein sequences The distance between them is expressed in Euclidean distance as:
[0010] The technical solution adopted in this application embodiment further includes: performing bottom-up hierarchical clustering of the embedding vectors of all protein sequences based on the similarity using a hierarchical clustering algorithm to construct a tree structure of the protein sequences, specifically: All protein sequences Initialize as n disjoint single-element clusters of size 1, where n is the number of the protein sequences; In hierarchical clustering, each iteration selects the two closest clusters for merging until all protein sequences have been merged, resulting in n-1 merging operations. The cluster pair from the k-th (k=1, 2, ..., n-1)th merge is denoted as [k-1, ..., n-1]. p,q for ), its merging distance is According to the cluster pair merging order Establish the node connection order and its corresponding merge distance. To generate a tree structure of the protein sequence, wherein each node of the tree structure represents a merged cluster pair. The corresponding height is .
[0011] The technical solution adopted in this application embodiment further includes: in the hierarchical clustering process, the distance d between two clusters of arbitrary sizes A and B ( , for:
[0012] The technical solution adopted in this application embodiment further includes: the set clustering parameters include the initial clustering partition value, the clustering partition interval, and the minimum number of samples, wherein the initial clustering partition value represents the number of clusters at the beginning of the clustering partition, the clustering partition interval represents the number of additional clusters added in the next clustering partition, and the minimum number of samples represents that after each clustering partition, only representative sequences are selected from the clusters whose size is less than or equal to the value, and the clustering termination condition is reached when all cluster sizes are less than or equal to the minimum number of samples.
[0013] The technical solution adopted in this application embodiment further includes: the tree structure based on the protein sequence is divided into layers according to the set clustering parameters, specifically: Clustering is initiated using the initial clustering partition value to generate a first set number of clusters; The initial clustering partition value is added to the clustering partition interval to obtain the current stage clustering partition value. Clustering is then started with the current stage clustering partition value to generate a second set number of classes. The classes with sizes less than or equal to the minimum sampling number in the second set number of generated classes are selected for embedding vector center calculation. The protein sequence corresponding to the embedding vector closest to the embedding vector center is selected as the representative sequence of the class. The classes with sizes greater than the minimum sampling number in the second set number of classes are retained to enter the next stage. The clustering partition value from the previous stage is added to the clustering partition interval to obtain the new clustering partition number. Clustering is then started with the new current clustering partition value to generate a third set number of clusters. If there are still clusters in the third set number of clusters whose size is less than or equal to the minimum sampling number, the previous step is repeated. If there are no clusters, the clustering ends.
[0014] Another technical solution adopted in this application embodiment is: an automatic protein family clustering system, comprising: Embedding vector calculation module: used to input the protein sequence to be clustered into the protein language model for vector embedding and generate the embedding vector of the protein sequence; Distance calculation module: used to calculate the distance between two protein sequences based on the embedding vector of the protein sequence, to obtain the pairwise distance between two protein sequences, and to measure the similarity between protein sequences based on the pairwise distance; Hierarchical clustering module: used to perform bottom-up hierarchical clustering of the embedding vectors of all protein sequences based on the similarity using a hierarchical clustering algorithm, and to construct a tree structure of the protein sequences; Protein family partitioning module: Based on the tree structure of the protein sequence, it performs layer-by-layer clustering according to the set clustering parameters, classifying classes that meet the clustering parameters into the same protein family, until the clustering termination condition is met and the clustering ends.
[0015] Another technical solution adopted in this application embodiment is: a device, the device including a processor and a memory coupled to the processor, wherein, The memory stores program instructions for implementing the automatic clustering method for the protein family; The processor is used to execute the program instructions stored in the memory to control the automatic clustering method for protein families.
[0016] Another technical solution adopted in this application embodiment is: a storage medium storing processor-executable program instructions, the program instructions being used to execute the automatic clustering method for protein families.
[0017] Compared to existing technologies, the beneficial effects of the embodiments of this application are as follows: The protein family automatic clustering method, system, device, and storage medium of this application utilize embedding vectors generated by PLM to represent each protein sequence. The similarity between protein sequences is measured by the distance between embedding vectors. Based on the similarity, a hierarchical clustering algorithm is used to construct a tree structure to highlight the hierarchical relationship of protein families. The hierarchical clustering algorithm performs multi-level and adaptive clustering of protein sequences, and by setting parameters, classes that meet a certain size are grouped into the same protein family. This application enhances the ability to identify distant homology while avoiding the segmentation bias caused by the inability of fixed clustering parameters to simultaneously adapt to the inconsistent degree of difference between different protein families and within each family, thus improving the accuracy of protein family segmentation. Attached Figure Description
[0018] Figure 1 This is a schematic flowchart of the automatic protein family clustering method according to an embodiment of this application; Figure 2 A schematic diagram illustrating the vector embedding generation process for a single protein sequence; Figure 3 A schematic diagram showing family coverage and family purity under different representative sequence intervals; Figure 4 A schematic diagram showing the distribution of family coverage and family purity for representative classes; Figure 5 This is a schematic diagram illustrating the effect of different parameters of this application on the number of representative sequences; Figure 6 A schematic diagram illustrating the effects of different parameter combinations on family coverage and average family purity; Figure 7 This is a schematic diagram showing the distribution of representative sequences in a phylogenetic tree constructed using all Cas1 and Cas9 protein family sequences, with the parameter combination of initial clustering value = 1000, clustering interval = 1000, and minimum number of samples = 30. Figure 8 This is a schematic diagram of the structure of the automatic protein family clustering system according to an embodiment of this application; Figure 9 This is a schematic diagram of the device structure according to an embodiment of this application; Figure 10 This is a schematic diagram of the structure of the storage medium according to an embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0020] The terms "first," "second," and "third" in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0021] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0022] Specifically, please refer to Figure 1 This is a flowchart of an automatic protein family clustering method according to an embodiment of this application. The automatic protein family clustering method according to an embodiment of this application includes the following steps: S100: Obtain the protein sequence to be clustered, input the protein sequence into PLM (Protein Language Model) for vector embedding, and generate the embedding vector of the protein sequence. In this step, the type of PLM can be selected as needed; in this application, the ESM-2 model is preferred. For example... Figure 2 The diagram illustrates the vector embedding generation process of a single protein sequence. The specific generation process includes: embedding a single protein sequence containing m amino acids... After inputting the ESM-2 model, take the output of the final layer of the model (ignore) <cls>Lexical elements and <eos>(Word embedding vectors) to obtain the embedding vectors of each residue 1280-dimensional embedding vector Generate protein sequences The dimension is The vector matrix is then subjected to average pooling to obtain the protein sequence. Embedded vector Specifically, as shown in formula (1): (1) S110: Calculate the distance between pairs of protein sequences based on the embedding vectors of the protein sequences to obtain the pairwise distance between the protein sequences, and measure the similarity between the protein sequences based on the pairwise distance; In this step, assuming the total number of protein sequences is n, the number of pairwise distances obtained is... Among them, the protein sequences of each pair The distance between them is represented by Euclidean distance, as shown in formula (2): (2) It is understood that this application uses PLM to measure the similarity between protein sequences, which can improve the ability to identify distantly homologous sequences.
[0023] S120: Based on similarity, a hierarchical clustering algorithm is used to perform bottom-up hierarchical clustering of the embedding vectors of all protein sequences to construct a tree structure of protein sequences; In this step, the hierarchical clustering algorithm specifically involves: first, all protein sequences... Initialize into n disjoint single-element clusters of size 1; during hierarchical clustering, the distance d between any two clusters of sizes A and B is... , Defined as: (3) In hierarchical clustering, each iteration selects the two closest clusters for merging, and this process is repeated until all protein sequences have been merged, resulting in a total of n-1 merges. Let the cluster pair from the k-th (k=1, 2, ..., n-1) merge be denoted as... p,q for ), its merging distance is According to the cluster pair merging order Establish the node connection order and its corresponding merge distance. To generate highly detailed tree structures of protein sequences, the hierarchical relationships between protein families are highlighted through these structures. Each node in the tree structure represents a merged cluster pair. The corresponding height is .
[0024] It should be noted that in other embodiments of this application, top-down split hierarchical clustering algorithms such as bisecting K-means can also be used to construct a tree structure of protein sequences. As long as the clustering algorithm can generate a tree structure, it is compatible with the adaptive protein family division mechanism of this application.
[0025] S130: Based on the tree structure of protein sequences, the clustering is performed layer by layer according to the set clustering parameters. Classes that meet the clustering parameters are classified into the same protein family until the size of all classes generated by the clustering is less than or equal to the minimum number of samples. In this step, the clustering parameters set during clustering include the initial clustering value, the clustering interval, and the minimum number of samples. The initial clustering value represents the number of clusters at the beginning of the clustering process. The clustering interval represents the number of additional clusters to be added in the next clustering. The minimum number of samples represents the number of representative sequences selected from clusters whose size is less than or equal to the minimum number of samples after each clustering. When the size of all clusters is less than or equal to the minimum number of samples, the clustering termination condition is met, and the subdivision will not continue. The protein family clustering process ends.
[0026] Specifically, taking an initial clustering value of 2, a clustering interval of 3, and a minimum sampling number of 5 as an example, the protein family clustering process in this embodiment includes: S131: Start clustering based on the initial clustering partition value to generate a first set number of clusters (2 clusters); since the size of each cluster is greater than the minimum number of samples, no representative sequence selection is performed; S132: Add the initial clustering partition value to the clustering partition interval as the current stage clustering partition value, and start clustering with the current stage clustering partition value to generate a second set number of classes (5 classes). S133: Select classes from the generated second set number of classes whose size is less than or equal to the minimum sampling number and calculate the embedding vector center. Select the protein sequence corresponding to the embedding vector closest to the embedding vector center as the representative sequence of the class. At the same time, retain classes from the second set number of classes whose size is greater than the minimum sampling number to enter the next stage. The embedding vector center is defined as follows: for a cluster containing N protein sequences (N is less than or equal to the minimum number of samples) The embedding vector for each protein sequence within this cluster is: Then the embedding vector center It is defined as the mean of each embedding vector, as shown in formula (4): (4) Assuming that the sizes of classes 1, 2, 3, and 4 are all less than or equal to the minimum sampling number, then embedding vector centers are calculated for classes 1, 2, 3, and 4 respectively. The protein sequence corresponding to the embedding vector closest to the embedding vector center is selected as the representative sequence for each class, resulting in four representative sequences. If the size of class 5 is greater than the minimum sampling number, then class 5 is retained for the next stage. Classes whose representative sequences have already been selected in this stage do not participate in subsequent clustering.
[0027] S134: Add the clustering partition value of the previous stage to the clustering partition interval to obtain the new clustering partition number, and start clustering with the new current clustering partition value to generate the third set number of classes (8 classes). S135: Determine whether there are any classes in the generated third set number of classes whose size is less than or equal to the minimum sample number. If they exist, re-execute S133; otherwise, the clustering division ends.
[0028] Since 6 out of the 8 classes generated in this stage are derived from classes whose representative sequences were already selected in the previous stage, no further representative sequence selection is performed. For classes that did not have a representative sequence selected, the previous steps of calculating embedding vector centers and selecting representative sequences are repeated. This process is repeated until the size of all generated classes is less than or equal to the minimum sample size, at which point further subdivision is stopped, and the clustering process ends.
[0029] It is understood that after performing hierarchical clustering on the embedding vectors of protein sequences, this application introduces the initial clustering partition value, the clustering partition interval, and the minimum number of samples as adaptive partitioning conditions, gradually increasing the number of clustering partitions from top to bottom, and dynamically deciding whether to continue partitioning downwards based on the size of each class. This can automatically adapt to the protein family partitioning of different protein families, thereby avoiding the partitioning bias caused by the inability of fixed clustering parameters to simultaneously adapt to the inconsistent degree of difference between different protein families and within each family.
[0030] It should be noted that the minimum number of samples can be adjusted based on the actual data situation during each stage of clustering, or replaced or supplemented by other segmentation conditions. For example, when obtaining external annotation information for protein sequences, "annotation purity reaching a certain threshold" can be used as an additional stopping or selection condition to further improve the accuracy of clustering.
[0031] To verify the validity of this application, microbial genome and metagenomic data from NCBI (National Center for Biotechnology Information), JGI (Joint Genome Institute), EMBL (European Molecular Biology Laboratory), MG-RAST (Metagenomics RAST, a free online bioinformatics analysis platform), and WGS (Whole Genome Sequencing) databases were integrated for experiments. The CRISPR-Cas (an immune system) annotation software CCTyper (a software tool for automatically identifying and classifying CRISPR arrays and CRISPR-Cas loci) was used to functionally annotate relevant protein families. The results from hmmsearch (a search tool based on Hidden Markov Models (HMM)) were analyzed according to Coverage ≥ 0.7 and E-value ≤ 1e. 5. A Bitscore ≥ 40 was used for filtering. After screening, a total of 112,960 annotated sequences were obtained, involving 170 different protein families. Based on the above sequence data, this application was validated on the following two datasets to demonstrate its effectiveness on complete sequence datasets and distantly homologous sequence datasets: (1) Complete sequence dataset without redundancy removal (All Sequences).
[0032] (2) The dataset of distant homologous sequences after redundancy removal by MMseqs2 at a 30% sequence identity threshold (MMSeqs2 at 30% Identity) contains 6,949 sequences involving 168 protein families.
[0033] When using a complete sequence dataset for validation, the parameter settings are as follows: initial clustering partition value ∈ {100, 200, 500, 1000}; clustering partition interval ∈ {100, 200, 500, 1000}; minimum number of samples ∈ {30, 35, 40, 45}.
[0034] When using a dataset of distantly related homologous sequences that have been deredundant by a 30% sequence consistency threshold for validation, the parameter settings are as follows: initial clustering partition value ∈ {10, 20, 50, 100}; clustering partition interval ∈ {10, 20, 50, 100}; minimum number of samples ∈ {15, 20, 25, 30}.
[0035] The validation results include three aspects: family coverage, family purity, and the distribution of representative sequences in the phylogenetic tree. Family coverage is defined as the proportion of protein families included in the representative sequence to the total number of protein families included in all sequences, used to measure the extent to which the representative sequence covers overall family diversity. Family purity is defined as the proportion of the dominant protein family sequences in each cluster to the total number of sequences in that cluster, used to assess the accuracy and consistency of the clustering. Furthermore, to analyze the distribution characteristics of the representative sequences, this application selects the Cas1 and Cas9 protein families as examples, constructs a phylogenetic tree using FastTree software, and displays the distribution of representative sequences on this phylogenetic tree to verify that the representative sequences selected in this application can fully reflect sequence diversity.
[0036] Since the final number of representative sequences may be similar due to different parameter combinations, when validating family coverage and family purity, appropriate intervals are selected based on the total number of sequences, and the average value ± 2 standard errors of the results within each interval is taken as the final display result. Specifically, in the complete sequence dataset, each interval consists of 1000 sequences; in the distantly related homologous sequence dataset, each interval consists of 100 sequences.
[0037] Figure 3 This diagram illustrates family coverage and family purity across different representative sequence intervals. Within a certain range, these two indicators are minimally affected by parameter changes, indicating that fluctuations in the number of representative sequences due to parameter differences do not significantly impact the selection results. With increasing representative sequences, family coverage slightly improves in the complete sequence dataset, while family purity remains relatively stable; in the deredundant distant homologous sequence dataset, both show an upward trend. When the number of classes in the complete sequence dataset is between 10,000 and 11,000 (approximately 10% of the original data), the average family coverage reaches 88%, and family purity reaches 96%; while in the deredundant distant homologous sequence dataset, when the number of classes is between 600 and 700 (approximately 10% of the deredundant data), family coverage and family purity reach 65.3% and 78.8%, respectively. The above results show that this application has a high family recognition rate and segmentation accuracy in complete sequence datasets; and it can still maintain good recognition performance and family segmentation performance in redundant distant homologous sequence datasets.
[0038] Taking the results with 11,000 and 695 representative sequences in the complete sequence dataset and the distantly homologous sequence dataset, respectively, as examples, Figure 4 This diagram illustrates the distribution of family coverage and family purity for representative classes. The size of the dots represents the number of classes within the same class size and family purity range. In the complete sequence dataset, the family purity of most classes is higher than or equal to 80%, indicating good accuracy in the clustering results. A similar distribution trend is observed in the deduplicated distant homologous sequence dataset, but a small number of classes have lower family purity, possibly due to limitations in the protein language model when identifying some distant homologous sequences.
[0039] Figure 5 This diagram illustrates the effect of different parameters of this application on the number of representative sequences. Specifically, it includes: 1. Initial Cluster Split Value. The initial cluster split value determines the number of clusters in the first clustering, thus affecting the range of representative sequences selected initially. When the minimum number of samples is fixed and the split interval is small, increasing the initial cluster split value will slightly increase the final number of representative sequences. However, when the cluster split interval is large, the change in the initial cluster split value no longer has a significant impact on the number of representative sequences.
[0040] 2. Clustering Interval. The clustering interval determines the number of clusters added at each stage, thus affecting the update rate of representative sequences. With a fixed initial clustering interval and minimum sample size, moderately increasing the clustering interval can encourage larger clusters to be subdivided in subsequent stages, slightly increasing the number of representative sequences. Furthermore, increasing the clustering interval can merge smaller protein families into finer clusters with a minimum sample size, potentially causing different protein families to simultaneously cover smaller clusters, ultimately leading to an increase in the number of representative sequences.
[0041] 3. Minimum number of samples. The minimum number of samples affects the number of final representative sequences. The larger the minimum number of samples, the fewer the final representative sequences.
[0042] Figure 6 This diagram illustrates the impact of different parameter combinations on family coverage and average family purity. When the initial clustering partition value is high, family coverage and family purity are mainly affected by the minimum sampling number. However, when the initial clustering partition value is low, increasing the clustering interval primarily affects family coverage, with a smaller improvement in family purity. When the clustering interval is small, increasing the initial clustering partition value within a certain range can improve family coverage, while using a relatively large clustering interval at a relatively low initial clustering partition value can achieve a similar effect. When the initial clustering partition value reaches a certain level, family coverage and family purity are mainly affected by the minimum sampling number.
[0043] Figure 7 This is a schematic diagram showing the distribution of representative sequences in a phylogenetic tree constructed using all Cas1 and Cas9 protein family sequences, with the following parameter combinations: initial clustering value = 1000, clustering interval = 1000, and minimum sample size = 30. It can be seen that the representative sequences span the entire phylogenetic tree, indicating sufficient diversity.
[0044] Based on the above, the automatic protein family clustering method of this application uses embedding vectors generated by PLM to represent each protein sequence. The similarity between protein sequences is measured by the distance between embedding vectors. A hierarchical clustering algorithm is used to construct a tree structure based on the similarity to highlight the hierarchical relationship between protein families. The hierarchical clustering algorithm performs multi-level and adaptive clustering of protein sequences, and by setting parameters, classes meeting a certain size are grouped into the same protein family. This application enhances the ability to identify distant homology while avoiding the segmentation bias caused by the inability of fixed clustering parameters to simultaneously adapt to the inconsistent degrees of difference between different protein families and within each family, thus improving the accuracy of protein family segmentation.
[0045] Please see Figure 8 This is a schematic diagram of the structure of an automatic protein family clustering system according to an embodiment of this application. The automatic protein family clustering system 40 according to an embodiment of this application includes: Embedding vector calculation module 41: used to input the protein sequence to be clustered into the protein language model for vector embedding and generate the embedding vector of the protein sequence; Distance calculation module 42: used to calculate the distance between two protein sequences based on the embedding vector of the protein sequence, to obtain the pairwise distance between two protein sequences, and to measure the similarity between protein sequences based on the pairwise distance; Hierarchical clustering module 43: used to perform bottom-up hierarchical clustering of the embedding vectors of all protein sequences based on the similarity using a hierarchical clustering algorithm, and to construct a tree structure of the protein sequences; Protein family segmentation module 44: Based on the tree structure of the protein sequence, it performs layer-by-layer clustering according to the set clustering parameters, classifying classes that meet the clustering parameters into the same protein family, until the clustering termination condition is met and the clustering ends.
[0046] It should be noted that since the information interaction and execution process between the system embodiments of this application and the above-mentioned methods / devices / modules / units are based on the same concept, their specific functions and technical effects can be found in the method embodiments section, and will not be repeated here.
[0047] Please see Figure 9 This is a schematic diagram of the device structure according to an embodiment of this application. The device 50 includes: Memory 51 storing executable program instructions; Processor 52 connected to memory 51; The processor 52 is used to call the executable program instructions stored in the memory 51 and perform the following steps: inputting the protein sequences to be clustered into the protein language model for vector embedding to generate embedding vectors of the protein sequences; calculating the distance between each pair of protein sequences based on the embedding vectors of the protein sequences to obtain the pairwise distance between each pair of protein sequences, and measuring the similarity between protein sequences based on the pairwise distance; using a hierarchical clustering algorithm based on the similarity to perform bottom-up hierarchical clustering of the embedding vectors of all protein sequences to construct a tree structure of the protein sequences; based on the tree structure of the protein sequences, performing layer-by-layer clustering according to the set clustering parameters, classifying the classes that meet the clustering parameters into the same protein family, until the clustering termination condition is met and the clustering division ends.
[0048] The processor 52 can also be referred to as a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.
[0049] Please see Figure 10 This is a schematic diagram of the structure of the storage medium in an embodiment of this application. The storage medium in this embodiment stores program instructions 61 capable of performing the following steps: inputting the protein sequences to be clustered into a protein language model for vector embedding to generate embedding vectors of the protein sequences; calculating the distance between pairs of protein sequences based on the embedding vectors to obtain pairwise distances between pairs of protein sequences, and measuring the similarity between protein sequences based on the pairwise distances; using a hierarchical clustering algorithm based on the similarity to perform bottom-up hierarchical clustering of the embedding vectors of all protein sequences, constructing a tree structure of the protein sequences; based on the tree structure of the protein sequences, performing layer-by-layer clustering according to set clustering parameters, classifying classes that satisfy the clustering parameters into the same protein family, until the clustering termination condition is met, at which point the clustering ends. The program instructions 61 can be stored in the aforementioned storage medium in the form of a software product, including several instructions to cause a device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage media include: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program instructions, or terminal devices such as computers, servers, mobile phones, and tablets. Servers can be independent servers or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0050] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, apparatuses, or units, and may be electrical, mechanical, or other forms.
[0051] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.< / eos> < / cls>
Claims
1. An automatic clustering method for protein families, characterized in that, include: The protein sequences to be clustered are input into the protein language model for vector embedding to generate embedding vectors for the protein sequences. The distance between any two protein sequences is calculated based on the embedding vectors of the protein sequences, and the pairwise distance between the two protein sequences is obtained. The similarity between the protein sequences is measured based on the pairwise distance. Based on the similarity, a hierarchical clustering algorithm is used to perform bottom-up hierarchical clustering on the embedding vectors of all protein sequences to construct a tree structure of the protein sequences. Based on the tree structure of the protein sequence, the clustering is performed layer by layer according to the set clustering parameters. Classes that meet the clustering parameters are classified into the same protein family until the clustering termination condition is met, at which point the clustering ends.
2. The automatic protein family clustering method according to claim 1, characterized in that, The step of inputting the protein sequences to be clustered into the protein language model for vector embedding to generate embedding vectors for the protein sequences is as follows: A single protein sequence containing m amino acids After inputting the protein language model, the output of the final layer of the protein language model is taken to obtain each residue. 1280-dimensional embedding vector Generate the protein sequence The dimension is ; The protein sequence is obtained by performing average pooling on the vector matrix. Embedded vector : 。 3. The automatic protein family clustering method according to claim 2, characterized in that, The distance between pairs of protein sequences is calculated using the embedding vectors based on the protein sequences, resulting in pairwise distances between them. Specifically: The two protein sequences The distance between them is expressed in Euclidean distance as: 。 4. The automatic protein family clustering method according to claim 3, characterized in that, The step of using a hierarchical clustering algorithm based on the similarity to perform bottom-up hierarchical clustering of the embedding vectors of all protein sequences, constructing a tree structure of the protein sequences, specifically involves: All protein sequences Initialize as n disjoint single-element clusters of size 1, where n is the number of the protein sequences; In hierarchical clustering, each iteration selects the two closest clusters for merging until all protein sequences have been merged, resulting in n-1 merging operations. The cluster pair from the k-th (k=1, 2, ..., n-1)th merging is denoted as [k-1, ..., n-1]. p,q for ), its merging distance is According to the cluster pair merging order Establish the node connection order and its corresponding merge distance. To generate a tree structure of the protein sequence, wherein each node of the tree structure represents a merged cluster pair. The corresponding height is .
5. The automatic protein family clustering method according to claim 4, characterized in that, In the hierarchical clustering process, the distance d between any two clusters of size A and B is... , for: 。 6. The automatic protein family clustering method according to any one of claims 1 to 5, characterized in that, The set clustering parameters include the initial clustering partition value, the clustering partition interval, and the minimum number of samples. The initial clustering partition value represents the number of clusters at the beginning of the clustering partition. The clustering partition interval represents the number of additional clusters to be added in the next clustering partition. The minimum number of samples represents the number of representative sequences selected only from clusters whose size is less than or equal to the minimum number of samples after each clustering partition. When the size of all clusters is less than or equal to the minimum number of samples, the clustering termination condition is met.
7. The automatic protein family clustering method according to claim 6, characterized in that, The tree structure based on the protein sequence is divided into layers according to the set clustering parameters, specifically as follows: Clustering is initiated using the initial clustering partition value to generate a first set number of clusters; The initial clustering partition value is added to the clustering partition interval to obtain the current stage clustering partition value. Clustering is then started with the current stage clustering partition value to generate a second set number of classes. The classes with sizes less than or equal to the minimum sampling number in the second set number of generated classes are selected for embedding vector center calculation. The protein sequence corresponding to the embedding vector closest to the embedding vector center is selected as the representative sequence of the class. The classes with sizes greater than the minimum sampling number in the second set number of classes are retained to enter the next stage. The clustering partition value from the previous stage is added to the clustering partition interval to obtain the new clustering partition number. Clustering is then started with the new current clustering partition value to generate a third set number of clusters. If there are still clusters in the third set number of clusters whose size is less than or equal to the minimum sampling number, the previous step is repeated. If there are no clusters, the clustering ends.
8. An automated protein family clustering system, characterized in that, include: Embedding vector calculation module: used to input the protein sequence to be clustered into the protein language model for vector embedding and generate the embedding vector of the protein sequence; Distance calculation module: used to calculate the distance between any two protein sequences based on the embedding vector of the protein sequence, to obtain the pairwise distance between any two protein sequences, and to measure the similarity between protein sequences based on the pairwise distance; Hierarchical clustering module: used to perform bottom-up hierarchical clustering of the embedding vectors of all protein sequences based on the similarity using a hierarchical clustering algorithm, and to construct a tree structure of the protein sequences; Protein family partitioning module: Based on the tree structure of the protein sequence, it performs layer-by-layer clustering according to the set clustering parameters, classifying classes that meet the clustering parameters into the same protein family, until the clustering termination condition is met and the clustering ends.
9. A device, characterized in that, The device includes a processor and a memory coupled to the processor, wherein, The memory stores program instructions for implementing the automatic clustering method for the protein family; The processor is used to execute the program instructions stored in the memory to control the automatic clustering method for protein families.
10. A storage medium, characterized in that, It stores processor-executable program instructions for performing the automatic clustering method for the protein family.