OSCR

gPPIpred: A User-Friendly PPI Predictor Based on Protein Molecular Graphs.

Code ↔ Paper

4 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 4 matches
  1. [1] § Description ↔ app.py, lines 176–229 · score 0.69 · bar chart, UniProt, prey IDs, app, download, Binds
  2. [2] § Description ↔ bapp.py, lines 189–248 · score 0.69 · bar chart, UniProt, prey IDs, download, app, Binds
  3. [3] § paragraph 0 ↔ app.py, lines 176–229 · score 0.58 · UniProt, prey IDs, Precision, Sensitivity, app, chart
  4. [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

  1. import os
  2. import requests
  3. import torch
  4. import torch.nn as nn
  5. import torch.nn.functional as F
  6. import numpy as np
  7. import pandas as pd
  8. import gradio as gr
  9. import matplotlib.pyplot as plt
  10. import seaborn as sns
  11. import tempfile
  12. from torch_geometric.data import Data, Batch
  13. from torch_geometric.nn import GATv2Conv, global_mean_pool
  14. # --- 1. CONFIGURATION & PHYSICS ---
  15. DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
  16. AA_PHYSICS_5D_SCALED = {
  17. 'A': [0.70, 0.17, 0.11, 0.40, 0.00], 'R': [0.00, 0.67, 0.71, 1.00, 1.00],
  18. 'N': [0.11, 0.32, 0.33, 0.33, 0.00], 'D': [0.11, 0.30, 0.26, 0.00, 0.31],
  19. 'C': [0.78, 0.29, 0.31, 0.29, 0.67], 'Q': [0.11, 0.50, 0.44, 0.36, 0.00],
  20. 'E': [0.11, 0.47, 0.37, 0.06, 0.34], 'G': [0.46, 0.00, 0.00, 0.40, 0.00],
  21. 'H': [0.14, 0.55, 0.56, 0.60, 0.48], 'I': [1.00, 0.64, 0.45, 0.41, 0.00],
  22. 'L': [0.92, 0.64, 0.45, 0.40, 0.00], 'K': [0.07, 0.65, 0.54, 0.87, 0.84],
  23. 'M': [0.66, 0.61, 0.54, 0.37, 0.00], 'F': [0.81, 0.77, 0.72, 0.34, 0.00],
  24. 'P': [0.32, 0.31, 0.32, 0.44, 0.00], 'S': [0.41, 0.17, 0.15, 0.36, 0.00],
  25. 'T': [0.42, 0.33, 0.26, 0.35, 0.00], 'W': [0.40, 1.00, 1.00, 0.39, 0.00],
  26. 'Y': [0.36, 0.79, 0.73, 0.36, 0.81], 'V': [0.97, 0.48, 0.34, 0.40, 0.00],
  27. 'X': [0.00, 0.00, 0.00, 0.00, 0.00]
  28. }
  29. # --- 2. ARCHITECTURE ---
  30. class SiameseGAT_v3(nn.Module):
  31. def __init__(self, in_channels=5, hidden_channels=64, num_layers=8):
  32. super(SiameseGAT_v3, self).__init__()
  33. self.node_lin = nn.Linear(in_channels, hidden_channels)
  34. self.convs = nn.ModuleList()
  35. self.batch_norms = nn.ModuleList()
  36. for _ in range(num_layers):
  37. self.convs.append(GATv2Conv(hidden_channels, hidden_channels // 4, heads=4))
  38. self.batch_norms.append(nn.BatchNorm1d(hidden_channels))
  39. self.fc = nn.Sequential(
  40. nn.Linear(hidden_channels * 2, 256),
  41. nn.ReLU(),
  42. nn.Dropout(0.3),
  43. nn.Linear(256, 128),
  44. nn.ReLU(),
  45. nn.Linear(128, 1)
  46. )
  47. def forward_once(self, data):
  48. x, edge_index, batch = data.x, data.edge_index, data.batch
  49. x = self.node_lin(x)
  50. for conv, bn in zip(self.convs, self.batch_norms):
  51. h = conv(x, edge_index)
  52. h = bn(h)
  53. h = F.elu(h)
  54. x = x + h
  55. return global_mean_pool(x, batch)
  56. def forward(self, g1, g2):
  57. out1 = self.forward_once(g1)
  58. out2 = self.forward_once(g2)
  59. combined = torch.cat([out1, out2], dim=1)
  60. return self.fc(combined)
  61. # --- 3. HOTSPOT LOGIC ---
  62. def get_hotspots(model, g_bait, g_prey, bait_seq, prey_seq, top_n=10):
  63. g_bait.x.requires_grad = True
  64. g_prey.x.requires_grad = True
  65. logits = model(Batch.from_data_list([g_bait]), Batch.from_data_list([g_prey]))
  66. model.zero_grad()
  67. logits.backward()
  68. def extract_top(grad, seq):
  69. importance = grad.abs().sum(dim=1).cpu().numpy()
  70. indices = np.argsort(importance)[-top_n:][::-1]
  71. return ", ".join([f"{seq[i]}{i+1}" for i in indices if i < len(seq)])
  72. return extract_top(g_bait.x.grad, bait_seq), extract_top(g_prey.x.grad, prey_seq)
  73. # --- 4. DATA UTILS ---
  74. CACHE_DIR = "protein_cache"
  75. os.makedirs(CACHE_DIR, exist_ok=True)
  76. def get_protein_data(uniprot_id):
  77. uniprot_id = uniprot_id.strip().upper()
  78. cache_path = os.path.join(CACHE_DIR, f"{uniprot_id}.pt")
  79. if os.path.exists(cache_path): return torch.load(cache_path)
  80. # Fetch FASTA for sequence
  81. res_fasta = requests.get(f"https://rest.uniprot.org/uniprotkb/{uniprot_id}.fasta")
  82. # Fetch JSON for metadata (Protein Name)
  83. res_json = requests.get(f"https://rest.uniprot.org/uniprotkb/{uniprot_id}.json")
  84. if res_fasta.status_code != 200: raise ValueError(f"ID {uniprot_id} not found.")
  85. seq = "".join(res_fasta.text.split("\n")[1:])
  86. # Extract Protein Name
  87. p_name = "Unknown Protein"
  88. if res_json.status_code == 200:
  89. json_data = res_json.json()
  90. p_name = json_data.get('proteinDescription', {}).get('recommendedName', {}).get('fullName', {}).get('value', "Unknown")
  91. L = len(seq)
  92. adj = np.eye(L)
  93. for i in range(L - 1):
  94. adj[i, i+1] = 1; adj[i+1, i] = 1
  95. edge_index = torch.from_numpy(adj).nonzero().t().contiguous().long()
  96. x = torch.tensor([AA_PHYSICS_5D_SCALED.get(a, AA_PHYSICS_5D_SCALED['X']) for a in seq], dtype=torch.float32)
  97. data = Data(x=x, edge_index=edge_index)
  98. package = (data, seq, p_name)
  99. torch.save(package, cache_path)
  100. return package
  101. import shutil # Needed for cache clearing
  102. def clear_app_cache():
  103. if os.path.exists(CACHE_DIR):
  104. shutil.rmtree(CACHE_DIR)
  105. os.makedirs(CACHE_DIR)
  106. return "🗑️ Cache cleared! Next prediction will fetch fresh data from UniProt."
  107. # --- 5. PREDICTION CORE ---
  108. def run_prediction(bait_id, prey_raw, threshold):
  109. try:
  110. prey_ids = [p.strip().upper() for p in prey_raw.replace(',', ' ').split() if p.strip()]
  111. g_bait, bait_seq, bait_name = get_protein_data(bait_id)
  112. results = []
  113. for p_id in prey_ids:
  114. g_prey, prey_seq, prey_name = get_protein_data(p_id)
  115. model.eval()
  116. with torch.no_grad():
  117. logits = model(Batch.from_data_list([g_bait.to(DEVICE)]),
  118. Batch.from_data_list([g_prey.to(DEVICE)]))
  119. prob = 1 - torch.sigmoid(logits).item()
  120. b_hot, p_hot = get_hotspots(model, g_bait.to(DEVICE), g_prey.to(DEVICE), bait_seq, prey_seq)
  121. results.append({
  122. "Bait ID": bait_id,
  123. "Bait Name": bait_name,
  124. "Prey ID": p_id,
  125. "Prey Name": prey_name,
  126. "Probability": round(prob, 4),
  127. "Binds": "Yes" if prob >= threshold else "No",
  128. "Bait Hotspots": b_hot,
  129. "Prey Hotspots": p_hot,
  130. "Bait Sequence": bait_seq,
  131. "Prey Sequence": prey_seq
  132. })
  133. torch.cuda.empty_cache()
  134. df = pd.DataFrame(results)
  135. # Plotting logic
  136. plt.figure(figsize=(8, max(4, 0.5 * len(df))))
  137. sns.barplot(data=df, x='Probability', y='Prey ID', palette='viridis')
  138. plt.axvline(threshold, color='red', linestyle='--', label=f'Threshold {threshold}')
  139. plt.title(f"PPI Analysis for Bait: {bait_id}")
  140. plt.xlim(0, 1)
  141. plt.legend()
  142. plt.tight_layout()
  143. filename = f"gPPIpred_{bait_id}.csv"
  144. tmp_csv = os.path.join(tempfile.gettempdir(), filename)
  145. df.to_csv(tmp_csv, index=False)
  146. return plt.gcf(), df, tmp_csv, f"✅ Analyzed {len(df)} preys."
  147. except Exception as e:
  148. return None, None, None, f"❌ Error: {str(e)}"
  149. # --- 6. INITIALIZATION & UI ---
  150. model = SiameseGAT_v3(in_channels=5).to(DEVICE)
  151. MODEL_PATH = "best_siamese_v3_boat.pt"
  152. if os.path.exists(MODEL_PATH):
  153. model.load_state_dict(torch.load(MODEL_PATH, map_location=DEVICE, weights_only=True))
  154. custom_theme = gr.themes.Soft(font=[gr.themes.GoogleFont("Inter"), "sans-serif"])
  155. with gr.Blocks() as demo:
  156. gr.Markdown("# 🧬 gPPIpred - High-Throughput Protein-Protein Interaction Predictor)")
  157. gr.Markdown("Predict protein-protein interactions and maps hotspots using Graph Attention Networks.")
  158. gr.Markdown("""
  159. This model uses an **8-layer Graph Attention Network (GATv2)** to predict the probability of interaction between two proteins.
  160. **Instructions:**
  161. * Enter a **UniProt ID** for the Bait (e.g., `P04637`).
  162. * Enter one or more **Prey IDs** separated by commas or spaces.
  163. * **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.
  164. * Adjust the **Sensitivity Threshold** to control the balance between Precision and Discovery.
  165. * 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.
  166. *⚠️ Note: This model was trained on sequences < 1500 AA. Larger proteins will use linear-chain approximations.*
  167. * Cite this work: J Marques and CC Matiolli, IA Abreu. (2026) Micropublication Biology
  168. * Full code package available here: https://github.com/19JoanaMarques95/-gPPIpredv2_2.git
  169. """)
  170. with gr.Row():
  171. clear_btn = gr.Button("🗑️ Clear Protein Cache", variant="secondary")
  172. clear_status = gr.Textbox(label="Cache Status")
  173. clear_btn.click(clear_app_cache, outputs=clear_status)
  174. with gr.Column():
  175. bait_input = gr.Textbox(label="Bait UniProt ID", value="P04637")
  176. prey_input = gr.Textbox(label="Prey UniProt IDs (comma/space separated)", value="O15169, P00519")
  177. with gr.Column():
  178. threshold = gr.Slider(0.1, 0.9, value=0.5, step=0.05, label="Binding Threshold")
  179. predict_btn = gr.Button("🔍 Run Prediction", variant="primary")
  180. status_out = gr.Textbox(label="Status")
  181. with gr.Tabs():
  182. with gr.TabItem("Bar Chart"):
  183. plot_out = gr.Plot()
  184. with gr.TabItem("Results Table"):
  185. table_out = gr.Dataframe()
  186. download_btn = gr.File(label="Download Results (.csv)")
  187. clear_btn.click(clear_app_cache, outputs=clear_status)
  188. predict_btn.click(
  189. run_prediction,
  190. inputs=[bait_input, prey_input, threshold],
  191. outputs=[plot_out, table_out, download_btn, status_out]
  192. )
  193. if __name__ == "__main__":
  194. demo.launch(theme=custom_theme)

app.py at commit 35e98fc, no license · at the source

Overview

Authors: Cleverson C Matiolli1, Joana Marques1, Isabel A Abreu1
ORCID iDs: Joana Marques
  1. 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
Journal: microPublication biology, volume 2026, article 10.17912/micropub.biology.001796
Dates: received 12 August 2025; accepted 10 April 2026; published online 10 April 2026
Type: Brief report · Language: English
License: CC BY
Identifiers: DOI 10.17912/micropub.biology.001796 · PMID 42039106 · PMCID PMC13109786 · OpenAlex W7153181198
Open access: green, a free copy (OpenAlex)
Status: code verified
Categories: cellular / molecular (subfield)
Topic: Bioinformatics and Genomic Networks (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Citations: not cited yet (Europe PMC); 32 references in the paper

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

License: none: the authors keep all their rights
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 35e98fc5a7e1daf110ca860e110ad3fbf2ba0720, 6 March 2026
Languages: Python (5)
Size: 12 files, 5 scripts
Software Heritage: not archived
Found in: the text, “Description”
Holds: README, environment (Dockerfile, requirements.txt, runtime.txt)
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: PyTorch (5 files), Matplotlib (4 files), NumPy (4 files), pandas (4 files), PyTorch Geometric (4 files), seaborn (4 files)
Availability: 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

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/micropub.biology.001796. https://doi.org/10.17912/micropub.biology.001796

BibTeX

@article{matiolli2026gppipred,
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/micropub.biology.001796},
publisher = {California Institute of Technology},
issn = {2578-9430},
doi = {10.17912/micropub.biology.001796},
url = {https://doi.org/10.17912/micropub.biology.001796},
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/04/10
VL - 2026
SP - 10.17912/micropub.biology.001796
SN - 2578-9430
PB - California Institute of Technology
DO - 10.17912/micropub.biology.001796
UR - https://doi.org/10.17912/micropub.biology.001796
LA - en
ER -

CSL-JSON

{
"id": "10.17912/micropub.biology.001796",
"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": "MicroPubl Biol",
"volume": "2026",
"page": "10.17912/micropub.biology.001796",
"DOI": "10.17912/micropub.biology.001796",
"PMID": "42039106",
"PMCID": "PMC13109786",
"ISSN": "2578-9430",
"publisher": "California Institute of Technology",
"URL": "https://doi.org/10.17912/micropub.biology.001796",
"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 cell
In 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: Nature
In 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 journal
In 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: iScience
In 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: Nature
In 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: Biochemistry
In 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 myelination
Journal: 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 biology
In 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 communications
In 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 psychiatry
In 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.

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: 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.