gPPIpred: A User-Friendly PPI Predictor Based on Protein Molecular Graphs.
The 4 matches
- [1] § Description ↔ app.py, lines 176–229 · score 0.69 · bar chart, UniProt, prey IDs, app, download, Binds
- [2] § Description ↔ bapp.py, lines 189–248 · score 0.69 · bar chart, UniProt, prey IDs, download, app, Binds
- [3] § paragraph 0 ↔ app.py, lines 176–229 · score 0.58 · UniProt, prey IDs, Precision, Sensitivity, app, chart
- [4] § paragraph 0 ↔ bapp.py, lines 189–248 · score 0.57 · UniProt, prey IDs, Precision, Sensitivity, chart, download
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 229 lines · 9.5 KB · no license · 2 matches
- import os
- import requests
- import torch
- import torch.nn as nn
- import torch.nn.functional as F
- import numpy as np
- import pandas as pd
- import gradio as gr
- import matplotlib.pyplot as plt
- import seaborn as sns
- import tempfile
- from torch_geometric.data import Data, Batch
- from torch_geometric.nn import GATv2Conv, global_mean_pool
- # --- 1. CONFIGURATION & PHYSICS ---
- DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
- AA_PHYSICS_5D_SCALED = {
- 'A': [0.70, 0.17, 0.11, 0.40, 0.00], 'R': [0.00, 0.67, 0.71, 1.00, 1.00],
- 'N': [0.11, 0.32, 0.33, 0.33, 0.00], 'D': [0.11, 0.30, 0.26, 0.00, 0.31],
- 'C': [0.78, 0.29, 0.31, 0.29, 0.67], 'Q': [0.11, 0.50, 0.44, 0.36, 0.00],
- 'E': [0.11, 0.47, 0.37, 0.06, 0.34], 'G': [0.46, 0.00, 0.00, 0.40, 0.00],
- 'H': [0.14, 0.55, 0.56, 0.60, 0.48], 'I': [1.00, 0.64, 0.45, 0.41, 0.00],
- 'L': [0.92, 0.64, 0.45, 0.40, 0.00], 'K': [0.07, 0.65, 0.54, 0.87, 0.84],
- 'M': [0.66, 0.61, 0.54, 0.37, 0.00], 'F': [0.81, 0.77, 0.72, 0.34, 0.00],
- 'P': [0.32, 0.31, 0.32, 0.44, 0.00], 'S': [0.41, 0.17, 0.15, 0.36, 0.00],
- 'T': [0.42, 0.33, 0.26, 0.35, 0.00], 'W': [0.40, 1.00, 1.00, 0.39, 0.00],
- 'Y': [0.36, 0.79, 0.73, 0.36, 0.81], 'V': [0.97, 0.48, 0.34, 0.40, 0.00],
- 'X': [0.00, 0.00, 0.00, 0.00, 0.00]
- }
- # --- 2. ARCHITECTURE ---
- class SiameseGAT_v3(nn.Module):
- def __init__(self, in_channels=5, hidden_channels=64, num_layers=8):
- super(SiameseGAT_v3, self).__init__()
- self.node_lin = nn.Linear(in_channels, hidden_channels)
- self.convs = nn.ModuleList()
- self.batch_norms = nn.ModuleList()
- for _ in range(num_layers):
- self.convs.append(GATv2Conv(hidden_channels, hidden_channels // 4, heads=4))
- self.batch_norms.append(nn.BatchNorm1d(hidden_channels))
- self.fc = nn.Sequential(
- nn.Linear(hidden_channels * 2, 256),
- nn.ReLU(),
- nn.Dropout(0.3),
- nn.Linear(256, 128),
- nn.ReLU(),
- nn.Linear(128, 1)
- )
- def forward_once(self, data):
- x, edge_index, batch = data.x, data.edge_index, data.batch
- x = self.node_lin(x)
- for conv, bn in zip(self.convs, self.batch_norms):
- h = conv(x, edge_index)
- h = bn(h)
- h = F.elu(h)
- x = x + h
- return global_mean_pool(x, batch)
- def forward(self, g1, g2):
- out1 = self.forward_once(g1)
- out2 = self.forward_once(g2)
- combined = torch.cat([out1, out2], dim=1)
- return self.fc(combined)
- # --- 3. HOTSPOT LOGIC ---
- def get_hotspots(model, g_bait, g_prey, bait_seq, prey_seq, top_n=10):
- g_bait.x.requires_grad = True
- g_prey.x.requires_grad = True
- logits = model(Batch.from_data_list([g_bait]), Batch.from_data_list([g_prey]))
- model.zero_grad()
- logits.backward()
- def extract_top(grad, seq):
- importance = grad.abs().sum(dim=1).cpu().numpy()
- indices = np.argsort(importance)[-top_n:][::-1]
- return ", ".join([f"{seq[i]}{i+1}" for i in indices if i < len(seq)])
- return extract_top(g_bait.x.grad, bait_seq), extract_top(g_prey.x.grad, prey_seq)
- # --- 4. DATA UTILS ---
- CACHE_DIR = "protein_cache"
- os.makedirs(CACHE_DIR, exist_ok=True)
- def get_protein_data(uniprot_id):
- uniprot_id = uniprot_id.strip().upper()
- cache_path = os.path.join(CACHE_DIR, f"{uniprot_id}.pt")
- if os.path.exists(cache_path): return torch.load(cache_path)
- # Fetch FASTA for sequence
- res_fasta = requests.get(f"https://rest.uniprot.org/uniprotkb/{uniprot_id}.fasta")
- # Fetch JSON for metadata (Protein Name)
- res_json = requests.get(f"https://rest.uniprot.org/uniprotkb/{uniprot_id}.json")
- if res_fasta.status_code != 200: raise ValueError(f"ID {uniprot_id} not found.")
- seq = "".join(res_fasta.text.split("\n")[1:])
- # Extract Protein Name
- p_name = "Unknown Protein"
- if res_json.status_code == 200:
- json_data = res_json.json()
- p_name = json_data.get('proteinDescription', {}).get('recommendedName', {}).get('fullName', {}).get('value', "Unknown")
- L = len(seq)
- adj = np.eye(L)
- for i in range(L - 1):
- adj[i, i+1] = 1; adj[i+1, i] = 1
- edge_index = torch.from_numpy(adj).nonzero().t().contiguous().long()
- x = torch.tensor([AA_PHYSICS_5D_SCALED.get(a, AA_PHYSICS_5D_SCALED['X']) for a in seq], dtype=torch.float32)
- data = Data(x=x, edge_index=edge_index)
- package = (data, seq, p_name)
- torch.save(package, cache_path)
- return package
- import shutil # Needed for cache clearing
- def clear_app_cache():
- if os.path.exists(CACHE_DIR):
- shutil.rmtree(CACHE_DIR)
- os.makedirs(CACHE_DIR)
- return "🗑️ Cache cleared! Next prediction will fetch fresh data from UniProt."
- # --- 5. PREDICTION CORE ---
- def run_prediction(bait_id, prey_raw, threshold):
- try:
- prey_ids = [p.strip().upper() for p in prey_raw.replace(',', ' ').split() if p.strip()]
- g_bait, bait_seq, bait_name = get_protein_data(bait_id)
- results = []
- for p_id in prey_ids:
- g_prey, prey_seq, prey_name = get_protein_data(p_id)
- model.eval()
- with torch.no_grad():
- logits = model(Batch.from_data_list([g_bait.to(DEVICE)]),
- Batch.from_data_list([g_prey.to(DEVICE)]))
- prob = 1 - torch.sigmoid(logits).item()
- b_hot, p_hot = get_hotspots(model, g_bait.to(DEVICE), g_prey.to(DEVICE), bait_seq, prey_seq)
- results.append({
- "Bait ID": bait_id,
- "Bait Name": bait_name,
- "Prey ID": p_id,
- "Prey Name": prey_name,
- "Probability": round(prob, 4),
- "Binds": "Yes" if prob >= threshold else "No",
- "Bait Hotspots": b_hot,
- "Prey Hotspots": p_hot,
- "Bait Sequence": bait_seq,
- "Prey Sequence": prey_seq
- })
- torch.cuda.empty_cache()
- df = pd.DataFrame(results)
- # Plotting logic
- plt.figure(figsize=(8, max(4, 0.5 * len(df))))
- sns.barplot(data=df, x='Probability', y='Prey ID', palette='viridis')
- plt.axvline(threshold, color='red', linestyle='--', label=f'Threshold {threshold}')
- plt.title(f"PPI Analysis for Bait: {bait_id}")
- plt.xlim(0, 1)
- plt.legend()
- plt.tight_layout()
- filename = f"gPPIpred_{bait_id}.csv"
- tmp_csv = os.path.join(tempfile.gettempdir(), filename)
- df.to_csv(tmp_csv, index=False)
- return plt.gcf(), df, tmp_csv, f"✅ Analyzed {len(df)} preys."
- except Exception as e:
- return None, None, None, f"❌ Error: {str(e)}"
- # --- 6. INITIALIZATION & UI ---
- model = SiameseGAT_v3(in_channels=5).to(DEVICE)
- MODEL_PATH = "best_siamese_v3_boat.pt"
- if os.path.exists(MODEL_PATH):
- model.load_state_dict(torch.load(MODEL_PATH, map_location=DEVICE, weights_only=True))
- custom_theme = gr.themes.Soft(font=[gr.themes.GoogleFont("Inter"), "sans-serif"])
- with gr.Blocks() as demo:
- gr.Markdown("# 🧬 gPPIpred - High-Throughput Protein-Protein Interaction Predictor)")
- gr.Markdown("Predict protein-protein interactions and maps hotspots using Graph Attention Networks.")
- gr.Markdown("""
- This model uses an **8-layer Graph Attention Network (GATv2)** to predict the probability of interaction between two proteins.
- **Instructions:**
- * Enter a **UniProt ID** for the Bait (e.g., `P04637`).
- * Enter one or more **Prey IDs** separated by commas or spaces.
- * **Isoforms:** To analyze a specific isoform, use the dash notation (e.g., `Q8H8G9-2`). If no dash is used, the model fetches the **canonical** sequence.
- * Adjust the **Sensitivity Threshold** to control the balance between Precision and Discovery.
- * Hotspots are calculated via **Saliency Mapping**. This means the residues listed are specific to the *current* partnership—the Bait's hotspots may change depending on which Prey it is paired with.
- *⚠️ Note: This model was trained on sequences < 1500 AA. Larger proteins will use linear-chain approximations.*
- * Cite this work: J Marques and CC Matiolli, IA Abreu. (2026) Micropublication Biology
- * Full code package available here: https://github.com/19JoanaMarques95/-gPPIpredv2_2.git
- """)
- with gr.Row():
- clear_btn = gr.Button("🗑️ Clear Protein Cache", variant="secondary")
- clear_status = gr.Textbox(label="Cache Status")
- clear_btn.click(clear_app_cache, outputs=clear_status)
- with gr.Column():
- bait_input = gr.Textbox(label="Bait UniProt ID", value="P04637")
- prey_input = gr.Textbox(label="Prey UniProt IDs (comma/space separated)", value="O15169, P00519")
- with gr.Column():
- threshold = gr.Slider(0.1, 0.9, value=0.5, step=0.05, label="Binding Threshold")
- predict_btn = gr.Button("🔍 Run Prediction", variant="primary")
- status_out = gr.Textbox(label="Status")
- with gr.Tabs():
- with gr.TabItem("Bar Chart"):
- plot_out = gr.Plot()
- with gr.TabItem("Results Table"):
- table_out = gr.Dataframe()
- download_btn = gr.File(label="Download Results (.csv)")
- clear_btn.click(clear_app_cache, outputs=clear_status)
- predict_btn.click(
- run_prediction,
- inputs=[bait_input, prey_input, threshold],
- outputs=[plot_out, table_out, download_btn, status_out]
- )
- if __name__ == "__main__":
- demo.launch(theme=custom_theme)
app.py at commit 35e98fc, no license · at the source
Overview
- Instituto de Tecnologia Química e Biológica António Xavier, Universidade Nova de Lisboa (ITQB NOVA), Avenida da República, 2780-157 Oeiras, Portugal
Abstract
Protein–protein interactions (PPIs) govern essential cellular processes but remain challenging to characterize experimentally due to high cost and labor intensity. We present gPPIpred, a scalable computational framework leveraging graph neural networks (GNNs) and attention mechanisms to predict PPIs at residue-level resolution. Proteins are encoded as spatially informed molecular graphs integrating physicochemical features. Using curated structural datasets for training and validation, gPPIpred was fine-tuned to reliably predict positive interactions and actual interacting sites. Attention scores highlight key residues mediating interactions, offering interpretable insights to guide experimental design. gPPIpred combines high predictive performance with explainability, providing a user-friendly pipeline for large-scale PPI discovery.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 4 matches between paragraphs and lines of code.
huggingface.co/spaces/1143joana/gppipredv2_2
35e98fc5a7e1daf110ca860e110ad3fbf2ba0720, 6 March 2026Availability: 1 check, the latest on 29 September 2026: the link answers
- 29 September 2026: the link answers
6 files
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 5 scripts, each with its path and the digest of its content;
- 4 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- figshare:21591618, at figshare; found in the references
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 29 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 3 authors, 30 references.
Cite
This paper
Matiolli, C. C., Marques, J., & Abreu, I. A. (2026). gPPIpred: A User-Friendly PPI Predictor Based on Protein Molecular Graphs. microPublication biology, 2026, 10.17912/
BibTeX
@article{matiolli2026gpp
author = {Matiolli, Cleverson C and Marques, Joana and Abreu, Isabel A},
title = {{gPPIpred: A User-Friendly PPI Predictor Based on Protein Molecular Graphs}},
journal = {microPublication biology},
year = {2026},
month = apr,
volume = {2026},
pages = {10.17912/
publisher = {California Institute of Technology},
issn = {2578-9430},
doi = {10.17912/
url = {https://
pmid = {42039106},
pmcid = {PMC13109786}
}
RIS
TY - JOUR
AU - Matiolli, Cleverson C
AU - Marques, Joana
AU - Abreu, Isabel A
TI - gPPIpred: A User-Friendly PPI Predictor Based on Protein Molecular Graphs
T2 - microPublication biology
J2 - MicroPubl Biol
PY - 2026
DA - 2026/
VL - 2026
SP - 10.17912/
SN - 2578-9430
PB - California Institute of Technology
DO - 10.17912/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.17912/
"type": "article-journal",
"title": "gPPIpred: A User-Friendly PPI Predictor Based on Protein Molecular Graphs",
"container-title": "microPublication biology",
"author": [
{
"family": "Matiolli",
"given": "Cleverson C"
},
{
"family": "Marques",
"given": "Joana"
},
{
"family": "Abreu",
"given": "Isabel A"
}
],
"container-title-short":
"volume": "2026",
"page": "10.17912/
"DOI": "10.17912/
"PMID": "42039106",
"PMCID": "PMC13109786",
"ISSN": "2578-9430",
"publisher": "California Institute of Technology",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
10
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.molcel.2026.07.006 [code]
- DeorphaNN: Virtual screening of GPCR peptide agonists using AlphaFold-predicted active-state complexes and deep learning embeddings.Journal: Molecular cellIn common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, cellular / molecular, 2 references
- [2] doi:10.1038/s41586-026-10670-w [code]
- Zero-shot design of drug-binding proteins via neural iterative selection-expansion.Journal: NatureIn common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, cellular / molecular, 2 references
- [3] doi:10.34133/csbj.0036 [code]
- HYG-mol: An Interpretable Multimodal Hypergraph Framework for Molecular Property Prediction.Journal: Computational and structural biotechnology journalIn common: PyTorch Geometric, PyTorch, pandas, 2 other tools, cellular / molecular, 1 reference
- [4] doi:10.1016/j.isci.2026.116355 [code]
- Tera-MIND: Tera-scale mouse brain simulation via spatial mRNA-guided diffusion.Journal: iScienceIn common: PyTorch, seaborn, pandas, 2 other tools, cellular / molecular, 2 references
- [5] doi:10.1038/s41586-026-10391-0 [code]
- Cell-type-targeted mitochondrial transplantation rescues cell degeneration.Journal: NatureIn common: PyTorch Geometric, PyTorch, pandas, 2 other tools, cellular / molecular, 1 reference
- [6] doi:10.1021/acs.biochem.5c00596 [code]
- Cargo Recognition of Nesprin-2 by the Dynein Adapter Bicaudal D2 for a Nuclear Positioning Pathway That Is Important for Brain Development.Journal: BiochemistryIn common: PyTorch Geometric, PyTorch, pandas, 2 other tools, cellular / molecular, 1 reference
- [7] doi:10.64898/2026.08.18.26360725 [code]
- Temporal pole blurring in hippocampal sclerosis reflects seizure-disrupted myelinationJournal: medRxiv (preprint)In common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, cellular / molecular
- [8] doi:10.1371/journal.pcbi.1014327 [code]
- Supervised deep learning with gene functional annotation for cell classification.Journal: PLoS computational biologyIn common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, cellular / molecular
- [9] doi:10.1038/s41467-026-71759-4 [code]
- CellNiche represents cellular microenvironments in atlas-scale spatial omics data with contrastive learning.Journal: Nature communicationsIn common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, cellular / molecular
- [10] doi:10.1038/s41398-026-03965-z [code]
- Disentangling individual heterogeneity reveals robust network and molecular signatures of major depressive disorder with suicidal ideation.Journal: Translational psychiatryIn common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, cellular / molecular
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 5 scripts, and 4 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:e12778667447c71c…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
