MicrobiomeKG Visualization Tool. MBKGVisual reads compressed graph data (NODES and EDGES TSV files), builds a NetworkX graph, samples it using degree-based neighbor expansion (0.1% of nodes), and generates an interactive HTML visualization using Pyvis.
Install Dependencies
pip install pyvis networkx polars pandas pyarrow backports.zstd scipyRun Visualization
python3 ./main.pyThis reads ./NODES.tsv.zst and ./EDGES.tsv.zst and outputs ./index.html.
The visualization pipeline is implemented in main.py:
- read_tsv - Decompress zstd TSV files into Polars DataFrames
- is_sig - Filter edges where
significant == "YES" - sanitize - Remove invalid nodes (
"1","2","3","4") and self-loops - is_directed - Split edges:
biolink:affectsis directed, others are undirected - mkgraph - Build NetworkX DiGraph (undirected edges get symmetric pairs)
- sampler - Degree-based neighbor expansion sampling (0.1% of nodes)
- mkvis - Generate interactive HTML via pyvis