treeSummarizedExperiment-accessor: Accessor functions for treeSummarizedExperiment

Description Usage Arguments Value Author(s) See Also Examples

Description

Accessor functions to extract different elements from treeSummarizedExperiment object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## S4 method for signature 'treeSummarizedExperiment'
assays(x, use.nodeLab = FALSE, ...,
  withDimnames = FALSE)

## S4 method for signature 'treeSummarizedExperiment'
rowData(x, use.names = TRUE, ...)

linkData(x)

## S4 method for signature 'treeSummarizedExperiment'
linkData(x)

treeData(x)

## S4 method for signature 'treeSummarizedExperiment'
treeData(x)

## S4 method for signature 'treeSummarizedExperiment,ANY,ANY,ANY'
x[i, j]

getByLink(x, subset)

## S4 method for signature 'treeSummarizedExperiment'
getByLink(x, subset)

Arguments

x

A treeSummarizedExperiment object

use.nodeLab

A logical(1), indicating whether the rownames of assay elements should use node labels (the column nodeLab in linkData if there is not duplicated values; otherwise the column nodeLab_alias in linkData is used.)

...

For assay, ... contains use.nodeLab, which is forwarded to assays. For rowData, arguments passed through ... are forwarded to mcols.

withDimnames

A logical(1), indicating whether dimnames should be applied to extracted assay elements. Setting withDimnames=FALSE increases the speed and memory efficiency with which assays are extracted. withDimnames=TRUE in the getter assays<- allows efficient complex assignments (e.g., updating names of assays, names(assays(x, withDimnames=FALSE)) = ... is more efficient than names(assays(x)) = ...); it does not influence actual assignment of dimnames to assays.

use.names

Like mcols(x), by default rowData(x) propagates the rownames of x to the returned DataFrame object (note that for a SummarizedExperiment object, the rownames are also the names i.e. rownames(x) is always the same as names(x)). Setting use.names=FALSE suppresses this propagation i.e. it returns a DataFrame object with no rownames. Use this when rowData(x) fails, which can happen when the rownames contain NAs (because the rownames of a SummarizedExperiment object can contain NAs, but the rownames of a DataFrame object cannot).

i, j

The subscripts that can act to subset the rows and columns of x, that is the matrix elements of assays.

Value

Elements from treeSummarizedExperiment.

Author(s)

Ruizhu HUANG

See Also

treeSummarizedExperiment treeSummarizedExperiment-accessor leafSummarizedExperiment SummarizedExperiment-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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_tse <- treeSummarizedExperiment(tree = tinyTree, rowData = rowInf,
                                    colData = colInf,
                                    assays = list(y, (2*y), 3*y))
rowData(toy_tse)
colData(toy_tse)
metadata(toy_tse)
linkData(toy_tse)
assays(toy_tse)

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