Fork me on GitHub

biom-format.org

biom.table.Table.from_tsv

«  biom.table.Table.from_json   ::   Contents   ::   biom.table.Table.get_table_density  »

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:

lines : list, or file-like object

The tab delimited data to parse

obs_mapping : dict or None

The corresponding observation metadata

sample_mapping : dict or None

The corresponding sample metadata

process_func : function

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 StringIO 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)

«  biom.table.Table.from_json   ::   Contents   ::   biom.table.Table.get_table_density  »