% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IO-methods.R
\name{write_biom}
\alias{write_biom}
\title{Write a biom-format v1 file, returning a \code{biom-class}.}
\usage{
write_biom(x, biom_file)
}
\arguments{
\item{x}{(Required). A biom object that is going to be written to file
as a proper biom formatted file, adhering to 
\href{http://biom-format.org/documentation/biom_format.html}{the biom-format definition}.}

\item{biom_file}{(Required). A character string indicating the 
file location of the biom formatted file. This is a JSON formatted file
specific to biological datasets. 
The format is formally defined at 
\href{http://biom-format.org/documentation/biom_format.html}{the biom-format definition}}
}
\value{
Nothing. The first argument, \code{x}, is written to a file.
}
\description{
Write a biom-format v1 file, returning a \code{biom-class}.
}
\details{
\code{write_biom()} serialises the entire BIOM object to a single JSON
string via \code{\link[jsonlite]{toJSON}}.  Because R character strings are
limited to \eqn{2^{31}-1} bytes, this function will fail with a
\emph{"character strings are limited to 2^31-1 bytes"} error for very
large datasets.  If your dataset has more than a few thousand samples or
features, use \code{\link{write_hdf5_biom}} instead — the HDF5 format has
no such size constraint.
}
\examples{
biom_file <- system.file("extdata", "rich_sparse_otu_table.biom", package = "biomformat")
x = read_biom(biom_file)
outfile = tempfile()
write_biom(x, outfile)
y = read_biom(outfile)
identical(x, y) 
}
\references{
\url{http://biom-format.org/}
}
\seealso{
Function to create a biom object from R data,
\code{\link{make_biom}}.

Definition of the
\code{\link{biom-class}}. 

The \code{\link{read_biom}} import function.

Accessor functions like \code{\link{header}}.
}
