molbiodiv / biojs-io-biom

Parses biom files
MIT License
2 stars 1 forks source link

Implement more validation checks #1

Open iimog opened 8 years ago

iimog commented 8 years ago

The types of biom attributes are checked in the setter functions. TypeErrors are thrown if there is a mismatch. As the constructor uses the setters types are also checked in the constructor. But there are other possible inconsistencies that are not yet checked:

iimog commented 8 years ago

There are relationships between rows, columns, shape, data, matrix_type and matrix_element_type (and nnz). So updating one via a setter should either update the others or fail if the change is incompatible. Initialization is a special case because many values are set simultaneously so order of setting is important if there are incompatibilities.