LSGFA: domain-based infraspecific large-scale prokaryotic genomic orthologous gene inference Authors: Yu Zhao, Yi-Fei Lu, Xuan Hai, Xiao-Yang Zhi Published: 2026 ABSTRACT BackgroundOrthologous gene inference is a crucial technical challenge in evolutionary biology. It typically depends on sequence similarity searches and employs a graph clustering method to infer homologous gene families. However, the all-vs-all sequence similarity search is time-consuming for large-scale genome datasets. In this work, we present LSGFA, a method that detects subgraphs based on the similarity of protein domain architectures and then performs graph clustering within each subgraph, corresponding to sequences that share similar compositions of protein domains.ResultsLSGFA carries out four steps in the analysis workflow: protein domain annotation, initial clustering based on Pfam domain architecture, SSN-based clustering, and detection of pan-genomic patterns. Benchmarking against five state-of-the-art tools (OrthoFinder, Roary, PanTA, Panaroo, and PGAP2) across multiple datasets demonstrates that LSGFA achieves a balanced trade-off between computational efficiency and biological accuracy. It takes less time than OrthoFinder while identifying more core genes than high-speed heuristic tools, and its orthogroup inference results show strong consistency with OrthoFinder.ConclusionsDue to the high proportion of proteins with known domain architectures in prokaryotes, LSGFA is particularly well-suited for prokaryotic genomes, where it significantly reduces computational time while yielding accurate homologous gene inference.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12859-026-06506-z. Background Gene family analysis is a crucial bioinformatics technique in evolutionary biology, which involves an essential theoretical issue—how to identify orthologous homology between genes. To reconstruct a species tree from genome sequences, whether using the super-matrix or super-tree methods [1], orthologous genes must be identified from the complex and large number of sequences. Another important application of gene family analysis is constructing the pangenome of a taxon at various taxonomic levels to uncover the core gene makeup and genetic diversity of those taxa. The current methods for identifying orthologous genes rely on two strategies: graph clustering and phylogenetic tree analysis [1, 2]. Graph clustering methods, known for their high computational efficiency, are widely used such as OrthoMCL [3], OrthoFinder [4], and Roary [5]. In terms of computational efficiency, Roary performs well. The graph clustering method typically relies on all-vs-all genome comparisons. The results of sequence comparison will be organized into a sequence similarity network (SSN), and then the nodes (sequences) in the SSN will be clustered using community detection algorithms, primarily the Markov clustering algorithm (MCL) [6]. However, with the increasing number of genomes involved in related studies (especially phylogenomic studies at the infraspecific level), several limitations of graph clustering have become apparent. First, in the SSN construction, the number of genome-genome comparisons is n(n-1), which leads to a quadratic increase in computational time as n grows. Second, for the large genome dataset, the huge SSN generated will also reduce the effect of subsequent graph clustering. To address these issues, some methods attempt to identify redundant sequences before building the SSN, such as Roary, which selects representative sequences for highly similar sequences to reduce the number of sequence searches [5]. PanTA and Panaroo use similar heuristic methods for fast pan-genome analysis [7, 8]. SonicParanoid2, on the other hand, introduces machine learning methods to accelerate genome sequence comparisons [9]. PGAP2 employs a dual-level regional restriction strategy combined with fine-grained feature networks to achieve high accuracy and efficiency in large-scale pan-genome analysis [10]. Enhancing the efficiency of genome sequence comparison remains a major challenge, as many calculations in the multiple genome sequence matching process are unnecessary. For example, there is no need to match two protein sequences that are entirely unrelated to each other. In other words, computational efficiency can be improved by decreasing the number of query sequences and the size of the sequence database. However, determining which sequences do not need to be matched depends on their identity, which is primarily quantified through sequence matching. This appears to cause a chicken-and-egg dilemma. Therefore, gene family analysis for a large genome dataset should employ an alternative approach to improve computational efficiency. Protein domains, as the essential structural and functional units of protein sequences, are crucial in evolution and serve as a primary basis for distinguishing protein families. Through protein domains, we can classify protein sequences more efficiently at a higher level. In sequences grouped by protein domains, sequences from different domain groups do not necessarily need to be subjected to sequence matching. For sequences within the same group, sharing the same domain indicates a certain level of similarity, and sequence matching can be used to measure more precise and quantitative identities among them. Based on this concept, a workflow for protein family analysis relying on Pfam domain clustering was developed in this study. In this process, protein sequences are first clustered based on Pfam domains, and then a narrow range of sequence matching is performed within each group, and orthologous gene groups are divided according to the matching results. There is a linear relationship between the time required for protein domain annotation and the number of genomes. The time consumption of sequence matching is significantly reduced, enabling the Large-Scale Genome Family Analysis (LSGFA) workflow to conduct gene family analysis effectively on large-scale genome datasets. Implementation LSGFA is written in Python 3.9, utilizing the igraph package to generate the network and the leidenalg package [11] to divide the network into communities. It required three third-party programs: diamond [12], MMseqs2 [13], and hmmscan [14]. Its main program is LSGFA.py. As shown in Fig. 1, LSGFA carries out the following steps in the analysis workflow: protein domain annotation, initial clustering based on Pfam domain architecture, SSN-based clustering, and detection of pan-genomic patterns, as detailed below.Fig. 1LSGFA workflow. Workflow diagram illustrating the four main steps from Pfam domain annotation to pan-genome construction LSGFA workflow. Workflow diagram illustrating the four main steps from Pfam domain annotation to pan-genome construction Protein pfam domain annotation LSGFA accepts a set of files in FASTA format (file extension: faa), each containing a genome-predicted proteome as input. The predicted proteome FASTA file is available through genome annotation tools such as the prokaryotic genome annotation tool, Prokka [15]. To achieve protein sequence clustering based on the Pfam domain, it is necessary to distinguish the types of Pfam domain composition in proteins. LSGFA provides both hmmscan and MMseqs2 methods for Pfam protein domain annotation of a predicted proteome. Here, we use domain architecture (DA) to define the Pfam domain composition of a protein. Protein sequences with the same domain architecture must contain the same Pfam domains, i.e., the same Pfam entries. After a protein sequence has been annotated using hmmscan or MMseqs2, we will obtain zero, one, or more than one Pfam domain based on a threshold of e-value. Then, the results of the Pfam domain annotation will be filtered, and some Pfam domains that do not meet the criteria will be removed. First, the total coverage of the protein sequence for all domains (i.e., a domain architecture) must exceed 60%; otherwise, the domain annotation results will be ignored, and the domain architecture of the protein will be marked as ‘None’. For instance, the results of the two domain architectures shown in Fig. 2A(i) will be ignored and marked as ‘None’ because the total coverages of the domain architectures to the full lengths of the proteins are both less than or equal to 60%. Second, if the total coverage of the domain architecture for the entire protein is greater than 60%, the entries of the Pfam domains and their coverages will be recorded and used to evaluate the domain architecture similarity. The domain architectures for two sequences in Fig. 2A(ii) will be recorded as: {‘a’:0.3, ‘b’:0.3, ‘c’:0.3} and {‘a’:0.9}, respectively. Finally, for Pfam domains with overlapping sequence coverage, only the domain with higher coverage was retained in the domain architecture (as shown in Fig. 2A(iii); the Pfam domain b is ignored, both DAs will be recorded as: {‘a’:0.6, ‘c’:0.3}). All protein sequences in the genome are identified by Pfam domain identification and converted to the corresponding domain architectures, which can be used for subsequent graph clustering to achieve Pfam domain-based clustering analysis of protein sequences. The Pfam domain annotation results for all proteins in the predicted proteome are stored in a JSON file, which contains detailed records of the Pfam domain and sequence coverage for each sequence.Fig. 2LSGFA algorithm. A Types of domain architecture. (i) The total sequence coverages of two DAs do not exceed 60%, so their DAs were marked as ‘None’; (ii) the total sequence coverages of two DA are greater than 60%, so their DAs were kept for the calculation of DA similarity; (iii) the total sequence coverages of two DAs are greater than 60%, but only the Pfam domain with higher coverage will be kept. B Flowchart of building DAGraph and clustering based on DAGraph. C Flowchart of constructing SSN, MCL clustering, and recalling the sequences without DA annotation LSGFA algorithm. A Types of domain architecture. (i) The total sequence coverages of two DAs do not exceed 60%, so their DAs were marked as ‘None’; (ii) the total sequence coverages of two DA are greater than 60%, so their DAs were kept for the calculation of DA similarity; (iii) the total sequence coverages of two DAs are greater than 60%, but only the Pfam domain with higher coverage will be kept. B Flowchart of building DAGraph and clustering based on DAGraph. C Flowchart of constructing SSN, MCL clustering, and recalling the sequences without DA annotation DAGraph building and community detection A domain architecture graph (DAGraph) is created according to the domain architectures of all protein sequences, and each node in the DAGraph corresponds to a DA and represents all protein sequences with the corresponding DA (Fig. 2B). Edges in the DAGraph indicate that two DAs share a similar Pfam domain composition. For example, DA_1 and DA_2 are two nodes in the DAGraph, and the following formula defines the weight of the edge between them:\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w=\frac{n\times m}{N\times M}$$\end{document} In this formula, N and M represent the total number of protein sequences assigned to nodes DA_1 and DA_2, respectively. Within these groups, n and m denote the subsets of sequences that possess the specific shared Pfam domain (with a sequence coverage exceeding 50%). Consequently, the edge weight w, which ranges from 0 to 1, represents the probability that two sequences randomly selected from DA_1 and DA_2 both satisfy the domain conservation criteria. This weight provides a quantitative measure of the evolutionary correlation between two distinct domain architectures. Subsequently, we used leidenalg [11] to conduct community detection on the DAGraph, which is divided into subgraphs that contain similar DAs. After obtaining DA subgraphs, all protein sequences involved in each subgraph were subjected to an all-vs-all sequence comparison. This design allows the DAGraph to capture relationships between multi-domain (fusion) proteins and their single-domain components, which are connected by edges representing their shared domains and subsequently grouped into the same subgraph for fine-grained sequence matching. The SSN of each DA subgraph is constructed by filtering the matchings with identities lower than the threshold. The nodes in the SSN correspond to protein sequences, and the edges between these nodes indicate that the two sequences are matched. Finally, we utilize MCL to cluster SSNs and extract related protein sequences to form candidate orthologous groups (orthogroups). Recall sequences without the Pfam domain annotation For sequences that are either not annotated with any Pfam domain or are annotated but do not meet the coverage criteria (“None” DA), LSGFA will perform an additional sequence matching step. The longest sequence within each candidate orthogroup was selected as the representative sequence to form the search database, and all sequences (“None” DA) were searched against the representative sequences (Fig. 2C). Sequences with an identity \ge 99% to the representative sequences were appended to the candidate orthogroups. This stage specifically rescues sequences that are clearly orthologous but failed the initial domain-based grouping due to sequence truncation or local divergence. Finally, for sequences whose identity with representative sequences does not meet the threshold, LSGFA will use the easy-cluster of MMseqs2 to cluster them (the default threshold is 40% identity and 50% bidirectional coverage). These resulting clusters represent unidentified orthologous groups that lack known Pfam domain signatures. This step ensures that novel or taxon-specific gene families are not discarded, providing a valuable reference for researchers exploring the "dark matter" of the proteome. Statistical pan-genomic information LSGFA will categorise all orthogroups according to the genomic distribution of the genes within them: core genes (99% łe coverage of genomes łe 100%), soft core genes (95% łe coverage of genomes < 99%), shell genes (15% łe coverage of genomes < 95%), cloud genes (0% łe coverage of genomes < 15%). Statistics about the pan-genome are maintained in the “pangenome” directory, where the number of orthogroups of each category can be viewed in the “summary.txt” file. At the same time, the orthogroups contained in the genes of different categories will be recorded in the corresponding “genes_list.txt”, and the specific orthogroup file can be found in the “sub_cc” directory according to the file. Interpretation of orthogroups LSGFA outputs orthogroups—clusters of genes inferred to share common ancestry. These orthogroups represent a balance between inclusivity and stringency: they generally group recently diverged paralogs together while separating ancient duplicates. Users can adjust the MCL inflation parameter (default: 1.5) to control the granularity of clustering. For applications that require strict orthology (such as phylogenetic reconstruction), we recommend extracting reciprocal best hit (RBH) pairs from the orthogroups using the provided utility script. Results Comparison with other applications We evaluated LSGFA by comparing it with several state-of-the-art orthology inference and pan-genome reconstruction tools, including OrthoFinder, Roary, PanTA, Panaroo, and PGAP2, in terms of running time and the number of core genes identified. A basic dataset of 1,000 Staphylococcus aureus genomes was constructed and used to randomly generate smaller datasets (starting with 100 genomes and incrementing by 100 genomes, Table S1). The test results demonstrated that LSGFA maintains balanced performance in these tools (Fig. 3A and B). While Roary, PanTA, and PGAP2 exhibited the highest computational speeds, they showed a significant tendency toward "over-splitting" as the number of genomes increased, resulting in a sharp decline in identified core genes (Fig. 3B). In contrast, LSGFA identified nearly as many core genes as OrthoFinder while maintaining significantly higher efficiency. Notably, as the number of genomes increased, the running time of OrthoFinder increased significantly.Fig. 3LSGFA evaluation. A Running times of LSGFA, OrthoFinder, Roary, PanTA, Panaroo, and PGAP2 for various sizes of genome datasets. B Number of core genes identified by LSGFA, OrthoFinder, Roary, PanTA, Panaroo, and PGAP2. C ARI values between orthogroups obtained by LSGFA and the other methods. D The composition of the pan-genome in different software on a dataset of 1000 S. aureus genomes LSGFA evaluation. A Running times of LSGFA, OrthoFinder, Roary, PanTA, Panaroo, and PGAP2 for various sizes of genome datasets. B Number of core genes identified by LSGFA, OrthoFinder, Roary, PanTA, Panaroo, and PGAP2. C ARI values between orthogroups obtained by LSGFA and the other methods. D The composition of the pan-genome in different software on a dataset of 1000 S. aureus genomes The differences in orthogroup division among these methods were compared using the adjusted Rand index (ARI) [16] (Fig. 3C). As the number of genomes increased, the ARI of LSGFA relative to OrthoFinder remained at approximately 0.92, consistently higher than those of Roary, PanTA, and PGAP2. This suggests that the orthogroups identified by LSGFA are more closely related to those of OrthoFinder than other methods. Regarding ARI values and the number of core genes, LSGFA is more similar to OrthoFinder. The pan-genomic results for 1000 S. aureus genomes (Fig. 3D) reveal that the cloud genes identified by Roary, PanTA, and PGAP2 accounted for a larger proportion than LSGFA, indicating the formation of smaller communities. Additionally, we performed the same test with a different infraspecies dataset (Escherichia coli, Table S2) and three interspecies datasets (Streptomyces, Pseudomonas, and Flavobacterium; Table S3–S5), all of which produced similar results (Tables S6–S8). To further evaluate clustering quality beyond global statistics, we conducted a case study of three paralogous gene families associated with ABC transporters (Pfam: PF00005, PF01061, and PF00664) in a subset of 100 S. aureus genomes (Table S9). For the largest family (PF00005, containing 5824 sequences), LSGFA, OrthoFinder, and Panaroo all identified 79 orthogroups, showing consistent clustering across these advanced methods. In contrast, other high-speed tools, such as Roary (144 groups), PanTA (123 groups), and PGAP2 (114 groups), significantly oversplit sequences into fragmented groups. Similarly, for the transmembrane domain family (PF00664, 209 sequences), LSGFA and Panaroo both identified 5 groups, closely matching OrthoFinder’s 4 groups, while Roary and PanTA partitioned them into 10 and 8 groups, respectively. Statistics of protein domains in prokaryotes Protein domains are considered homologous fragments, which means related sequence sites remain unchanged at the sequence level throughout evolution. In eukaryotes, most proteins have multiple domains, whereas in prokaryotes, there are fewer multidomain proteins [17]. To understand the Pfam domains of prokaryotic proteins, we assembled a prokaryotic genome dataset consisting of 11,515 genomes from the type strains of prokaryotes. (Table S10). The Pfam domains were annotated using MMseqs2 [13]. The results indicated that 70.1% of the prokaryotic protein sequences could be identified with at least one known Pfam domain (Fig. S1A), and the domain coverage of most protein sequences exceeded 60% (Fig. S1B). When those proteins were classified according to the composition of their Pfam domains, although 20.5% of the domain composition types contained only one Pfam domain, these single-domain sequences accounted for 74.9% of all prokaryotic proteins (Fig. S1C). For the entire genome, a higher proportion of proteins that can be annotated with Pfam domain(s) makes Pfam domain-based protein sequence clustering analysis more favorable. More than 94.7% of genomes in the prokaryotic genome dataset have over 60% of their proteins with known Pfam domains (Fig. S1D). To highlight the differences in Pfam domain composition between prokaryotic and eukaryotic proteins, we performed the same Pfam domain analysis on the QfO dataset (version 2020). The QfO dataset contains 78 genomes, including bacteria, archaea, and eukaryotes. We excluded bacteria and archaea and employed 48 eukaryotic genomes. The proportion of sequences that can be annotated with known Pfam domain(s) decreased to 61.7% (Fig. S2A). Although most eukaryotic proteins still contain a single domain (Fig. S2C), the proportion of proteins with low Pfam domain coverage has increased remarkably (Fig. S2B). At the genomic level, the percentage of proteins with known Pfam domains has also become lower (Fig. S2D). The above statistics on Pfam domains of proteins suggest that conserved domain information can play a role in large-scale protein sequence clustering analysis, especially for genomes that encode many proteins with known Pfam domains. Parameters testing To accommodate the diverse requirements, LSGFA offers adjustable parameters at multiple stages, including protein domain annotation, community detection parameters (provided by leidenalg), resolution parameters, and SSN matching filters. Different parameters may yield different results, and we evaluated their effects using 100 randomly selected genomes from prokaryotic type strains (Fig. S3–S6). Pfam domain identification LSGFA integrated two methods for identifying protein Pfam domains: MMseqs2 and hmmscan (HMMER v3.4, Eddy, 2011). MMseqs2 uses the prefilter method, whereas hmmscan uses profile hidden Markov models (profile HMMs). The latter usually can annotate more distant sequences. With hmmscan, the proportion of sequences that can be annotated with known Pfam domain(s) is greater (Fig. S3A and E), at the genomic level, the percentage of proteins with known Pfam domain(s) is higher (78% genomes have over 80% of their proteins with known Pfam domains) (Fig. S3D and H). However, hmmscan is slower than MMseqs2. When using the same computing resource (50 cores), hmmscan finished the domain identification for a genome of S. aureus in an average of 30 s, while MMseqs2 takes only 5 s. During specific analyses, users can select different methods according to their needs to achieve a balance between computational efficiency and accuracy. LSGFA uses hmmscan by default. Community detection on DAGraph When we use the leidenalg package to conduct community detection on a DAGraph, there are five algorithms available: CPMVertexPartition, ModularityVertexPartition, RBConfigurationVertexPartition, RBERVertexPartition, and SurpriseVertexPartition. We conducted tests on three test datasets, and the results indicated the differences among the five algorithms in terms of the number of communities (Fig. S4). During the test, we set the resolution parameter to 0.9 for RBConfigurationVertexPartition, RBERVertexPartition, and CPMVertexPartition. Among the five algorithms, the CPMVertexPartition achieved the highest number of communities. The number of communities identified when using ModularityVertexPartition, RBConfigurationVertexPartition, and RBERVertexPartition for community detection is essentially the same; the SurpriseVertexPartition algorithm fell somewhere between the other two algorithms. LSGFA uses the CPMVertexPartition algorithm by default for community detection. The resolution parameter was proposed to alleviate the resolution limit of modularity in community detection [18, 19]. Among these five community detection algorithms in leidenalg, RBConfigurationVertexPartition, RBERVertexPartition, and CPMVertexPartition can control the intensity of community detection through the resolution parameter. We used the optimiser in leidenalg on three test datasets, and indicated the impact of the resolution parameter among the three algorithms by the number of communities in the DAGraph at different resolution settings (Fig. S5). The number of communities increases with the increase of the resolution parameter. The number of communities identified by both RBConfigurationVertexPartition and RBERVertexPartition exhibits fluctuations, while CPMVertexPartition shows a gradual rise. The resolution parameter influences the granularity of community detection, but it is also related to the graph structure, which reflects genomic relatedness, i.e., the evolutionary relationship between genomes. Theoretically, when genomes are closely related, such as infraspecific genomes, there will be more edges in the DAGraph; when genomes are distantly related, such as interspecific genomes, the edges in the DAGraph will be sparser. LSGFA uses 0.9 by default for the resolution parameter. Sequence similarity network construction Since the structure of SSN determines the effectiveness of graph clustering algorithms like MCL, it is necessary to process the edges in the SSN to filter out low-similarity sequence relationships. LSGFA provides three options for filtering: reciprocal best hit (RBH), fixed threshold, and minimum threshold for reciprocal hit. We conducted tests on three test datasets, using three methods respectively to filter the matching relationships in SSN, and analyzed the composition of the pan-genome (Fig. S6). The CPMVertexPartition algorithm was used for the community detection of DAGraph (resolution parameter = 0.9), and MCL was used for SSN clustering (the inflation is set to 1.5). Among the three filter methods, the minimum threshold for reciprocal hit found the greatest number of core genes and soft core genes, because it ensured connections between distant homologs. In contrast, the fixed threshold (identity ≥ 40%) found the fewest core genes, because it applied the same standard to all subgraphs. Meanwhile, the result of RBH fell somewhere in between. By default, the filter method in the program selects the minimum threshold for reciprocal hits. Discussion Due to the rapid growth of publicly available genomic data, it is becoming more challenging to identify homologous genes quickly and accurately in genome and evolutionary studies. However, most bioinformatic tools for inferring orthologous genes require longer computational times due to the all-vs-all sequence matching. They are not effective at detecting orthologs of proteins with complex domain structures or proteins undergoing gene fusion or fission events [20]. In this work, we propose an algorithm for orthologous inference, LSGFA, which enables initial sequence clustering based on the similarity of protein domain architecture and subsequently reduces the execution time of sequence matching. By integrating HMM-based domain identification and adaptive MCL clustering, LSGFA can handle varying evolutionary rates across gene families, ensuring sensitivity to rapidly evolving proteins while maintaining specificity for highly conserved ones. Although LSGFA offers speed, its scope of application is limited. It is suitable for genomes with a high number of protein sequences that contain simple domains; however, the reliability of its results will be reduced when dealing with eukaryotic genomes or genomes with more protein sequences that contain complex domains. In follow-up work, recognizing and clustering complex domains can be enhanced by optimizing the algorithm or using machine learning, which not only increases the algorithm's accuracy but also boosts its computational speed. Conclusions Due to the high proportion of proteins with known domain architectures in prokaryotes, LSGFA is particularly well-suited for large-scale genomic analysis. The defining feature of LSGFA is its implementation of a domain-architecture-based pre-filtering strategy, which effectively partitions the computationally intensive all-vs-all sequence matching into fine-grained clustering within localized subgraphs. Benchmarking results demonstrate that LSGFA achieves a superior balance between efficiency and accuracy: it significantly reduces execution time compared to OrthoFinder while maintaining high consistency in orthogroup inference, as evidenced by an Adjusted Rand Index (ARI) of approximately 0.92. Furthermore, LSGFA successfully mitigates the "over-splitting" of core genes commonly observed in other high-speed heuristic tools during large-scale pangenome reconstruction. While initially optimized for prokaryotic genomes, this domain-layout-based framework provides a promising methodology for resolving complex orthology in eukaryotes, though further refinement is required to accommodate more intricate eukaryotic protein structures. Methods Software We evaluated LSGFA by comparing it with OrthoFinder (v2.5.5), Roary (v3.13.0), PanTA (v1.0.1), PGAP2 (v1.0.6), and Panaroo (v1.6.0) in terms of running time and the number of core genes in the pan-genome. Parameter details:LSGFA: use MMseqs2 (Pfam v37.1) for domain annotation, “-t” is set to 50, other parameters are default. The database was downloaded with "databases Pfam-A.seed" and indexed using the createindex command with the parameters “-k = 5” and “-s = 7”.OrthoFinder: use “-og” to make the program stop at the step of OG inference, and “-t” was set to 50. 10 threads were used for “-a” (alignments), following the recommended (1/4 – 1/8 of -t threads). Other parameters are default.Roary: “-t” was set to 50, other parameters are default.PanTA: use the “main” mode, set “-t” to 50, other parameters are default.PGAP2: use the “main” mode, set “-t” to 50, other parameters are default.Panaroo: set “-t” to 50, choose “strict” for “–clean-mode”, use “–remove-invalid-genes”, other parameters are default. LSGFA: use MMseqs2 (Pfam v37.1) for domain annotation, “-t” is set to 50, other parameters are default. The database was downloaded with "databases Pfam-A.seed" and indexed using the createindex command with the parameters “-k = 5” and “-s = 7”. LSGFA: use MMseqs2 (Pfam v37.1) for domain annotation, “-t” is set to 50, other parameters are default. The database was downloaded with "databases Pfam-A.seed" and indexed using the createindex command with the parameters “-k = 5” and “-s = 7”. OrthoFinder: use “-og” to make the program stop at the step of OG inference, and “-t” was set to 50. 10 threads were used for “-a” (alignments), following the recommended (1/4 – 1/8 of -t threads). Other parameters are default. OrthoFinder: use “-og” to make the program stop at the step of OG inference, and “-t” was set to 50. 10 threads were used for “-a” (alignments), following the recommended (1/4 – 1/8 of -t threads). Other parameters are default. Roary: “-t” was set to 50, other parameters are default. Roary: “-t” was set to 50, other parameters are default. PanTA: use the “main” mode, set “-t” to 50, other parameters are default. PanTA: use the “main” mode, set “-t” to 50, other parameters are default. PGAP2: use the “main” mode, set “-t” to 50, other parameters are default. PGAP2: use the “main” mode, set “-t” to 50, other parameters are default. Panaroo: set “-t” to 50, choose “strict” for “–clean-mode”, use “–remove-invalid-genes”, other parameters are default. Panaroo: set “-t” to 50, choose “strict” for “–clean-mode”, use “–remove-invalid-genes”, other parameters are default. Adjusted rand index For comparing the orthogroups obtained by different methods, we used the adjusted Rand index (ARI) [16], The calculation of ARI was carried out using adjusted_rand_score in the Python package Scikit-learn. The Rand index (RI) and ARI are defined based on the relationship between pairs of sequences in two clustering results. A True Positive (TP) is defined as a pair of sequences that are placed in the same cluster in both clustering methods; a True Negative (TN) is a pair placed in different clusters in both methods; a False Positive (FP) is a pair placed in the same cluster in LSGFA but in different clusters in the reference method; and a False Negative (FN) is a pair placed in different clusters in LSGFA but in the same cluster in the reference method. The Rand index (RI) is defined as:\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{array}{c}RI=\frac{TP+TN}{TP+FP+TN+FN}=\frac{TP+TN}{{C}_{2}^{\mathrm{n}}}\end{array}$$\end{document}where n represents the number of elements in the dataset, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${C}_{2}^{n}$$\end{document} indicates the number of pairs that can be formed. RI assumes values in [0, 1], with higher values indicating better agreement between clustering results and the true partition. For random partitions, RI does not guarantee that the value is close to zero. To counter this effect, RI was adjusted to obtain ARI:\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ARI=\frac{RI-E\left[RI\right]}{\mathrm{max}\left(RI\right)-E\left[RI\right]}$$\end{document} ARI assumes values in [− 1, 1]. The higher ARI means that the clustering result is more consistent with the real partition, and the ARI of random partitions is close to zero. Supplementary Information Supplementary Material 1. Supplementary Material 2. Supplementary Material 1. Supplementary Material 2.