biom.table.Table.from_adjacency¶
- static Table.from_adjacency(lines)¶
Parse an adjacency format into BIOM
- Parameters:
- lineslist, str, or file-like object
The tab delimited data to parse
- Returns:
- biom.Table
A BIOM
Table
object
- Raises:
- ValueError
If the input is not an iterable or file-like object.
- ValueError
If the data is incorrectly formatted.
Notes
The input is expected to be of the form: observation, sample, value. A header is not required, but if present, it must be of the form:
#OTU ID<tab>SampleID<tab>value
Examples
Parse tab separated adjacency data into a table:
>>> from biom.table import Table >>> from io import StringIO >>> data = 'a\tb\t1\na\tc\t2\nd\tc\t3' >>> data_fh = StringIO(data) >>> test_table = Table.from_adjacency(data_fh)