Plot gene-set network

plot_gs_network(
  normalisedScores,
  gsTopology,
  colorBy = c("robustZ", "pvalue"),
  foldGSname = TRUE,
  foldafter = 2,
  layout = "fr",
  edgeAlpha = 0.8,
  up_col = "brown3",
  down_col = "steelblue3",
  scale_edgeWidth = 10,
  scale_nodeSize = 15,
  nodeShape = 16,
  color_lg = TRUE,
  color_lg_title = NULL,
  lb_size = 3,
  lb_color = "black",
  plotIsolated = FALSE
)

Arguments

normalisedScores

A dataframe as described in the details section

gsTopology

List of pathway topology matrices generated using function retrieve_topology

colorBy

Choose to color nodes either by "robustZ" or "pvalue". A column must exist in the normalisedScores for the chosen parameter

foldGSname

logical(1). Should long gene-set names be folded into two lines

foldafter

The number of words after which gene-set names should be folded. Defaulted to 2

layout

The layout algorithm to apply

edgeAlpha

Transparency of edges

up_col

The color to label activated gene-sets. Only applicable if colorBy is set to be "robustZ"

down_col

The color to label inhibited gene-sets. Only applicable if colorBy is set to be "robustZ"

scale_edgeWidth

Parameter for scaling edge width. Defaulted to 10. Higher numbers reduce all edge width

scale_nodeSize

Parameter for scaling node size. Defaulted to 15. Higher numbers decreases all node sizes

nodeShape

The shape to use for nodes

color_lg

logical(1). Should color legend be shown

color_lg_title

Title for the color legend

lb_size

Size of node text labels

lb_color

Color of node text labels

plotIsolated

logical(1). If nodes not connected to any other node should be plotted. Default to FALSE

Value

A ggplot2 object

Examples

load(system.file("extdata", "gsTopology.rda", package = "sSNAPPY"))
load(system.file("extdata", "normalisedScores.rda", package = "sSNAPPY"))
#Subset pathways significantly perturbed in sample R5020_N2_48
subset <- dplyr::filter(normalisedScores, adjPvalue < 0.05, sample == "R5020_N2_48")
# Color network plot nodes by robust z-score
plot_gs_network(subset, gsTopology,
colorBy = "robustZ", layout = "dh",
color_lg_title = "Robust Z-score")


# Color network plot nodes by p-values
plot_gs_network(subset, gsTopology, layout = "dh",
colorBy = "pvalue", color_lg_title = "P-value")