report.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:cellranger 作者: 10XGenomics 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号