def report_barcodes_h5(self, filename):
data = self.report('barcodes')
if self.barcode_whitelist:
bc_sequences = cr_utils.format_barcode_seqs(self.barcode_whitelist, self.gem_groups)
elif self.barcode_summary is not None:
bc_sequences = self.barcode_summary
else:
# Get all observed bc sequences
bc_sequences = sorted(list(reduce(lambda x, y: x.union(y.keys()), data.values(), set())))
# Build the columns for the table
bc_table_cols = {cr_constants.H5_BC_SEQUENCE_COL: bc_sequences}
for metric_name, metric_data in data.iteritems():
counts = np.array([metric_data.get(bc, 0) for bc in bc_sequences], dtype=np.uint32)
bc_table_cols[metric_name] = counts
cr_utils.write_h5(filename, bc_table_cols)
评论列表
文章目录