Plot significantly perturbed gene-sets as a 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 = c(0.5, 3),
  edgeLegend = FALSE,
  scale_nodeSize = c(3, 6),
  nodeShape = 16,
  color_lg = TRUE,
  color_lg_title = NULL,
  lb_size = 3,
  lb_color = "black",
  plotIsolated = FALSE
)

Arguments

normalisedScores

A dataframe derived from the normalise_by_permu() function

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. 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. Accept all layout supported by igraph

edgeAlpha

Transparency of edges. Default to 0.8

up_col

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

down_col

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

scale_edgeWidth

A numerical vector of length 2 to be provided to ggraph::scale_edge_width_continuous() for specifying the minimum and maximum edge widths after transformation. Defaulted to c(0.5, 3)

edgeLegend

logical` Should edge weight legend be shown

scale_nodeSize

A numerical vector of length 2 to be provided to ggplot2::scale_size() for specifying the minimum and maximum node sizes after transformation. Defaulted to c(3,6)

nodeShape

The shape to use for nodes

color_lg

logical Should color legend be shown

color_lg_title

Optional. Title for the color legend

lb_size

Size of node text labels

lb_color

Color of node text labels

plotIsolated

logical.Should nodes not connected to any other nodes 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 = "Direction of pathway Perturbation")


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