Learn R Programming

matR (version 0.9)

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

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

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

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.

Details

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

See Also

BIOM.utils::biom, regex

Examples

Run this code
####  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]])

Run the code above in your browser using DataLab