make_gs_network: Form a tidygraph object

Description Usage Arguments Details Value Examples

View source: R/make_gs_network.R

Description

Form a tidygraph from a list of gene-sets

Usage

1
make_gs_network(gene_sets, top_table, .by = c(label = "gene_name"))

Arguments

gene_sets

A list of gene-sets as described in the details section

top_table

An optional topTable as output by a function such as limma::topTable(), or edgeR::topTags()$table

.by

If providing the topTable, this will be passed to dplyr::left_join()

Details

Taking a list of gene-sets as the primary input form a network. Names of each list element are assumed to be the names of gene-sets, with the values within each element assumed to be gene identifiers. Choosing actual gene names may be the most useful option. All genes provided will be plotted, so removing uninteresting genes may be helpful before passing to this function

If provided, the topTable will be joined onto the nodes allowing all columns to be used for modifying the final plot. The most useful columns may be either logFC or the PValue.

By default, all nodes (i.e. gene-sets and gene names) will be contained in a column named 'label'. Setting the correct column from the topTable to join on can be performed using the .by argument.

It should also be noted that these networks become very cumbersome, very quickly and as such, supplying a relatively small number (e.g. 10) of nodes (i.e. gene-sets) may be the most viable approach

Value

A tbl_graph

Examples

1
2
3
4
5
6
7
8
set.seed(100)
geneSets <- list(
  a = as.character(1:3), b = as.character(3:5), c = as.character((1:3)*2)
  )
topTable <- tibble(
  gene_name = as.character(1:6), PValue = runif(6), logFC = runif(6, -3, 3)
  )
tg <- make_gs_network(gene_sets = geneSets, top_table = topTable)

steveped/spBioUtils documentation built on Sept. 25, 2021, 7:22 p.m.