gPPIpred: A User-Friendly PPI Predictor Based on Protein Molecular Graphs.
2 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 4 matches
- [1] § Description ↔ app.py, lines 176 to 229 · score 0.69 · bar chart, UniProt, prey IDs, app, download, Binds · block
oscr:b:EH2HNSQV26THN-0· Report a mismatch - [2] § Description ↔ bapp.py, lines 189 to 248 · score 0.69 · bar chart, UniProt, prey IDs, download, app, Binds · block
oscr:b:5Y6M9T1T2X67H-G· Report a mismatch - [3] § paragraph 0 ↔ app.py, lines 176 to 229 · score 0.58 · UniProt, prey IDs, Precision, Sensitivity, app, chart · block
oscr:b:EH2HNSQV26THN-0· Report a mismatch - [4] § paragraph 0 ↔ bapp.py, lines 189 to 248 · score 0.57 · UniProt, prey IDs, Precision, Sensitivity, chart, download · block
oscr:b:5Y6M9T1T2X67H-G· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: 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.isci.2022.105169
- ADH-PPI: An attention-based deep hybrid model for protein-protein interaction prediction.Journal: iScienceIn common: cellular / molecular, 5 references
- [2] doi:10.1126/sciadv.ady9811
- NAD&
lt;sup& gt;+& lt;/ sup& gt; reverses Alzheimer's neurological deficits via regulating differential alternative RNA splicing of & lt;i& gt;EVA1C& lt;/ i& gt;. Journal: Science advancesIn common: 5 references - [3] 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
- [4] 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
- [5] doi:10.1038/s41594-023-01004-9 [code]
- Phosphatidylserine-depen
dent structure of synaptogyrin remodels the synaptic vesicle membrane. Journal: Nature structural & molecular biologyIn common: PyTorch Geometric, PyTorch, pandas, 2 other tools, cellular / molecular, 2 references - [6] doi:10.1038/s41586-026-10156-9 [code]
- Scalable and multiplexed recorders of gene regulation dynamics across weeks.Journal: NatureIn common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, cellular / molecular, 1 reference
- [7] doi:10.1021/acs.jcim.4c00467 [code]
- RhoMax: Computational Prediction of Rhodopsin Absorption Maxima Using Geometric Deep Learning.Journal: Journal of chemical information and modelingIn common: PyTorch Geometric, PyTorch, pandas, 2 other tools, 2 references
- [8] doi:10.1162/netn_a_00451 [code]
- A graph neural network approach to investigate brain critical states over neurodevelopment.Journal: Network neuroscience (Cambridge, Mass.)In common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, 1 reference
- [9] doi:10.1162/imag_a_00378 [code]
- Group-common and individual-specific effects of structure-function coupling in human brain networks with graph neural networks.Journal: Imaging neuroscience (Cambridge, Mass.)In common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, 1 reference
- [10] doi:10.1093/nargab/lqae021 [code]
- Detecting anomalous proteins using deep representations.Journal: NAR genomics and bioinformaticsIn common: PyTorch Geometric, PyTorch, seaborn, 3 other tools, 1 reference
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:58500bcb77d3288d…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.17912/micropub.biology.001796)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.17912/micropub.biology.001796.svg
:target: https://openscicode.org/badge/doi/10.17912/micropub.biology.001796
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.17912/micropub.biology.001796"><img src="https://openscicode.org/badge/doi/10.17912/micropub.biology.001796.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
