def psi_selection(residue):
    """AtomGroup corresponding to the psi protein backbone dihedral
        N-CA-C-N'.

        Returns
        -------
        AtomGroup
            4-atom selection in the correct order. If no N' found in the
            following residue (by resid) then this method returns ``None``.
        """
    sel_str = 'segid {} and resid {} and name N'.format(residue.segment.
        segid, residue.resid + 1)
    sel = residue.atoms.select_atoms('name N', 'name CA', 'name C'
        ) + residue.universe.select_atoms(sel_str)
    if len(sel) == 4:
        return sel
    else:
        return None
