biom.table.Table.from_tsv

static Table.from_tsv(lines, obs_mapping, sample_mapping, process_func, **kwargs)

Parse a tab separated (observation x sample) formatted BIOM table

Parameters:
lineslist, or file-like object

The tab delimited data to parse

obs_mappingdict or None

The corresponding observation metadata

sample_mappingdict or None

The corresponding sample metadata

process_funcfunction

A function to transform the observation metadata

Returns:
biom.Table

A BIOM Table object

Examples

Parse tab separated data into a table:

>>> from biom.table import Table
>>> from io import StringIO
>>> tsv = 'a\tb\tc\n1\t2\t3\n4\t5\t6'
>>> tsv_fh = StringIO(tsv)
>>> func = lambda x : x
>>> test_table = Table.from_tsv(tsv_fh, None, None, func)