Jacobian matrix graph conversion
Use when after computing a Jacobian matrix from covariance data in MInfer, when you need to visualize and interpret the structure of metabolite-to-metabolite interactions as a network.From its SKILL.md
npx -y skills add HolobiomicsLab/asb-skill-collections --skill jacobian-matrix-graph-conversionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 15 stars15 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 file declares
Copied from the file, not written here
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.4 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Reconstruct the metabolite interaction network visualization from a Jacobian matrix
Summary
Convert a computed Jacobian matrix into a directed network graph where metabolites are nodes and Jacobian coefficients represent weighted, directed edges encoding interaction strength and direction. This skill bridges numerical matrix output to interpretable network visualization for metabolomic systems.
When to use
After computing a Jacobian matrix from covariance data in MInfer, when you need to visualize and interpret the structure of metabolite-to-metabolite interactions as a network. Use this skill when your analysis goal requires identifying which metabolites directly influence others and the strength/directionality of those influences in a visual, traversable format.
When NOT to use
- Input is a covariance matrix that has not yet been converted to Jacobian form — compute Jacobian first using calculate_jacobian().
- Metabolite identifiers are missing, inconsistent, or not present in both rows and columns of the matrix — validate and standardize IDs before graph construction.
- You need only statistical summary (e.g., interaction strength distribution) and do not require an interactive or spatial network view — use heatmap or summary statistics instead.
Inputs
- Jacobian matrix (R matrix object with row and column names as metabolite identifiers)
- Interaction threshold or significance cutoff (optional; numeric scalar)
Outputs
- Network graph object (igraph or tidygraph class)
- Network visualization plot (PNG, PDF, or interactive HTML)
- Edge list (data.frame with source, target, weight columns)
How to apply
Load the Jacobian matrix numerical output (R matrix object) into R. Extract edge information by identifying non-zero or significant coefficients that represent metabolite-to-metabolite interactions; threshold or filter based on interaction magnitude if needed to reduce visual clutter. Construct a network graph object using an R graph library (igraph or tidygraph) with metabolites as nodes and Jacobian coefficients as directed, weighted edges. Apply a network layout algorithm (e.g., force-directed) to position nodes in 2D space for visual clarity. Render the final network with metabolite labels, edge colors/widths encoding interaction strength and direction, and save as a publication-quality figure (e.g., PNG or PDF).
Related tools
- MInfer (R package providing Jacobian matrix computation and example visualization functions (visualize_heatmap, visualize_3d); workflow context and data preparation steps) — https://github.com/cellbiomaths/MInfer
- igraph (R graph library for constructing network graph objects from edge lists and applying layout algorithms)
- tidygraph (Alternative R graph library for tidy-style network manipulation and layout)
- R (Host environment for matrix operations, graph construction, and rendering visualizations)
Examples
# Load Jacobian matrix computed by MInfer; construct and visualize network
library(igraph); jacobian_6C <- calculate_jacobian(cov_6C[[1]], interactions_fin, icount = 15); net <- graph_from_adjacency_matrix(jacobian_6C$J, mode='directed', weighted=TRUE); plot(net, edge.arrow.size=0.3, edge.width=abs(E(net)$weight), main='Metabolite Interaction Network')
Evaluation signals
- Network graph object has correct number of nodes (matching unique metabolite IDs in Jacobian) and edges (matching non-zero or thresholded coefficients).
- Edge weights in the graph match the Jacobian coefficients; direction of edges correctly reflects positive/negative interactions.
- Metabolite labels are readable and positioned without substantial overlap; layout algorithm has converged to a stable configuration.
- Visualization renders without errors; output file is created at specified path with expected format (PNG/PDF metadata, or igraph plot object in R session).
- Edges with very small coefficients (near zero or below threshold) are absent from visualization if filtering was applied; high-magnitude interactions are prominently displayed.
Limitations
- Dense networks (many metabolites or highly interconnected systems) may become cluttered or unreadable even with layout optimization; consider subgraph extraction or node filtering for large systems.
- Jacobian matrix interpretation assumes linear approximation of the metabolomic system around the sampled state; non-linear interactions are not captured.
- Visualization quality and interpretability depend on choice of layout algorithm and parameter tuning (edge weight scaling, node size); no single algorithm is optimal for all network topologies.
- No changelog is available for MInfer, so reproducibility and version-specific behavior are not formally tracked in the repository documentation.
Evidence
- [other] Extract edge information from the Jacobian matrix by identifying non-zero or significant coefficients that represent metabolite-to-metabolite interactions.: "Extract edge information from the Jacobian matrix by identifying non-zero or significant coefficients that represent metabolite-to-metabolite interactions."
- [other] Construct a network graph object representing metabolites as nodes and Jacobian coefficients as directed edges using an R graph library (e.g., igraph or tidygraph).: "Construct a network graph object representing metabolites as nodes and Jacobian coefficients as directed edges using an R graph library (e.g., igraph or tidygraph)."
- [other] Apply network layout algorithm to position nodes in 2D space for clarity.: "Apply network layout algorithm to position nodes in 2D space for clarity."
- [other] Render the network visualization with metabolite labels, edge weights or colors to encode interaction strength and direction, and save as a publication-quality figure.: "Render the network visualization with metabolite labels, edge weights or colors to encode interaction strength and direction, and save as a publication-quality figure."
- [intro] MInfer provides tools for data preparation, covariance matrix generation, Jacobian matrix computation, and visualization of metabolite interaction networks: "MInfer provides tools for data preparation, covariance matrix generation, Jacobian matrix computation, and visualization of metabolite interaction networks"
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.