def write_biom(self, sample_names, read_taxonomies, biom_file_io):
counts = []<EOL>observ_metadata = []<EOL>otu_ids = []<EOL>for otu_id, tax, count in self._iterate_otu_table_rows(read_taxonomies):<EOL><INDENT>if len(count) != len(sample_names):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>counts.append(count)<EOL>observ_metadata.append({'<STR_LIT>': tax})<EOL>otu_ids.append(str(otu_id))<EOL><DEDENT>if len(counts) == <NUM_LIT:0>:<EOL><INDENT>logging.info("<STR_LIT>")<EOL>return True<EOL><DEDENT>table = Table(np.array(counts),<EOL>otu_ids, sample_names, observ_metadata,<EOL>[{}]*len(sample_names), table_id='<STR_LIT>')<EOL>try:<EOL><INDENT>table.to_hdf5(biom_file_io, '<STR_LIT>')<EOL>return True<EOL><DEDENT>except RuntimeError as e:<EOL><INDENT>logging.warn("<STR_LIT>" % e)<EOL>return False<EOL><DEDENT>
Write the OTU info to a biom IO output stream

        Parameters
        ----------
        sample_names: String
            names of each sample (sample_ids for biom)
        read_taxonomies: Array of hashes as per _iterate_otu_table_rows()
        biom_file_io: io
            open writeable stream to write biom contents to

        Returns True if successful, else False