proteINET is a small toolkit to fetch, analyze and visualize protein–protein interaction (PPI) networks using the STRING database. It builds PPI networks from a list of query proteins, computes network metrics, runs enrichment (GSEA), exports Cytoscape-ready files and generates an interactive HTML report.
- Query STRING-DB (functional or physical networks)
- Compute global, node and edge network metrics
- Export nodes/edges/graph (CSV, GraphML) for Cytoscape
- Run GSEA (via gseapy) on ranked gene lists
- Generate an interactive HTML report (Cytoscape.js + plots)
- Python 3.11 (recommended)
- Conda (recommended) or pip
- Network access to the STRING API
A curated environment is provided in environment.yml (includes networkx, pandas, matplotlib, gseapy, requests, pyvis, etc.).
- Clone the repository:
git clone https://github.com/GiuseppeBocci/proteINET.git
cd proteINET- Create and activate the conda environment:
conda env create -f environment.yml
conda activate proteINETIf not using conda, install the pip packages listed in environment.yml.
Run the example pipeline shipped with the repo: python main.py
The example pipeline queries STRING for proteins (TP53, BRCA1), builds the network, computes metrics, runs GSEA, exports Cytoscape files to cytoscape_export/ and generates protein_network_report.html.
Fetch and standardize STRING network:
from graph.StringLoader import StringLoader
oader = StringLoader(protein_query=["TP53","BRCA1"], species=9606, add_nodes=20)
data = loader.retrieve_data().standardize_data_format().get_data()Build network and compute metrics:
from graph.PPINetwork import PPINetwork
ppin = PPINetwork(data=data) ppin.compute_all_global_metrics(weighted=False) ppin.compute_all_node_metrics(weighted=False) ppin.compute_all_edge_metrics(weighted=False)Export for Cytoscape:
exported = ppin.export_for_cytoscape(output_dir="cytoscape_export", basename="ppi_network_TP53-BRCA1")Generate interactive HTML report:
from visual.ReportGenerator import ReportGenerator
report_generator = ReportGenerator()
report_generator.add_cytoscape_html_report(ppin, title="STRING Protein Network").generate_report_file("protein_network_report.html")- protein_network_report.html — interactive HTML report
- cytoscape_export/ — nodes CSV, edges CSV, GraphML, metrics JSON
- gsea_results/ — prerank files and enrichment reports
StringLoader parameters to tune:
- required_score (int): minimum confidence score (default 400)
- add_nodes (int): number of additional nodes to include
- timeout (int): HTTP request timeout (seconds)
For large networks increase timeouts and consider filtering by required_score.
- Ensure network access and that STRING API is reachable.
- If mapping fails, confirm input protein identifiers are correct.
- Respect STRING usage policies and rate limits.
- If HTML report fails to load Cytoscape locally, it falls back to the CDN.
- main.py - example pipeline that ties components together
- graph/ - core PPI classes (Loader, StringLoader, PPINetwork)
- visual/ - ReportGenerator and plotting helpers
- environment.yml - conda environment and pip deps
- cytoscape_export/, gsea_results/ - example outputs (created when running pipeline)
See LICENSE.md (Copyright (C) 2026 Giuseppe Bocci)