treeAGG: Tree aggregation

Description Usage Arguments Value Author(s) Examples

Description

treeAGG combines the p values with the tree structure and decide the which nodes to be aggregated to based on the min-p algorithm.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
treeAGG(data, sigf.by = "FDR", sigf.limit = 0.05, agg.by = "FDR",
  tree, message = FALSE)

## S4 method for signature 'treeSummarizedExperiment'
treeAGG(data, sigf.by, sigf.limit,
  agg.by, message)

## S4 method for signature 'ANY'
treeAGG(data, sigf.by = "FDR", sigf.limit = 0.05,
  agg.by = "FDR", tree, message = FALSE)

Arguments

data

A data frame or a treeSummarizedExperiment.

If a data frame, it should include at least:

  • a column of node labels (use labels from this column to map each row to a node of tree.)

  • a column for tree aggregation (use value from this column to decide whether to aggregate.)

  • a column of adjusted p value (use value from this column to decide whether to reject a null hypothesis.)

sigf.by

A column name. The column contains the p value or adjusted p value.

sigf.limit

A numeric value. The threshold value (for p value or adjusted p value) to reject a null hypothesis. The chosen value depends on the sigf.by.

agg.by

A column name. The column used to do tree aggregation. Commonly, it is the column including p value or adjusted p value.

tree

A phylo object. A optional argument. Only use when data is a data frame.

message

A logical value. The default is TRUE. If TRUE, it will print out the currenet status of a process.

Value

A 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
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 <- data.frame(nodeLab = rownames(y),
                    var1 = sample(letters[1:3], 10, replace = TRUE),
                    var2 = sample(c(TRUE, FALSE), 10, replace = TRUE),
                    stringsAsFactors = FALSE)
colInf <- data.frame(gg = factor(sample(1:3, 30, replace = TRUE)),
                    group = rep(LETTERS[1:3], each = 10))
toy_lse <- leafSummarizedExperiment(tree = tinyTree,
                                    assays = list(y, (2*y), 3*y),
                                    rowData = rowInf,
                                    colData = colInf)

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

new_tse <- runEdgeR(obj = toy_tse, use.assays = 1, design = NULL,
                    contrast = NULL, normalize = TRUE, method = "TMM",
                    adjust.method = "BH")

# the aggKeep column stores the information whether a node is kept after the
# aggregation
outR1 <- treeAGG(data = new_tse)

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