def get_incomplete_elements(cg):
    """
    Get an estimated list of cg-elements which have missing residues in the PDB.

    One of many problems with PDB data are residues, for which no
    coordinates could be determined experimentally. This function gives
    an estimated list of cg-elements, which are affected by missing residues.
    """
    incomplete = set()
    for elem in cg.defines:
        for r in cg.define_range_iterator(elem, adjacent=elem[0] != 's'):
            if cg.seq[r[0]:r[1]] != cg.seq.with_missing[r[0]:r[1]]:
                incomplete.add(elem)
    return incomplete
