read_biom: Read a biom-format file, returning a 'biom-class'.

Description Usage Arguments Details Value References See Also Examples

View source: R/IO-methods.R

Description

Import the data from a biom-format file into R, represented as an instance of the biom-class; essentially a list with special constraints that map to the biom-format definition.

Usage

1
read_biom(biom_file)

Arguments

biom_file

(Required). A character string indicating the file location of the biom formatted file. This is a HDF5 or JSON formatted file specific to biological datasets. The format is formally defined at the biom-format definition and depends on the versioning.

Details

The BIOM file format (canonically pronounced biome) is designed to be a general-use format for representing biological sample by observation contingency tables. BIOM is a recognized standard for the Earth Microbiome Project and is a Genomics Standards Consortium candidate project. Please see the biom-format home page for more details.

It is tempting to include an argument identifying the biom-format version number of the data file being imported. However, the biom-format version number is a required field in the biom-format definition. Rather than duplicate this formal specification and allow the possibility of a conflict, the version number of the biom format will be referred to only by the "format" field in the biom formatted data, or its representation in R.

Value

An instance of the biom-class.

References

http://biom-format.org/

See Also

Function to create a biom object from R data, make_biom.

Definition of the biom-class.

Function to write a biom format file from a biom object, write_biom

Accessor functions like header.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# # # import with default parameters, specify a file
biom_file <- system.file("extdata", "rich_sparse_otu_table.biom", package = "biomformat")
biom_file
read_biom(biom_file)
biom_file <- system.file("extdata", "min_sparse_otu_table.biom", package = "biomformat")
biom_file
read_biom(biom_file)
## The previous examples use system.file() because of constraints in specifying a fixed
##   path within a reproducible example in a package.
## In practice, however, you can simply provide "hard-link"
## character string path to your file:
# mybiomfile <- "path/to/my/biomfile.biom"
# read_biom(mybiomfile)

Example output

[1] "/usr/local/lib/R/site-library/biomformat/extdata/rich_sparse_otu_table.biom"
biom object. 
type: OTU table 
matrix_type: sparse 
5 rows and 6 columns 
[1] "/usr/local/lib/R/site-library/biomformat/extdata/min_sparse_otu_table.biom"
biom object. 
type: OTU table 
matrix_type: sparse 
5 rows and 6 columns 

biomformat documentation built on Nov. 8, 2020, 7:43 p.m.