RGraphSpace is an R package that generates ggplot2 graphics for igraph
objects, scaling nodes and edges to a unit space. The package implements new
ggplot2 prototypes, optimized for representing large networks. This enables
extensive customization of aesthetics and visual style, including colors,
shapes, and line types. Three specialized geoms translate graph data into
geometric layers. These geoms use a dual-anchor normalization approach
to align layers, required for analysis where network elements must be
accurately referenced to a spatial map.
geom_graphspace(): A high-level convenience layer that processes both nodes and edges in a single call.geom_nodespace(): Dedicated to rendering nodes. InheritsGeomPointaesthetic mappings, modified to inform the edge layer on node states.geom_edgespace(): Handles the relational data between nodes. InheritsGeomSegmentaesthetic mappings; unlike standard segments, it is "node-aware" and dynamically calibrates start and end points to connected nodes.
By scaling graph elements, RGraphSpace also supports the overlay of networks onto image features. Its dual-anchor normalization approach aligns nodes with matrix indices, which is critical for pixel-level precision.
RGraphSpace may provide infrastructure support for packages that require graph data abstraction. For example, it currently provides classes and methods inherited by PathwaySpace, a tool for exploring signal patterns in spatial transcriptomics.
install.packages("knitr")
install.packages("rmarkdown")install.packages("remotes")
remotes::install_github("sysbiolab/RGraphSpace", build_vignettes=TRUE)Follow the RGraphSpace vignette and try to make some plots!
library(RGraphSpace)
vignette("RGraphSpace")If you use RGraphSpace, please cite:
-
Sysbiolab Team. "RGraphSpace: A lightweight interface between igraph and ggplot2 graphics". R package, 2023. Doi: 10.32614/CRAN.package.RGraphSpace
-
Castro MAA, Wang X, Fletcher MNC, Meyer KB, Markowetz F. "RedeR: R/Bioconductor package for representing modular structures nested networks and multiple levels of hierarchical associations". Genome Biology 13:R29, 2012. Doi: 10.1186/gb-2012-13-4-r29
The RGraphSpace package is distributed under Artistic-2.0