GNN2Pfam: Integrating protein sequence and structure with graph neural networks for Pfam domain annotation

Proteins are building blocks of life, playing many crucial roles within organisms, such as catalyzing chemical reactions, coordinating signal pathways and providing structural support to cells (Weaver, 2012). In order to elucidate the mechanism of life, it is important to identify protein functions, which are closely related to their domains. Domains are distinct functional and/or structural units in a protein (Martinez and Lupas, 2023). Usually they are responsible for a particular function or interaction, contributing to the overall role of a protein. Often each individual domain has a specific function, such as for example binding a particular molecule or catalyzing a given reaction. Proteins are assigned to families according to the domain(s) they contain. A protein family is a group of proteins that share a common evolutionary origin, reflected by their related functions and similarities in sequence or structure.

The Pfam database is a comprehensive collection of protein domains and families used for protein structure and function analysis (Paysan-Lafosse et al., 2024). Automated Pfam family prediction of proteins is a large-scale multi-label classification problem. Nowadays this task is performed through multiple sequence alignments and profile Hidden Markov Models (HMMs). Each Pfam family has a seed alignment containing a representative set of sequences, from which a profile HMM is generated. This HMM is then used to search against a database containing sequences from the UniProtKB reference proteomes using the HMMER software (Finn et al., 2011). Sequence regions that meet a family-specific curated threshold are aligned to the profile HMM to create a full alignment and the corresponding Pfam family annotation. This approach has some limitations: alignment based methods are not accurate enough; a single HMM model must be trained for each family, separately and independently; and HMMs are not fast enough to handle large numbers of protein sequences from numerous genomes. Thus, it is a current challenge to develop a powerful automatic annotation method for the proteins deposited in Pfam capable of overcoming these limitations.

In the last decade, deep learning (DL) has led to unprecedented improvements in a broad spectrum of problems, ranging from learning protein sequence embeddings to predicting protein structure (Wang et al., 2017, Jumper et al., 2021) and function (Kulmanov et al., 2017, Merino et al., 2022). In recent years DL methods for modeling Pfam protein families appeared (Seo et al., 2018, Bileschi et al., 2022), using only sequence information and with the capability of learning from a complete dataset, thus being able to discover inner patterns across several families at the same time. Models can be fit from scratch (Kulmanov et al., 2017, Bileschi et al., 2022, Cao and Shen, 2021) or fine-tuned from a model pretrained on unlabeled protein sequences (Strodthoff et al., 2020, Villegas Morcillo et al., 2020, Yuan et al., 2023) since the amino acid sequence largely specifies a protein structure and function (Anfinsen, 1973).

Recent work has shown that DL models for protein Pfam functional predictions together with transfer learning and representations obtained from a protein language model (pLM) can effectively outperform traditional techniques (Vitale et al., 2024). A pLM trained on a large database of protein sequences, such as UniProt, can be used for encoding the sequence composition, jointly with evolutionary features, into a so-called pLM embedding. A pLM embedding can capture some aspects of the language that was used to write the protein primary sequences (Weissenow and Rost, 2025). The large language models that first appear in natural language processing masked out a few words in a sentence during training and then learned how to predict them from the context. In a pLM, words are replaced by the residues, training the model for the task of predicting masked segments of each input sequence, which is called pre-training. The pLM has several deep layers that provide internal representations of sequences. The information learned by the pLM is stored in the neuron weights of those hidden layers that learn to predict the masked segments from the context of all the other residues in the protein. Once pre-trained, the output of a pLM hidden layer can be used to obtain a compact representation as a numerical vector, the embedding. It serves as an information-dense representation of each residue of the protein, which can be used for downstream tasks such as the prediction of its structure or function. Several pre-trained pLMs have appeared in the last five years (Yang et al., 2018, Detlefsen et al., 2022, Tran et al., 2023) that take advantage of the vast quantity of unannotated protein sequence data available. A review (Fenoy et al., 2022) where several protein sequence representation learning methods were experimentally benchmarked, indicated Evolutionary Scale Modeling (ESM) (Rives et al., 2021) as the best method for the tasks evaluated, which included Pfam family prediction.

Most sequence-based protein function prediction methods use multiple 1D convolutional neural network layers (CNNs) that search for spatial patterns within a given sequence and convert them into complex features using multiple convolutional layers. In contrast, graph neural networks (GNNs) have gained in popularity recently (Bronstein et al., 2017, Gligorijevic et al., 2021) for structural protein function prediction since those can overcome these limitations by generalizing convolutional operations on more efficient graph-like representations (Gligorijevic et al., 2021, van der Weg et al., 2025) and because those can learn transformed representations of interacting pairs of elements within a sequence via graph relationships. Precisely in the case of proteins and their domains, where 3D structure is of utmost importance for defining function (Di Gennaro et al., 2001), a GNN model can allow integrating not only sequential but also, and more important, structural information. GNNs are powerful deep-learning-based methods for learning rich context-informed representations of nodes in graphs by propagating and aggregating different types of input information (such as semantic and structural data representations) from a node and its local neighborhood (Cohen et al., 2025). The transformed representations (embeddings) can be used then for several downstream tasks, such as Pfam domain classification. These methods have demonstrated large success in many biology and healthcare-related tasks (Zhang et al., 2021, Wu et al., 2021, Rau et al., 2022).

In this protocol we propose GNN2Pfam, an end-to-end GNN-based method for Pfam family domain annotation. This novel proposal uses the protein 3D structure together with a sequence representation obtained from a large pre-trained model. The method is based on a graph derived from amino acid interactions in the 3D structure, learning both sequential and structural features from this representation. A last layer based on Conditional Random Fields (CRF) provides the output probabilities for each Pfam family along the sequence of amino acids. Our strategy allows one single model to be trained for all species and families. Experiments with Pfam datasets show that the proposed GNN-based approach clearly outperforms the HMM state-of-the-art method.

Comments (0)

No login
gif