def scan_tags(tags):
    """
    Input bam tags
    Return UMI and cell barcode sequences
    """
    cell_barcode = None
    umi = None
    for tag in tags:
        if tag[0] == "CB":
            cell_barcode = tag[1]
        elif tag[0] == "UB":
            umi = tag[1]
        else:
            pass
    return cell_barcode, umi