BIOMannotations: Search and change row or column annotations of BIOM data

Description Usage Arguments Details Value Author(s) See Also Examples

Description

For an object of class biom, find row or column annotations (BIOM metadata) that match by name a given pattern, or append new annotations.

Usage

1
2
3
4
5
rows(x, pattern="*")
rows(x, name) <- value

columns(x, pattern="*")
columns(x, name) <- value

Arguments

x

an object (biom)

pattern

literal string or regular expression identifying metadata by name (character)

name

name for new metadata annotation (character)

value

new metadata, one value per row/column

Details

Complete technical documentation is forthcoming. For the current preliminary release, please refer to the examples provided.

Value

For rows() and columns(), a data.frame consisting of the metadata of x matching pattern by name. For the replacement functions, the object x with updated metadata.

Author(s)

Daniel T. Braithwaite

See Also

BIOM.utils::biom, regex

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
####  exact sampling locations returned in a data.frame
columns (xx3, "latitude|longitude")

####  a data.frame is returned even in case of a single matching metadata field
is.data.frame (columns (xx1, "sample.data.biome"))

####  project IDs and environmental package metadata -- note regex here and above
colnames (columns (xx2, "project\\.id|^env_package"))

####  row metadata makes annotation hierarchy levels available,
####  so typical row metadata has few components, and here just two
names (rows (xx1))
rows (xx1, "ontology1")

####  here, the rownames and the (single) variable of the data.frame coincide
rows (xx1, "ontology2")

####  variables are almost always coded as factors
is.factor (columns (xx1, "sample.data.biome") [[1]])

MG-RAST/matR documentation built on May 8, 2019, 3:21 p.m.