Graph visualization interactive rendering
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill graph-visualization-interactive-renderingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when after constructing a NetworkX graph object from structural clusters (via MamsiStructSearch), when you need to interactively explore feature relationships or publish a static network diagram showing isotopologue links, adduct relationships, and cross-assay connections.
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
7.5 KB, as published. Nobody here has run it
graph-visualization-interactive-rendering
Summary
Render a NetworkX graph object as an interactive force-directed network visualization using pyvis, or as a static matplotlib plot, optionally with node labels and HTML export. This skill is used to display structural relationships (isotopologue, adduct, and cross-assay links) between mass spectrometry features organized into clusters.
When to use
After constructing a NetworkX graph object from structural clusters (via MamsiStructSearch), when you need to interactively explore feature relationships or publish a static network diagram showing isotopologue links, adduct relationships, and cross-assay connections. Triggered when return_nx_object=True or when the graph structure is ready for human interpretation.
When NOT to use
- Graph structure is not yet constructed from structural clusters—use MamsiStructSearch first.
- You need to perform further graph analysis (centrality, clustering detection)—export the NetworkX object instead and use dedicated graph analysis libraries.
- Input is not a NetworkX graph object—validate the object type before rendering.
Inputs
- NetworkX graph object with features as nodes
- Node attributes: assay, cluster membership, compound name (optional)
- Weighted edges: isotopologue (weight=1), adduct (weight=5), cross-assay (weight=10)
Outputs
- Interactive HTML file with pyvis force-directed visualization
- Static matplotlib figure with optional node labels
- NetworkX graph object (if return_nx_object=True)
How to apply
Pass the NetworkX graph object (with nodes representing features and edges representing structural relationships weighted by link type: isotopologue=1, adduct=5, cross-assay=10) to either the pyvis renderer (for interactive HTML output with force-directed layout) or the NetworkX/matplotlib combination (for static rendering). The pyvis output uses a physics-based layout to spatially separate clusters, improving readability. Set include_all=True to render all features or False to show only features with at least one structural link. Optionally enable node labels (labels=True) to display feature identifiers. Save the output as an HTML file for interactive exploration in a web browser, or display statically using matplotlib.
Related tools
- pyvis (Interactive force-directed graph rendering and HTML export)
- networkx (Graph construction and manipulation; static rendering via matplotlib integration)
- matplotlib (Static 2D visualization of NetworkX graph with optional node labels)
- pandas (Loading structural cluster DataFrame with feature, cluster, and link attributes)
- MamsiStructSearch (Source tool that generates structural clusters and correlation clusters prior to graph construction) — https://github.com/kopeckylukas/py-mamsi
Examples
network = struct.get_structural_network(include_all=True, interactive=True, labels=True, return_nx_object=True)
Evaluation signals
- HTML file is generated and renders without errors in a web browser with interactive zoom, pan, and hover tooltips.
- Nodes are positioned spatially such that densely connected clusters (high edge weight) are grouped closer together.
- Node colors correspond to flattened hierarchical correlation clusters; edge types visually reflect link weight (isotopologue, adduct, cross-assay).
- All features specified by include_all parameter are present or only those with structural links are rendered, as configured.
- Node labels (if enabled) are readable and correspond to feature identifiers in the input DataFrame.
- Static matplotlib output can be saved as a publication-ready image with consistent layout across runs.
Limitations
- Large graphs (>500 features) may be visually cluttered or slow to render interactively; consider filtering or subgraph extraction first.
- pyvis force-directed layout is non-deterministic; repeated renders may produce different spatial arrangements unless a random seed is set.
- Node label density can obscure edges and node positions in dense subgraphs; toggling labels or zooming is necessary.
- HTML output is browser-specific; rendering performance varies with browser capabilities and available system memory.
- The skill does not perform graph layout optimization beyond pyvis default physics parameters; custom layout algorithms require external networkx plugins.
Evidence
- [methods] Construct a NetworkX graph with features as nodes, assigning node attributes (assay, cluster membership, compound name). Create edges between features based on structural relationships: isotopologue links (weight=1), adduct links (weight=5), and cross-assay links (weight=10).: "Construct a NetworkX graph with features as nodes, assigning node attributes (assay, cluster membership, compound name). 3. Create edges between features based on structural relationships:"
- [methods] Render the graph interactively using pyvis with force-directed layout and save as HTML output_file, or display statically using NetworkX and matplotlib with optional node labels.: "Render the graph interactively using pyvis with force-directed layout and save as HTML output_file, or display statically using NetworkX and matplotlib with optional node labels."
- [readme] the different node colours represent different flattened hierarchical correlation clusters, while the edges between nodes identify their structural links.: "the different node colours represent different flattened hierarchical correlation clusters, while the edges between nodes identify their structural links."
- [methods] Optionally include all features in the network or only those with structural links, controlled by the include_all parameter.: "Optionally include all features in the network or only those with structural links, controlled by the include_all parameter."
- [methods] If return_nx_object=True, return the NetworkX graph object for downstream curation.: "If return_nx_object=True, return the NetworkX graph object for downstream curation."