def get_nonTM_seq_using_nested_TM_indices(s, t):
    """Get the nonTM (EM) region of protein sequence based on nested tuple of TM indices.

    Parameters
    ----------
    s : str
        Full sequence to be sliced
        e.g. 'MKLLRRAWRRRAALGLGTLALCGAALLYLARCAAEPGDPRAMSGRSPPPPAPARAAAFLAVLVA'
    t : tuple
        Nested tuple of TM regions
        e.g. ((11, 30),)
        IMPORTANT: Indexing is using UniProt style (1:3), not python style (0:3)

    Returns
    -------
    nonTMD_seq : str
        Non-TMD sequence (all residues surrounding TMD)
    """
    TM01_start = t[0][0]
    last_TMD_end = t[-1][1]
    nonTMD_first = s[0: int(TM01_start) - 1]
    nonTMD_seq = nonTMD_first
    # only for multipass proteins, generate sequences between TMDs
    if len(t) > 1:
        for TM_Nr in range(len(t) - 1):
            # the TMD is the equivalent item in the list
            TMD = "TM{:02d}".format(TM_Nr + 1)
            # the next TMD, which contains the end index, is the next item in the list
            next_TMD = "TM{:02d}".format(TM_Nr + 2)

            TM_start = t[TM_Nr][0]
            TM_end = t[TM_Nr][1]
            next_TM_start = t[TM_Nr + 1][0]
            next_TM_end = t[TM_Nr + 1][1]

            between_TM_and_TMplus1 = s[TM_end: next_TM_start - 1]

            nonTMD_seq += between_TM_and_TMplus1

    # sequence from last TMD to C-term.
    nonTMD_last = s[last_TMD_end:]
    nonTMD_seq += nonTMD_last
    return nonTMD_seq