Converts a protein to peptide or peptide to protein mapping.

    :param mapping: dict, for each key contains a set of entries

    :returns: an inverted mapping that each entry of the values points to a set
        of initial keys.

def _invertMapping(mapping):
    """Converts a protein to peptide or peptide to protein mapping.

    :param mapping: dict, for each key contains a set of entries

    :returns: an inverted mapping that each entry of the values points to a set
        of initial keys.
    """
    invertedMapping = ddict(set)
    for key, values in viewitems(mapping):
        for value in values:
            invertedMapping[value].add(key)
    return invertedMapping