joey711/biom — pull request #8 by nosson (2014-03-04 19:32:05+00:00)
Title: Added convert_to_biom function

Hey -

Here is the function convert_to_biom which maintains variable names.
Let me know what test cases you think should be included.

This is the simplest case I can think of:
```{r}
# load file
biom_file = system.file("extdata", "rich_sparse_otu_table.biom", package = "biom")
x = read_biom(biom_file)

# extract features of data
counts	= as.matrix(biom_data(x))
sample_meta = sample_metadata(x)
feature_meta = observation_metadata(x)

# reconvert and store
x2	= convert_to_biom(counts,sample_metadata=sample_meta,observation_metadata=feature_meta)
counts2	= as.matrix(biom_data(x2))
sample_meta2	= sample_metadata(x2)
feature_meta2	= observation_metadata(x2)

# all should be identical in comparison
identical(counts2,counts)
identical(sample_meta,sample_meta2)
identical(feature_meta,feature_meta2)
```