A user should be able to issue a table.write('path', format='2.1.0'), using an instance of Table. Similarly, a user should be able to issue a Table.read('path'), without specifying the format.
Naively doing this would introduce a circular dependency and the refactor to support it may be expensive. A stepping stone to simplification would be to allow a user to from biom import read; t = read('path') and similarly, from biom import write; write(t, 'path', format=version)
The current read mechanism is slim (biom.load_table). But the write mechanism is awkward:
from biom import biom_open
with biom_open('your_file', 'w') as fp:
t.to_hdf5(fp, generated_by='foo')
...this necessitates knowing prior to the biom_open call detail about the format to write.
A user should be able to issue a
table.write('path', format='2.1.0')
, using an instance ofTable
. Similarly, a user should be able to issue aTable.read('path')
, without specifying the format.Naively doing this would introduce a circular dependency and the refactor to support it may be expensive. A stepping stone to simplification would be to allow a user to
from biom import read; t = read('path')
and similarly,from biom import write; write(t, 'path', format=version)
The current read mechanism is slim (
biom.load_table
). But the write mechanism is awkward:...this necessitates knowing prior to the
biom_open
call detail about the format to write.