def is_backbone(atom, element, minimal=False):
    """
    Whether `atom` is a protein backbone atom or not.

    Parameters
    ----------
    atom : str
        The atom name.

    element : str
        The element name.

    minimal : bool
        If `True` considers only `C` and `N` elements.
        `False`, considers also `O`.
    """
    e = element.strip()
    a = atom.strip()
    elements = {
        True: ('N', 'C'),
        False: ('N', 'C', 'O'),
        }
    # elements is needed because of atoms in HETATM entries
    # for example 'CA' is calcium
    return a in ('N', 'CA', 'C', 'O') and e in elements[minimal]