def get_idx(seq, bc_start, bc_len):
    """
    Get the slices corresponding to barcode and variant

    Parameters:
    -----------
    seq :: str
        Sequence to slice
    bc_start :: int
        Starting location of barcode (can be negatively indexed)
    bc_len :: int

    Returns:
    --------
    bc_slice :: slice
        location of the barcode
    var_slice :: slice
        location of the variant
    """
    if bc_start <= 0:
        bc_slice = slice(len(seq) + bc_start, len(seq) + bc_start + bc_len)
        var_slice = slice(bc_start)
    else:
        # compensate for 0-based indexing
        bc_slice = slice(bc_start - 1, bc_start + bc_len - 1)
        var_slice = slice(bc_start + bc_len - 1, len(seq))
    return (bc_slice, var_slice)