rbiom_objects: Working with rbiom Objects.

rbiom_objectsR Documentation

Working with rbiom Objects.

Description


Rbiom objects make it easy to access and manipulate your BIOM data, ensuring all the disparate components remain in sync. These objects behave largely like lists, in that you can access and assign to them using the $ operator. The sections below list all the fields which can be read and/or written, and the helper functions for common tasks like rarefying and subsetting. To create an rbiom object, see as_rbiom().

Use ⁠$clone()⁠ to create a copy of an rbiom object. This is necessary because rbiom objects are passed by reference. The usual ⁠<-⁠ assignment operator will simply create a second reference to the same object - it will not create a second object. See speed ups for more details.

Readable Fields

Reading from fields will not change the rbiom object.

Accessor Content
⁠$counts⁠ Abundance of each OTU in each sample.
⁠$metadata⁠ Sample mappings to metadata (treatment, patient, etc).
⁠$taxonomy⁠ OTU mappings to taxonomic ranks (genus, phylum, etc).
⁠$otus⁠, ⁠$n_otus⁠ OTU names.
⁠$samples⁠, ⁠$n_samples⁠ Sample names.
⁠$fields⁠, ⁠$n_fields⁠ Metadata field names.
⁠$ranks⁠, ⁠$n_ranks⁠ Taxonomic rank names.
⁠$tree⁠, ⁠$sequences⁠ Phylogenetic tree / sequences for the OTUs, or NULL.
⁠$id⁠, ⁠$comment⁠ Arbitrary strings for describing the dataset, or NULL.
⁠$depth⁠ Rarefaction depth, or NULL if unrarefied.
⁠$date⁠ Date from BIOM file.


Writable Fields

Assigning new values to these components will trigger validation checks and inter-component synchronization.

Component What can be assigned.
⁠$counts⁠ matrix of abundances; OTUs (rows) by samples (columns)
⁠$metadata⁠ data.frame with '.sample' column, or a file name
⁠$taxonomy⁠ data.frame with '.otu' as the first column
⁠$otus⁠ character vector with new names for the OTUs
⁠$samples⁠ character vector with new names for the samples
⁠$tree⁠ phylo object with the phylogenetic tree for the OTUs
⁠$sequences⁠ character vector of OTU reference sequences
⁠$id⁠, ⁠$comment⁠ string with a title or comment for the dataset
⁠$date⁠ date-like object, or "%Y-%m-%dT%H:%M:%SZ" string


Transformations

All functions return an rbiom object.

Function Transformation
<rbiom>$clone() Safely duplicate an rbiom object.

cmmr/rbiom documentation built on April 28, 2024, 6:38 a.m.