treeData: Adding information to tree data in 'TreeSummarizedExperiment'

treeDataR Documentation

Adding information to tree data in TreeSummarizedExperiment

Description

To facilitate the dressing of the tree data stored in a TreeSummarizedExperiment object, rowTreeData and colTreeData can be used.

Usage

rowTreeData(x, ...)

colTreeData(x, ...)

rowTreeData(x, tree_name = "phylo") <- value

colTreeData(x, tree_name = "phylo") <- value

combineTreeData(x, other_fields = list())

combineTreeData(x, other_fields = list())

## S4 method for signature 'TreeSummarizedExperiment'
colTreeData(x, tree_name = "phylo")

## S4 method for signature 'TreeSummarizedExperiment'
rowTreeData(x, tree_name = "phylo")

## S4 replacement method for signature 'TreeSummarizedExperiment'
colTreeData(x, tree_name = "phylo") <- value

## S4 replacement method for signature 'TreeSummarizedExperiment'
rowTreeData(x, tree_name = "phylo") <- value

## S4 method for signature 'phylo'
combineTreeData(x, other_fields = list())

## S4 method for signature 'treedata'
combineTreeData(x, other_fields = list())

Arguments

x

a TreeSummarizedExperiment object.

...

additional arguments, currently not used.

tree_name

a single character value specifying a rowTree/colTree from x. (By default: tree_name = "phylo")

other_fields, value

a data.frame or coercible to one, with at least one type of id information. See details.

Details

To match information to nodes, the id information in other_fields are used. These can either be a column, named ‘node’ or ‘label’ (‘node’ taking precedent), or rownames. If all rownames can be coerced to integer, they are considered as ‘node’ values, otherwise as ‘label’ values. The id information must be unique and match available values of rowTreeData(c)

The result of the accessors, rowTreeData and colTreeData, contain at least a ‘node’ and ‘label’ column.

Value

a data.frame for the accessor and the modified TreeSummarizedExperiment object

Examples

data(GlobalPatterns)
td <- rowTreeData(GlobalPatterns)
td
td$test <- rnorm(nrow(td))
rowTreeData(GlobalPatterns) <- td
rowTreeData(GlobalPatterns)
combineTreeData(rowTree(GlobalPatterns), td)

microbiome/miaViz documentation built on April 21, 2024, 8:45 a.m.