molecule_counter.py 文件源码

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

项目:cellranger 作者: 10XGenomics 项目源码 文件源码
def concatenate(out_filename, in_filenames, metrics=None):
        # Append each column from each input h5 to the output h5
        out_mc = MoleculeCounter.open(out_filename, mode='w')
        ref_set = False
        for in_filename in in_filenames:
            in_mc = MoleculeCounter.open(in_filename, mode='r')
            # if no metrics specified, copy them from the first file
            if metrics is None:
                metrics = in_mc.get_all_metrics()
            for name, array_tuple in in_mc.columns.iteritems():
                h5_array, _ = array_tuple
                out_mc.add_many(name, h5_array[:])
            if not ref_set: # only set once
                for name, h5_array in in_mc.ref_columns.iteritems():
                    out_mc.set_ref_column(name, h5_array[:])
                ref_set = True
            in_mc.close()
        out_mc.set_all_metrics(metrics)
        out_mc.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号