Package 'S4Cartographer'

Title: Visualize S4 class inheritance across R/Bioconductor packages
Description: S4 Object-Oriented Programming is fundamental to the Bioconductor ecosystem, enabling modularity and code reuse across hundreds of packages. However, the multi-layered inheritance structures within and between packages can be difficult to navigate. S4Cartographer facilitates the exploration of these relationships by visualizing S4 class hierarchies as directed graphs. By representing classes as nodes and inheritance as edges, it provides a clear overview of complex dependency networks.
Authors: Malte Thodberg [cre, aut] (ORCID: <https://orcid.org/0000-0001-6244-3841>)
Maintainer: Malte Thodberg <[email protected]>
License: GPL (>= 3)
Version: 0.99.3
Built: 2026-07-22 10:50:28 UTC
Source: https://github.com/bioc/S4Cartographer

Help Index


Helper: Get S4-classes defined in a set of packages

Description

This function uses getClasses to get S4-classes from packages and isVirtualClass and isClassUnion to describe them.

Usage

getS4Classes(packages)

Arguments

packages

character: R packages

Value

A data.frame (Superclasses is across packages and Subclasses is within a package)

Examples

# Single package
getS4Classes("S4Vectors")

# Multiple packages
getS4Classes(c("IRanges", "GenomicRanges"))

Helper: Get S4 inheritance for a set of S4 classes

Description

This function uses getClassDef to extract inheritance information between S4 classes.

Usage

getS4Inheritance(S4Classes, packages)

Arguments

S4Classes

character: S4-classes

packages

character: R-package of each S4-class

Value

data.frame

Examples

# Single package
one_package <- getS4Classes("GenomicRanges")
getS4Inheritance(S4Classes = one_package$S4Class,
                  packages = one_package$Package)

# Several packages
two_packages <- getS4Classes(c("IRanges", "GenomicRanges"))
getS4Inheritance(S4Classes = two_packages$S4Class,
                  packages = two_packages$Package)

Plot S4 classes and inheritance as a graph

Description

This function plots all S4-classes from one or more R-packages as graph, where each node is an S4 class and directed edges represents inheritance. Virtual classes are indicated via node shapes. The graph stops at S4 defined outside the set or R-packages in question.

Usage

plotS4ClassGraph(packages, plot = TRUE)

Arguments

packages

character: R-packages

plot

logical: Whether to plot (TRUE) or just return the underlying plot data (FALSE)

Value

ggplot if plot=TRUE or list if plot=FALSE

Examples

# Single package
plotS4ClassGraph("GenomicRanges")

# Several packages:
plotS4ClassGraph(c("IRanges", "GenomicRanges"))