def GetTMIndex(iRes, posTM):# {{{
    """Get index of TM helix given a residue position
    Return -1 if iRes is not within TM region
    """
    for i in range(len(posTM)):
        (b, e) = posTM[i]
        if iRes >= b and iRes < e:
            return i
    return -1
    # }}}