def SetupSelectionForInterfaceContactsView(ComplexName, ChainIDs, ResNums):
    """Setup a selection for generating polar or hyrophobic contacts for an interface."""

    ChainSelections = []
    
    for ChainID in ChainIDs:
        ChainResNumsSelection = "+".join(ResNums["ResNums"][ChainID])
        Selection = "(%s and chain %s and polymer and (resi %s))" % (ComplexName, ChainID, ChainResNumsSelection)
        ChainSelections.append(Selection)

    Selection = " or ".join(ChainSelections)
    
    return Selection