Changes go here
Bug fix, released on 3 January 2023.
Bug:
Table.collapse(..., one_to_many=True)had a lingering dense conversion being performed. Avoiding this conversion yields nearly a 100x performance gain PR #888.
Substantial performance improvement and bug fix, released on 9 December 2022.
Important:
- Python 3.6 testing support has been removed.
New features:
Table.collapse(..., one_to_many=True)now uses a sparse matrix on construction, substantially reducing memory overhead PR #884.
Bug fixes:
Table.metadata_to_dataframe()now considers all rows for column names, see PR #881
General maintenance and feature expansion, released on 25 March 2022.
Bug fixes:
Table.from_jsonnow respects the creation date issue #770 in Python 3.7 and higher
New Features
- Python 3.10 support, see PR #865
- 10x improvement on
Table.collapsewhen operating over many partitions, see PR #866 - Minor performance improvement, see PR #871
- Coerce consistent, and fixed width, types for IDs, see PR #872
- Table / metadata alignment support, see PR #859
Bug fix, released on 16 November 2020.
Bug fixes:
- During deployment testing for QIIME 2 2020.11, it was observed that certain combinations of hdf5 or h5py dependencies can result in metadata strings parsing as ASCII rather than UTF-8. Parse of BIOM-Format 2.1.0 files now normalize metadata strings as UTF-8, see PR #853.
New Features
- Added support for aligning dataframes and trees against biom tables with
Table.align_to_dataframeandTable.align_tree. see PR #859
New features and support for Pandas >= 1.0, released on 5 November 2020.
Important:
- Cython and numpy are no more required to be present before building, see PR #840
New Features:
-
Added support for the AnnData format, see PR #845
-
Performance boost to
Table.remove_empty. For large tables this cuts the running time from 20 seconds to ~1.1 seconds, see PR #847 -
A much faster way to merge tables (without metadata) has been added. For large tables, this was a few minutes rather than a few hours. This method is implicitly invoked when calling
Table.mergeif unioning both axes, and the tables lack metadata.Table.concatis still much faster, but assumes one axis is disjoint. See PR #848. -
Simplify interaction with the concatenation method, allowing for passing in an individual table and support for a general
biom.concat(tables)wrapper. See PR #851. -
Added support for parsing adjacency table structures, see issue #823.
Bug fixes:
- Support for pandas >= 1.0, see the comment and commits here
New features and bug fixes, released on 28 January 2020.
Important:
- Python 2.7 and 3.5 support has been dropped.
- Python 3.8 support has been added into Travis CI.
- A change to the defaults for
Table.nonzero_countswas performed such that the default now is to count the number of nonzero features. See issue #685 - We now require a SciPy >= 1.3.1. See issue #816
New Features:
- The detailed report is no longer part of the table validator. See issue #378.
load_tablenow accepts open file handles. See issue #481.biom export-metadatahas been added to export metadata as TSV. See issue #820.Table.to_tsvhas been modified to allow fordirect_io. See issue #836.
Bug fixes:
Table.to_dataframe(dense=False)does now correctly produce sparse data frames (and not accidentally dense ones as before). See issue #808.- Order of error evaluations was unstable in Python versions without implicit
OrderedDict. See issue #813. Thanks @gwarmstrong for identifying this bug. Table._extract_data_from_tsvwould fail if taxonomy was provided, and if the first row had the empty string for taxonomy. See issue #827. Thanks @KasperSkytte for identifying this bug.
New features and bug fixes, released on 28 September 2018.
Important:
- Python 3.4 support has been dropped. We now only support Python 2.7, 3.5, 3.6 and 3.7.
- We will be dropping Python 2.7 support on the next release.
- Pandas >= 0.20.0 is now the minimum required version.
- pytest is now used instead of nose.
New Features:
- Massive performance boost to
Table.collapsewith the default collapse function. The difference was 10s of milliseconds vs. minutes stemming from prior use ofoperator.add. See issue #761. Table.align_tofor aligning one table to another. This is useful in multi-omic analyses where multiple preparations have been performed on the sample physical samples. This is essentially a helper method aroundTable.sort_order. See issue #747.- Added additional sanity checks when calling
Table.to_hdf5, see PR #769. Table.subsample()can optionally perform subsampling with replacement. See issue #774.Table.to_dataframe()now supports adenseargument to returnpd.DataFrame. See issue #762.- Parsing methods for BIOM-Format 1.0.0 tables now preserve dict ordering. See issue #781.
Bug fixes:
Table.subsample(by_id=True, axis='observation')did not subsample over the 'observations'. Because of the nature of the bug, an empty table was returned, so the scope of the issue is such that it should not have produced misleading results but instead triggered empty table errors, with the exception of the pathological case of the ID namespaces between features and samples not being disjoint. See PR #759 for more information.- Tables of shape
(0, n)or(n, 0)were raising exceptions when being written out. See issue #619. - Tables loaded with a
listof emptydicts will have their metadata attributes set to None. See issue #594.
New features and bug fixes, released on 27 April 2017.
New Features:
Table.from_hdf5now supports a rapid subset in the event that metadata is not needed. In benchmarking against the Earth Microbiome Project BIOM table, the reduction in runtime was multiple orders of magnitude while additionally preserving substantial memory.Table.rankdatahas been added to convert values to ranked abundances on either axis. See issue #645.- Format of numbers in
biom summarize-tableoutput is now more readable and localized. See issue #679. Table.concathas been added to the API and allows for concatenating multiple tables in which the IDs of one of the axes are known to be disjoint. This has substantial performance benefits overTable.merge.Table.sort_orderwas performing an implicit cast to dense, and not leveraging fancy indexing. A substantial performance gain was acheived. See PR #720.biom subset-tablenow accepts a QIIME-like mapping file when subsetting by IDs Issue #587Table.del_metadatawas added to support the removal of metadata entries from the table Issue #708.Table.to_dataframewas added to cast the internal matrix data to a PandasSparseDataFrameIssue #622.Table.metadata_to_dataframewas added to cast axis metadata to a PandasDataFrameIssue #622.test_table.pyandtest_util.pynow use a stable random seed. See issue #728- Failure to cast a value when parsing a TSV will now print the associated line number which had the bad value. See #284.
Table.remove_emptyhas been added to remove zero'd samples, observations or both. See #721.- A subcommand of the command line interface was added to obtain a table's IDs:
table-ids.
Bug fixes:
-ois now a required parameter ofbiom from-uc. This was not the case previously, which resulted in a cryptic error message if-owas not provided. See issue #683.- Matrices are now cast to csr on
Tableconstruction if the data evaluate asisspmatrix. This fixes #717 where some API methods assumed the data were csc or csr. Table.concatwas not handling tables without metadata, resulting in an exception due to mismatches metadata shape. See #724.- When validating a BIOM-Format 1.0.0 table, specifying the version string would trigger an error. See #664. An explicit regression test was not added as this stemmed from an integration, and there currently is not support for script usage tests; see #656.
Table.nnzwas not callingeliminate_zeros()on the underlying sparse matrix, resulting in the possibility of counting explicitly set zero values. See #727.Table.from_hdf5was not properly turningbytesintostrfor thetable_idand thetypeHDF5 attributes. See #731.Table.__init__now always performs anastype(float)on the containedspmatrix. This type normalization is beneficial for underlying Cython code on the filtering and transform operations. It is possible this will introduce some performance overhead, however in most cases the data should already be float. See #718.Table.to_hdf5was not handling lists of str appropriately in the general case. Ssee #638.Table.to_hdf5was not handling taxonomy as flat strings, which was a common mistake that was outside of expectations for the formatter. The formatter now attempts to split on semicolon if this scenario is encountered, and errors with a more informative error if a problem occurs. See #530.
New features and bug fixes, released on 21 October 2015.
Changes:
- Codebase is now Python 2/3 compatible. It is currently tested with Python versions 2.7, 3.4 and 3.5.
biom-serveand the accompanying html interface has been removed.
New Features:
Table.headhas been added to retrieve the first few rows and or columns from a table. This can be accessed through the newbiom headcommand. See issue #639.biom.parse.from_uchas been added to support creation ofbiom.Tableobjects from vsearch/uclust/usearch.ucfiles. This can be accessed through the newbiom from-uccommand. See issue #648.- Codebase now uses click instead of pyqi for its command line interface. See issue #631.
Bug fixes:
Table.update_idsstrict check was too aggressive. See issue #633.biom --versionnow prints the software version (previously the individual commands did this, but not the base command).Table.vlen_list_of_str_formatterwas considering astrto be valid for formatting resulting in an obscure error when astr, as opposed to alistofstr, was used for taxonomy. See issue #709.
Bug fixes, released on April 22nd 2015
Changes:
- Codebase updated to reflect pep8 1.6.x
New features:
Table.to_hdf5andTable.from_hdf5now support custom parsers and formatters, see issue #608
Bug fixes:
Table.update_idswas not updating the internal ID lookup caches, issue #599--is-jsonhas been removed from the table validator as it was being ignored anyway, issue #591biom summarize-tablecan now properly interact with pipes. This previously worked on OSX but did not on Linux. Issue #598biom convertwas recording the wrong version information from HDF5 -> JSON, issue #595Table.collapse, underone_to_manywas not constructing the resulting matrix properly, issue #606- Improve error message when trying to load an empty file, issue #614.
- Improve error handling when filtering tables, and return tables of shape
(0, n)instead of(0, 0)when fully filtering out a table along an axis, issue #620 - Fix
Table.nonzeroto work on data that is not already in csr, issue #625.
Minor fixes, released on January 29, 2014
Bug fixes:
- Improve error message when trying to load an HDF5 file without h5py being installed.
- Allow validating json files when h5py is not installed.
Minor fixes, released on December 18, 2014
Bug fixes:
- Remove syntax error from
normalize_table.py. Table.to_jsonwas not serializing empty tables properly, see #571biom summarize-tablecould not handle empty tables, see #571
Minor fixes and performance improvements, released on November 19th 2014
Changes:
- The collapsing function to
Table.collapseis now passed the entire table to allow for more complex collapses (e.g., median, random selection, etc). See #544, #545 and #547. - Updated version strings in the project to be Semantic Versioning-stlye. This better matches with other open source python projects, and plays nicer with pip.
- Conversion from TSV now takes less memory. See #551.
- Parameter header_mark has been removed from _extract_data_from_tsv() in table.py
- Order of magnitude improvement in parsing HDF5 BIOM tables, see #529
- Added
Table.length, see #548 - Order of magnitude performance increase in
Table.nonzero, see #538
Bug fixes:
- Ensure that a copy is performed in
Table.subsample - Avoided a memory leak when checking if a table is JSON or TSV, see #552.
Format finalization, released on August 7th 2014
New features:
- Group metadata (e.g., a phylogenetic tree) can now be stored within the HDF5
representation. These data are available within the
Tableobject - Matrix data can now be accessed by the
Table.matrix_dataproperty TableIDs are now accessed via theTable.idsmethodTablemetadata are now accessed via theTable.metadatamethod- New method
Table.update_ids, which allows for updating the ids along either axis. - added
normalize-tableoption to optparse and HTML interfaces which utilizes the new TableNormalizer command fromtable_normalizer.py
Changes:
- Metadata are now stored in individual datasets within HDF5. This resulted in a change to the BIOM-Format spec which has now been bumped to format version 2.1.
Table.collapsemin_group_sizeis now 1 by default, see #480- General improvements to BIOM 2.x online documentation
Table.panow supports negative values- dropped old, unused scripts
- added
Table.iter_pairwise - added
Table.minandTable.max, see #459 - iter methods now support dense/sparse
- added
Table.matrix_dataproperty Table.filteryields a sparse vector, see #470Table.subsamplecan now sample by IDs (e.g., get a random subset of samples or observations from aTable).biom.util.generate_subsampleswill generate an infinite number of subsamples and can be used for rarefaction.biom summarize-tablecan now operate on observations.- 10% performance boost in
Table.subsample, see #532
Bug fixes:
Table.transformoperates on full vectors now, see #476biom convertnow handles taxonomy strings correctly, see #504Table.sort_orderwas not retainingTable.type, see #474convert_biom_to_tablenow usesload_table, see #478Table.panow handles negative values, see #492Table.copywas not retainingTable.type, see #494
Bug fix release, released on June 3rd 2014
Changes:
- Light weight loading mechanism (
biom.load_table) added Table.datanow has a default axis- Convert documentation updated
- Quick start page added to documentation
Bug fixes:
- missing fields from JSON representation reintroduced
TableConverterworks as expected
Major release, released on May 15th 2014
Changes:
- NumPy 1.7 or above is required
- Support for HDF5
- Codebase is PEP-8 compliant
- CSMat has been removed and Scipy is now a required dependency
- Requires pyqi 0.3.2
- New HTML interface
- No longer dependent on dateutil
Table.bin_samples_by_metadataandTable.bin_observations_by_metadatahave been combined intoTable.partition, which takes an axis argumentTable.collapse_samples_by_metadataandTable.collapse_observations_by_metadatahave been combined intoTable.collapse, which now takes an axis argumentTable.filter_samplesandTable.filter_observationshave been combined intoTable.filter, which now takes an axis argumentTable.transform_samplesandTable.transform_observationshave been combined intoTable.transform, which now takes an axis argumentTable.norm_sample_by_observationandTable.norm_observation_by_samplehave been combined intoTable.norm, which now takes an axis argumentTable.iter_samplesandTable.iter_observationshave been combined intoTable.iter, which now takes an axis argumentTable.iter_sample_dataandTable.iter_observation_datahave been combined intoTable.iter_data, which now takes an axis argumentTable.get_sample_indexandTable.get_observation_indexhave been combined intoTable.get_index, which now takes an axis argumentTable.add_sample_metadataandTable.add_observation_metadatahave been combined intoTable.add_metadata, which now takes an axis argumentTable.sample_dataandTable.observation_datahave been combined intoTable.data, which now takes an axis argumentTable.sample_existsandTable.observation_existshave been combined intoTable.exists, which now takes an axis argumentTable.sort_by_sample_idsandTable.sort_by_observation_idshave been combined intoTable.sort, which now takes an axis argumentTable.sort_sample_orderandTable.sort_observation_orderhave been combined intoTable.sort_order, which now takes an axis argumentTable.norm_samples_by_metadataandTable.norm_observations_by_metadatahave been removed- Added
Table.metadatato allow fetching of metadata by an ID instead of just by index - Added
Table.pafor conversion to presence/absence - Added
Table.subsamplefor randomly subsampling data Tablenow embraces numpydoc
Documentation release, released on December 4th 2013
New Features:
- biom-format is now installable via pip! Simply run
pip install biom-format.
Changes:
- Fixed installation instructions to be clearer about the various ways of installing biom-format. Also fixed a couple of minor formatting issues.
Feature release, released on December 4th 2013
New Features:
- Added new sparse matrix backend
ScipySparseMat, which requires that scipy is installed if this backend is in use. This backend will generally yield improvements in both runtime and memory consumption, especially with larger sparse tables. The default sparse matrix backend is stillCSMat(this means that scipy is an optional dependency of the biom-format project).
Changes:
- Sparse backends
SparseDictandSparseMathave been removed in favor ofCSMat. Cython is no longer a dependency. - The BIOM Format project license is now Modified BSD (see COPYING.txt for more details) and is no longer GPL. To change the license, we obtained written permission (by email) from all past and present developers on the biom-format project. The core developers, including @gregcaporaso, @wasade, @jrrideout, and @rob-knight were included on these emails. For code that was derived from the QIIME and PyCogent projects, which are under the GPL license, written permission was obtained (by email) from the developers of the original code (tracing through the commit history, as necessary). @gregcaporaso, @wasade, @jrrideout, and @rob-knight were included on these emails.
- Removed the top-level
python-codedirectory, moving all contents up one level. If you are installing the biom-format project by manually settingPYTHONPATHto<dir prefix>/biom-format/python-code, you will need to change the path to<dir prefix>/biom-formatinstead. Please see the installation instructions for more details. - Reorganized sparse backend code into a new subpackage,
biom.backends. This change should not affect client code.
New Features:
Table.collapseObservationsByMetadataandTable.collapseSamplesByMetadatanow have an additional argument,include_collapsed_metadata, which allows the user to either include or exclude collapsed metadata in the collapsed table.Table.collapseObservationsByMetadataandTable.collapseSamplesByMetadatanow have an additional argument,one_to_many_mode, which allows the user to specify a collapsing strategy for one-to-many metadata relationships (currently supports adding and dividing counts).Table.binObservationsByMetadata,Table.binSamplesByMetadata,Table.collapseObservationsByMetadata, andTable.collapseSamplesByMetadatanow have an additional argument,constructor, which allows the user to choose the return type of the binned/collapsed table(s).Table.delimitedSelfnow has an additional argument,observation_column_name, which allows the user to specify the name of the first column in the output table (e.g. 'OTU ID', 'Taxon', etc.).- Added new
Table.transposemethod. Table.__inithas change from__init__(self, data, sample_ids, observation_ids, sample_metadata=None, observation_metadata=None, table_id=None, type=None, **kwargs)to__init__(self, data, observation_ids, sample_ids, observation_metadata=None, sample_metadata=None, table_id=None, type=None, **kwargs)This is for clarity, the data is in the same order as the arguments to the constructor. *table_factoryhas changed fromtable_factory(data, sample_ids, observation_ids, sample_metadata=None, observation_metadata=None, table_id=None, input_is_dense=False, transpose=False, **kwargs)totable_factory(data, observation_ids, sample_ids, observation_metadata=None, sample_metadata=None, table_id=None, input_is_dense=False, transpose=False, **kwargs)This is for clarity, the data is in the same order as the arguments to the function.
Changes:
- pyqi 0.2.0 is now a required dependency. This changes the look-and-feel of the biom-format command-line interfaces and introduces a new executable,
biom, which can be used to see a list of all available biom-format command-line commands. Thebiomcommand is now used to run biom-format commands, instead of having a Python script (i.e., .py file) for each biom-format command. The old scripts (e.g., add_metadata.py, convert_biom.py, etc.) are still included but are deprecated. Users are pointed to the newbiomcommand to run instead. Bash tab completion is now supported for all command and option names (see the biom-format documentation for instructions on how to enable this). - The following scripts have had their names and options changed:
add_metadata.pyis nowbiom add-metadata. Changed option names:--input_fpis now--input-fp--output_fpis now--output-fp--sample_mapping_fpis now--sample-metadata-fp--observation_mapping_fpis now--observation-metadata-fp--sc_separatedis now--sc-separated--int_fieldsis now--int-fields--float_fieldsis now--float-fields--sample_headeris now--sample-header--observation_headeris now--observation-header- New option
--sc-pipe-separated
biom_validator.pyis nowbiom validate-table. Changed option names:-v/--verboseis now--detailed-report--biom_fpis now--input-fp
convert_biom.pyis nowbiom convert. Changed option names:--input_fpis now--input-fp--output_fpis now--output-fp--biom_typeis now--matrix-type--biom_to_classic_tableis now--biom-to-classic-table--sparse_biom_to_dense_biomis now--sparse-biom-to-dense-biom--dense_biom_to_sparse_biomis now--dense-biom-to-sparse-biom--sample_mapping_fpis now--sample-metadata-fp--observation_mapping_fpis now--observation-metadata-fp--header_keyis now--header-key--output_metadata_idis now--output-metadata-id--process_obs_metadatais now--process-obs-metadata--biom_table_typeis now--table-type
print_biom_python_config.pyis nowbiom show-install-info.print_biom_table_summary.pyis nowbiom summarize-table. Changed option names:--input_fpis now--input-fp--output_fpis now--output-fp. This is now a required option (output is no longer printed to stdout).--num_observationsis now--qualitative--suppress_md5is now--suppress-md5
subset_biom.pyis nowbiom subset-table. Changed option names:--biom_fpis now--input-fp--output_fpis now--output-fp--ids_fpis now--ids
biom.parse.parse_mappinghas been replaced bybiom.parse.MetadataMap.biom.parse.MetadataMap.from_filecan be directly substituted in place ofbiom.parse.parse_mapping.
Bug Fixes:
- Fixed performance issue with formatting BIOM tables for writing to a file.
- Fixed issue with
Table.addSampleMetadataandTable.addObservationMetadatawhen adding metadata to a subset of the samples/observations in a table that previously was without any sample/observation metadata. - Fixed issue with
Table.addSampleMetadataandTable.addObservationMetadatawhen updating a table's existing metadata, including the case where there are sample/observation IDs that are in the metadata file but not in the table.
New Features:
-
Table.collapseObservationsByMetadataandTable.collapseSamplesByMetadatanow support one-to-many relationships on the metadata field to collapse on. -
added new script called
print_biom_table_summary.py(and accompanying tutorial) that prints summary statistics of the input BIOM table as a whole and on a per-sample basis
Changes:
SparseMatnow uses cython for loops more efficiently
Bug Fixes:
- fixed serious performance issue with
Table.transformSamples/Observationswhen usingCSMatas the sparse backend
Changes:
- added documentation for how to switch sparse backends via BIOM config file
Bug Fixes:
- performance issue on table creation with
CSMatwhere anO(N)lookup was being performed
New Features:
- new default sparse matrix backend
CSMat(COO/CSR/CSC) more efficient thanSparseDictandSparseMat(pure python + numpy) - support for biom config file, which allows specification of sparse backend to use. Currently supports
CSMat(default),SparseMat, andSparseDict. Default can be found undersupport_files/biom_config, and can be copied to$HOME/.biom_configor located by setting$BIOM_CONFIG_FP - new script called
add_metadata.pywith accompanying tutorial that allows users to add arbitrary sample and/or observation metadata to biom files - new script called
subset_biom.pythat efficiently pulls out a subset of a biom table (either by samples or observations). Useful for very large tables where memory may be an issue
Changes:
- parser is more efficient for sparse tables and formatter is more efficient for both table types (less memory consumption)
biom.Tableobjects are now immutable (except that metadata can still be added viaaddSampleMetadata/addObservationMetadata).__setitem__andsetValueByIdshave been removed andSampleIds,ObservationIds,SampleMetadata, andObservationMetadatamembers are now tuples as a resultbiom.Tableobject has a new method calledgetTableDensity()- performance testing framework has been added for
Tableobjects
Bug Fixes:
convert_biom.pynow converts dense tables to sparse tables (previously it didn't do anything)- many misc. fixes to script help/documentation and docstrings (fixing typos, editing for clarity, etc.)
New Features:
- new default sparse matrix backend
SparseMat(requires Cython) more efficient over existingSparseDictbackend
- format now accepts unicode but does not accept str due to JSON parsing from Python
- specification for metadata is now either
nullor an object - PySparse has been gutted, sparse matrix support is now through
Table.SparseDict
New Features:
- more table types!
Changes:
Table.getBioFormatJsonString()and similar methods now require ageneratedbystring