% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IO-methods.R
\name{write_hdf5_biom}
\alias{write_hdf5_biom}
\title{Write a biom object to an HDF5 (BIOM v2) file.}
\usage{
write_hdf5_biom(x, biom_file)
}
\arguments{
\item{x}{(Required). A \code{\link{biom-class}} object.}

\item{biom_file}{(Required). Character string path to the output file.
Any existing file at that path is overwritten.}
}
\value{
\code{biom_file} (invisibly).
}
\description{
Serialises a \code{\link{biom-class}} object to the
\href{http://biom-format.org/documentation/biom_format.html}{BIOM v2 HDF5 format}.
Both the sample-major and observation-major compressed-sparse representations
required by the spec are written, along with sample and observation metadata.
}
\details{
The \code{rhdf5} package is required. If it is not installed a clear error
is thrown.  In normal use you should prefer \code{\link{write_biom}} for
JSON (BIOM v1) output; use this function only when HDF5 output is explicitly
needed.
}
\examples{
biom_file <- system.file("extdata", "rich_sparse_otu_table.biom",
                          package = "biomformat")
x <- read_biom(biom_file)
outfile <- tempfile(fileext = ".biom")
write_hdf5_biom(x, outfile)
y <- read_biom(outfile)
identical(biom_data(x), biom_data(y))
}
\references{
\url{http://biom-format.org/}
}
\seealso{
\code{\link{read_hdf5_biom}}, \code{\link{write_biom}},
\code{\link{biom-class}}, \code{\link{make_biom}}.
}
