def plot_barcode_rank(chart, sample_properties, sample_data):
""" Generate the RNA counter barcode rank plot """
if sample_properties.get('genomes') is None or sample_data.barcode_summary is None:
return None
if len(sample_properties['genomes']) == 0:
return None
counts_per_bc = []
for genome in sample_properties['genomes']:
key = cr_utils.format_barcode_summary_h5_key(genome, cr_constants.TRANSCRIPTOME_REGION, cr_constants.CONF_MAPPED_DEDUPED_READ_TYPE)
if key in sample_data.barcode_summary:
counts_per_bc.append(sample_data.barcode_summary[key][:])
else:
# Not guaranteed to exist, depending on pipeline
return
counts_per_bc = np.concatenate(counts_per_bc)
return _plot_barcode_rank(chart, counts_per_bc, sample_data.num_cells)
评论列表
文章目录