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

        omega describes the -C-N- peptide bond. Typically, it is trans (180
        degrees) although cis-bonds (0 degrees) are also occasionally observed
        (especially near Proline).

        Returns
        -------
        AtomGroup
            4-atom selection in the correct order. If no C' found in the
            previous residue (by resid) then this method returns ``None``.

        """
    nextres = residue.resid + 1
    segid = residue.segment.segid
    sel = residue.atoms.select_atoms('name CA', 'name C'
        ) + residue.universe.select_atoms('segid {} and resid {} and name N'
        .format(segid, nextres), 'segid {} and resid {} and name CA'.format
        (segid, nextres))
    if len(sel) == 4:
        return sel
    else:
        return None
