def cluster(self): self.run.info('CONCOCT VGBMM', 'Requesting %d clusters' % (self.NClusters)) self.progress.new('VBGMM') self.progress.update('Clustering ...') vbgmm.fit(self.transformed_data, self.assign, self.NClusters, self.debug) self.progress.end() self.run.info('CONCOCT VGBMM', 'Returning %d final clusters' % (len(set(self.assign)))) # construct and return a results dictionary: bin_name_conversion_dict = {} bin_counter = 1 for bin_id, num_contigs in collections.Counter( self.assign).most_common(): bin_name_conversion_dict[bin_id] = 'Bin_%d' % bin_counter bin_counter += 1 return dict( list( zip(self.contig_names, [bin_name_conversion_dict[g] for g in self.assign])))
def cluster(self): self.progress.new('VBGMM') self.progress.update('Clustering ...') vbgmm.fit(self.transformed_data, self.assign, self.NClusters, self.debug) self.progress.end() self.run.info('CONCOCT VGBMM', 'Done with %d clusters' % (len(set(self.assign)))) # construct and return a results dictionary: return dict(zip(self.contig_names, ['Bin_%d' % g for g in self.assign]))
def cluster(self): self.progress.new("VBGMM") self.progress.update("Clustering ...") vbgmm.fit(self.transformed_data, self.assign, self.NClusters, self.debug) self.progress.end() self.run.info("CONCOCT VGBMM", "Done with %d clusters" % (len(set(self.assign)))) # construct and return a results dictionary: return dict(zip(self.contig_names, ["Bin_%d" % g for g in self.assign]))
def cluster(self): self.progress.new('VBGMM') self.progress.update('Clustering ...') vbgmm.fit(self.transformed_data, self.assign, self.NClusters, self.debug) self.progress.end() self.run.info('CONCOCT VGBMM', 'Done with %d clusters' % (len(set(self.assign)))) # construct and return a results dictionary: bin_name_conversion_dict = {} bin_counter = 1 for bin_id, num_contigs in collections.Counter(self.assign).most_common(): bin_name_conversion_dict[bin_id] = 'Bin_%d' % bin_counter bin_counter += 1 return dict(zip(self.contig_names, [bin_name_conversion_dict[g] for g in self.assign]))