def split_barcode(barcode, return_gg=False):
    """Splits a barcode sequence into part A, part C, and part B sequences."""
    split = barcode.split("-")
    if len(split) == 2:
        # Remove the gem group from the barcode
        barcode, gem_group = split
    else:
        gem_group = None
    assert len(barcode) == 16
    part_a, part_c, part_b = barcode[:7], barcode[7:9], barcode[9 : 9 + 7]
    if return_gg:
        return part_a, part_c, part_b, gem_group
    return part_a, part_c, part_b