topNodes: Table of the top differential nodes

Description Usage Arguments Value Author(s) Examples

Description

topNodes extracts the top differential nodes in a data frame or a list of data frame for a given pair of group, ranked by p-value or absolute change (e.g. log-fold change)

Usage

1
2
topNodes(data, sort.by = "FDR", decreasing = FALSE,
  col.rowData = NULL, col.linkData = NULL, use.assays = NULL)

Arguments

data

A tree summarizedExperiment object output from treeAGG

sort.by

The name of the column to sort by

decreasing

A logical value. TRUE or FALSE. Should the sorting be decreasing or not.

col.rowData

The names of columns to be extracted from rowData.

col.linkData

The names of columns to be extracted from linkData.

use.assays

A numeric vector. It specifies the result of which table should be shown. The default is NULL, all available results are shown; otherwise, the result of the specified table (via the table number) is shown. To recall, the table number is the number of table in assays (e.g. 1 represents the first table). If users forgot which tables have been used to do data analysis, they could check use.assays in the metadata of input data.

Value

a list of data frame

Author(s)

Ruizhu HUANG

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
26
27
28
library(S4Vectors)
set.seed(1)
y <- matrix(rnbinom(300,size=1,mu=10),nrow=10)
colnames(y) <- paste(rep(LETTERS[1:3], each = 10), rep(1:10,3), sep = "_")
rownames(y) <- tinyTree$tip.label

rowInf <- DataFrame(nodeLab = rownames(y),
                    var1 = sample(letters[1:3], 10, replace = TRUE),
                    var2 = sample(c(TRUE, FALSE), 10, replace = TRUE))
colInf <- DataFrame(gg = factor(sample(1:3, 30, replace = TRUE)),
                    group = rep(LETTERS[1:3], each = 10))
toy_lse <- leafSummarizedExperiment(tree = tinyTree, rowData = rowInf,
                                    colData = colInf,
                                    assays = list(y, (2*y), 3*y))

toy_tse <- nodeValue(data = toy_lse, fun = sum, tree = tinyTree,
 message = TRUE)

# build the model
contrastList <- list(contrast1 = c(0, 0, 0, -1, 1),
                     contrast2 = c(0, -1, 1, 0, 0))
mod <- runEdgeR(obj = toy_tse, contrast = contrastList)
# results are stored as the column result_assay1, result_assay2, and
# result_assay3
(res <- rowData(mod, internal = TRUE))
# show results gained from the second element of the assasy
# sort by PValue
topNodes(mod, sort.by = "PValue", use.assays = 2)

markrobinsonuzh/treeAGG documentation built on May 26, 2019, 9:32 a.m.