Graph embedding coordinate extraction
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-embedding-coordinate-extractionAssembled 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 you have a network object (loaded as igraph or MetaNet format with edges and nodes defined) and need to assign two-dimensional spatial coordinates to nodes for downstream visualization on static platforms (ggplot2, base R graphics) or interactive viewers (Gephi, Cytoscape).
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
8.0 KB, as published. Nobody here has run it
Reconstruct application of a named layout algorithm from the layout library to a network
License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->
Summary
Extract spatial coordinates (x, y positions) from network nodes after applying a layout algorithm in MetaNet, enabling visualization-ready coordinate assignments for static and interactive network plots. This skill bridges network topology computation and visual rendering by materializing abstract graph structure into Cartesian node positions.
When to use
You have a network object (loaded as igraph or MetaNet format with edges and nodes defined) and need to assign two-dimensional spatial coordinates to nodes for downstream visualization on static platforms (ggplot2, base R graphics) or interactive viewers (Gephi, Cytoscape). Triggers include: preparing a network for publication-quality plotting, exporting node positions for use in external visualization tools, or comparing layouts across different algorithms to select the most interpretable arrangement.
When NOT to use
- Network has already been embedded; you need only to export or reuse existing coordinates rather than compute new ones.
- Your visualization tool requires 3D coordinates; MetaNet's standard layout functions emit 2D positions only.
- Network is very large (>100k nodes) and you prioritize speed over layout quality; force-directed algorithms may be prohibitively slow without specialized approximations.
Inputs
- network object (igraph or metanet class) with nodes and edges
- optional: grouping metadata for group-aware or multi-level layout algorithms
- optional: node attributes (class, size, abundance) for guided layout initialization
Outputs
- coordinate table (data frame or matrix): node identifiers + x, y positions
- exportable CSV or TSV file with node IDs and Cartesian coordinates
- layout object compatible with MetaNet's c_net_plot() for visualization
How to apply
Load your network object into MetaNet in R (as a metanet class or igraph object). Select one of MetaNet's 40+ layout algorithms—such as force-directed (spring-based), hierarchical (layered), circular, or spatstat-based layouts—depending on your network topology and interpretability goals. Call the layout function (e.g., g_layout_*() family) on the network, specifying any tuning parameters (e.g., iteration counts, spring constants, or group constraints for multi-level layouts). Extract the resulting coordinate matrix (typically a two-column data frame with node identifiers and x, y positions). Export this table as CSV or TSV for reuse, validation, or external visualization. Verify output by checking that all nodes have valid numeric coordinates, no NAs are present, and coordinate ranges are reasonable for your downstream tool.
Related tools
- MetaNet (primary layout computation and coordinate extraction engine; implements 40+ layout algorithms and exports coordinate tables) — https://github.com/Asa12138/MetaNet
- igraph (underlying graph object representation and layout algorithm library that MetaNet wraps)
- R (runtime environment and base language for MetaNet functions and coordinate I/O)
Examples
library(MetaNet)
data("otutab", package="pcutils")
cor <- c_net_calculate(t2(otutab[1:70,]))
net <- c_net_build(cor, r_threshold=0.65)
coors <- g_layout(net, layout_algorithm='fr')
head(coors)
Evaluation signals
- All nodes in the network have assigned coordinates; no missing or NaN values in x or y columns.
- Coordinate values are numeric and within a reasonable range (e.g., not infinite or extreme outliers suggesting convergence failure).
- When re-imported and plotted, the coordinate table reproduces the visual structure expected from the chosen layout algorithm (e.g., force-directed produces balanced spreading; hierarchical produces clear layering).
- Exported CSV/TSV file can be parsed by external tools (validated against schema: node_id, x, y columns with correct delimiters).
- Comparison with benchmark layouts (e.g., circular or random) shows the algorithm-specific layout has improved or maintained desired properties (e.g., edge-crossing minimization, group separation).
Limitations
- Layout algorithms are heuristic; results may vary across runs (especially force-directed), and convergence is not guaranteed to global optimality.
- Scalability degrades for very large networks (>100k nodes); computation time and memory usage grow nonlinearly. MetaNet claims improvements but is not suitable for billion-scale graphs.
- 2D layouts lose information inherent in higher-dimensional network structure; interpret coordinates as one projection, not canonical representation.
- Group-aware and multi-level layouts require metadata (grouping columns) to be correctly attached; missing or misnamed attributes silently fall back to standard layout.
- Exported coordinates are snapshot-dependent on algorithm seed and parameters; reproducibility requires version pinning and seed recording.
Evidence
- [other] MetaNet provides over 40 layout algorithms that can be applied to position nodes in a network for visualization on both static and interactive platforms.: "MetaNet provides over 40 layout algorithms that can be applied to position nodes in a network for visualization on both static and interactive platforms."
- [other] Extract computed node coordinates (x, y positions) from the layout output. Export the coordinate table as a tabular file (CSV or TSV) with node identifiers and their assigned positions.: "Extract computed node coordinates (x, y positions) from the layout output. 4. Export the coordinate table as a tabular file (CSV or TSV) with node identifiers and their assigned positions."
- [readme] MetaNet's architecture comprises several core functional modules: Calculation, Manipulation, Layout, Visualization, Topology analysis, Module analysis, Stability analysis, and I/O, supporting the end-to-end analytical process from network construction to visualization.: "its architecture comprises several core functional modules: Calculation, Manipulation, Layout, Visualization, Topology analysis, Module analysis, Stability analysis, and I/O (Figure 1A), supporting"
- [intro] providing over 40 layout algorithms, rich annotation utilities, and visualization options compatible with both static and interactive platforms: "providing over 40 layout algorithms, rich annotation utilities, and visualization options compatible with both static and interactive platforms"