def fmt_umi_tag(read, cell_tag, umi_tag):
    """
    @abstract        Return formatted UMI string according to cell_tag and umi_tag.
    @param read      An alignment read [AlignmentSegment].
    @param cell_tag  Cell tag, e.g., "CB". None means do not use cell tag [STR].
    @param umi_tag   UMI tag, e.g., "UR". Should not be None [STR].
    @return          A formatted (joined) UMI string used for UMI grouping [STR].
    """
    return read.get_tag(cell_tag) + '>' + read.get_tag(umi_tag) if cell_tag is not None else read.get_tag(umi_tag)