← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-data-visualization-network-visualization / references / usage-guide.md

Network Visualization - Usage Guide

Overview

Network visualizations render protein-interaction, gene-regulatory, co-expression, and pathway graphs. Layout choice dominates the result: force-directed (Fruchterman-Reingold, ForceAtlas2) is general-purpose but layout positions are NOT biologically meaningful; hive plots (Krzywinski 2012) and circular layouts preserve categorical structure; hierarchical edge bundling (Holten 2006) reduces hairball clutter for many-to-many. NetworkX + matplotlib for static publication; PyVis for interactive HTML; Cytoscape for journal-grade composition.

Prerequisites

pip install networkx pyvis py4cytoscape matplotlib numpy
# Large networks:
pip install datashader
install.packages(c('igraph', 'ggraph', 'tidygraph'))

Quick Start

Tell your AI agent what you want to do: - "Plot PPI network with degree-sized nodes and community-colored modules using NetworkX" - "ForceAtlas2 layout for a 5000-node scale-free network" - "Interactive PyVis HTML with hover tooltips" - "Send the network to Cytoscape with degree-based styling via py4cytoscape" - "Hive plot anchored by module assignment"

Example Prompts

Standard PPI

"PPI network of 200 proteins from STRING. Spring layout with fixed seed. Color nodes by community via greedy_modularity_communities. Size by degree. Label only hubs (degree >= 5)."

Large network

"5000-node co-expression network. Use ForceAtlas2 layout. Bundle edges with hierarchical edge bundling. Rasterize for PDF."

Comparing conditions

"Two PPI networks (control vs treatment). Compute layout on the UNION graph; render both with the same pos so visual changes reflect biology not layout."

Interactive supplement

"PyVis HTML with degree-based node size and module-based color; force-atlas physics; export standalone HTML."

Cytoscape pipeline

"Send NetworkX graph to Cytoscape via py4cytoscape; apply degree-mapping style; export PDF."

What the Agent Will Do

  1. Load network from edge list / GraphML / SIF / interaction-database query.
  2. Compute basic stats (degree distribution, density, modularity).
  3. Choose layout: force-directed for general; hive for comparative; circular for small dense; edge bundling for many-to-many.
  4. Set random seed (always); reuse pos when comparing conditions.
  5. Compute node attributes (degree, betweenness, community assignment).
  6. Render with NetworkX layered drawing (draw_networkx_edges, nodes, labels) for fine control.
  7. Label hubs only (cap at degree threshold or ~30 labels).
  8. Encode edge weights via line width when meaningful.
  9. Export PDF for static (with raster for >2000 nodes) or HTML for interactive.

Tips