{"id":21004,"library":"biom-format","title":"BIOM Format","description":"The BIOM (Biological Observation Matrix) format is a standardized format for representing counts of observations (e.g., OTUs, genes) across samples. This Python library provides read/write support for BIOM files, including HDF5 and JSON backends. Current version: 2.1.17. Released as needed; maintained by the QIIME 2 and scikit-bio ecosystems.","status":"active","version":"2.1.17","language":"python","source_language":"en","source_url":"https://github.com/biocore/biom-format","tags":["biological-data","microbiome","HDF5","JSON","OTU-table","sequence-counts"],"install":[{"cmd":"pip install biom-format","lang":"bash","label":"Standard install"},{"cmd":"pip install 'biom-format[hdf5]'","lang":"bash","label":"With HDF5 support"}],"dependencies":[{"reason":"HDF5 backend for BIOM files","package":"h5py","optional":true},{"reason":"Array operations on observation/sample data","package":"numpy","optional":false},{"reason":"DataFrame conversions and table operations","package":"pandas","optional":false},{"reason":"Sparse matrix support","package":"scipy","optional":true}],"imports":[{"note":"Table is a top-level export; direct submodule import may break in future versions.","wrong":"from biom.table import Table","symbol":"Table","correct":"from biom import Table"},{"note":"","wrong":"","symbol":"load_table","correct":"from biom import load_table"}],"quickstart":{"code":"import numpy as np\nfrom biom import Table, load_table\n\n# Create a simple BIOM table\ndata = np.array([[1, 2], [3, 4]])\nsample_ids = ['S1', 'S2']\nobs_ids = ['O1', 'O2']\ntable = Table(data, obs_ids, sample_ids)\nprint(table.summary())\n\n# Save to file\ntable.save('example.biom')\n\n# Load back\nloaded = load_table('example.biom')\nprint(loaded.shape)","lang":"python","description":"Create, save, and load a BIOM table with minimal dependencies."},"warnings":[{"fix":"Install the extra: pip install 'biom-format[hdf5]'","message":"HDF5 support requires `pip install 'biom-format[hdf5]'` or `conda install -c conda-forge biom-format h5py`. Without h5py, the library falls back to JSON format only, which is slower and may not support large files.","severity":"gotcha","affected_versions":">=2.1.0"},{"fix":"Use `from biom import load_table` and call `load_table('file.biom')`.","message":"The `from biom import load_table` function deprecated old function `biom.parse.parse_biom_table` and `biom.parse.parse_biom_table(open('file.biom'))` patterns. Using the old API may raise deprecation warnings or break.","severity":"breaking","affected_versions":"<2.0 vs >=2.0"},{"fix":"Example: `filtered = table.filter_observations(lambda v, i, m: v.sum() > 10, inplace=False)`","message":"When filtering tables using `filter_observations` or `filter_samples`, in-place modification occurs by default. To avoid mutating the original table, pass `inplace=False`.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `import biom` and methods on Table objects.","message":"Using the `biom` command-line interface outside of the package (i.e., calling `biom summarize-table`) is being phased out. Prefer Python API or use `qiime2` tools.","severity":"deprecated","affected_versions":">=2.1.15"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install 'biom-format[hdf5]'","cause":"biom-format installed without h5py dependency.","error":"'h5py' is required to read HDF5 BIOM files"},{"fix":"pip install biom-format","cause":"Package not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'biom'"},{"fix":"Use positional args: Table(data, obs_ids, sample_ids) or keyword argument 'observation_ids' and 'sample_ids'.","cause":"Mixing old and new API; Table constructor signature changed in 2.0.","error":"TypeError: __new__() got an unexpected keyword argument 'observation_metadata'"},{"fix":"Ensure `len(obs_ids) * len(sample_ids)` equals total number of elements in data array.","cause":"Data array does not match dimensions implied by sample IDs and observation IDs.","error":"ValueError: cannot reshape array of size ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}