def __iter__(self): '''Iterate over all the OTUs from all the tables. This can only be done once since the data is streamed in. ''' for io in self._archive_table_io_objects: for otu in ArchiveOtuTable.read(io): yield otu for io in self._otu_table_io_objects: for otu in OtuTable.read(io): yield otu for file_path in self._archive_table_file_paths: for otu in ArchiveOtuTable.read(open(file_path)): yield otu for file_path in self._otu_table_file_paths: for otu in OtuTable.read(open(file_path)): yield otu
def add_otu_table(self, input_otu_table_io): '''Add a regular style OTU table to the collection. Parameters ---------- input_otu_table_ios: list of IO entries are open streams of OTU table data Returns ------- None ''' self.otu_table_objects.append(OtuTable.read(input_otu_table_io))