plotPathwaySpace
is a wrapper function to
create dedicated ggplot graphics for PathwaySpace-class objects.
# S4 method for PathwaySpace
plotPathwaySpace(
ps,
colors = pspace.cols(),
trim.colors = c(3, 2, 1, 2, 3),
bg.color = "grey95",
si.color = "grey85",
si.alpha = 1,
theme = c("th0", "th1", "th2", "th3"),
title = "PathwaySpace",
xlab = "Pathway coordinates 1",
ylab = "Pathway coordinates 2",
zlab = "Density",
font.size = 1,
font.color = "white",
zlim = NULL,
slices = 25,
add.grid = TRUE,
grid.color = "white",
add.summits = TRUE,
label.summits = TRUE,
summit.color = "white",
add.marks = FALSE,
marks = NULL,
mark.size = 3,
mark.color = "white",
mark.padding = 0.5,
mark.line.width = 0.5,
use.dotmark = FALSE,
add.image = FALSE
)
A ggplot-class object.
A PathwaySpace class object.
A vector of colors. Each color is a specific hue used to create a customized color palette, interpolated according to the provided sequence in the vector of colors. The proportion of each color hue can be adjusted by the 'trim.colors' argument. This palette is designed to fine-tune the visibility of summits and valleys within the image space. To bypass this automatic palette generation and use the 'colors' input as-is, simply set 'trim.colors' to NULL.
An vector with 5 positive integer numbers. This argument can be used to adjust the proportion of each color hue in the palette.
A single color for background.
A single color for silhouette.
(see silhouetteMapping
).
A transparency level in [0, 1], used to adjust the opacity of the silhouette. This parameter is useful for improving the perception of a background image, when one is available.
Name of a custom PathwaySpace theme. These themes
(from 'th0' to 'th3') consist mainly of preconfigured ggplot settings,
which the user can subsequently refine using ggplot2
.
A string for the title.
The title for the 'x' axis of a 2D-image space.
The title for the 'y' axis of a 2D-image space.
The title for the 'z' axis of the image signal.
A single numeric value passed to ggplot themes.
A single color passed to ggplot themes.
The 'z' limits of the plot (a numeric vector with two numbers). If NULL, limits are determined from the range of the input values.
A single positive integer value used to split the image signal into equally-spaced intervals.
A logical value indicating whether to add gridlines to
the image space. However, gridlines will only appear when the image
is decorated with graph silhouettes (see silhouetteMapping
).
A color passed to geom_point
.
A logical value indicating whether to add contour
lines to 'summits' (when summits are available;
see summitMapping
).
A logical value indicating whether to label summits.
A color passed to 'summits'.
A logical value indicating whether to plot vertex labels.
A vector of vertex names to be highlighted in the image space. This argument overrides 'add.labels'.
A size argument passed to geom_text
.
A color passed to geom_text
.
A box padding argument passed to
geom_text_repel
.
A line width argument passed to
geom_text_repel
.
A logical value indicating whether "marks" should be represented as dots.
A logical value indicating whether to add a background
image, when one is available (see GraphSpace
).
Mauro Castro and TCGA Network.
circularProjection
# Load a demo igraph
data('gtoy1', package = 'RGraphSpace')
# # Check graph validity
gs <- GraphSpace(gtoy1)
# Create a PathwaySpace object
ps <- buildPathwaySpace(gs, nrc = 300)
# note: adjust 'nrc' to increase image resolution
# Set '1s' as vertex signal
vertexSignal(ps) <- 1
# Create a 2D-landscape image
ps <- circularProjection(ps, k = 2, pdist = 0.4)
# Plot a 2D-landscape image
plotPathwaySpace(ps)
Run the code above in your browser using DataLab