add_path_genes: Add Gene Names and logFC Values to goana Result

Description Usage Arguments Value Examples

View source: R/inputs.R

Description

Used to add gene name and logfc values to goana result prior to scrape_revigo. Allows r2d3_forcegraph and other graphs to display gene names and logfc values for GO terms.

Usage

1
add_path_genes(go_res, top_table, gslist = NULL, species = "Hs", FDR = 0.05)

Arguments

go_res

result of call to limma::goana

top_table

result of limma::topTable with n = Inf with character column ENTREZID added. topTable should be called with argument n = Inf to ensure that all genes with adj.P.Val < FDR are added

gslist

result of get_gslist.go. If NULL (default) then function retrieved internally.

species

Used by get_gslist.go if gslist is NULL.

FDR

false discovery rate cutoff for differentially expressed genes. Numeric value between 0 and 1.

Value

go_res with columns SYMBOL and logFC containing lists of vectors with gene symbols and logFC values for genes with adj.P.Val < FDR.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run:
## Example of setup assuming you have: y, design, and enids

library(limma)

fit <- lmFit(y, design)
fit <- eBayes(fit)

# add ENTREZID column to fit result (see geneid argument of ?limma::goana)
fit$genes <- data.frame(ENTREZID = enids)

# Standard GO analysis
go_res <- goana(fit, species="Hs")

# Differential expression analysis
top_table <- topTable(fit, n = Inf)

# example for upregulated ontologies
go_up <- go_res[go_res$P.Up < 10e-5 & go_res$P.Up < go_res$P.Down, ]
go_up <- add_path_genes(go_up, top_table)

# column ordering expected by scrape_revigo
go_up <- go_up[, c('P.Up', 'SYMBOL', 'logFC')]
data_dir <- tempdir()
scrape_revigo(data_dir, go_up)

alexvpickering/revigoR documentation built on March 17, 2021, 8:09 p.m.