Create the inverse mappings (UniParc -> SEQRES -> ATOM -> Rosetta).

def _create_inverse_maps(self):
        '''Create the inverse mappings (UniParc -> SEQRES -> ATOM -> Rosetta).'''

        # We have already determined that the inverse maps are well-defined (the normal maps are injective). The inverse maps will be partial maps in general.

        self.atom_to_rosetta_sequence_maps = {}
        for chain_id, sequence_map in self.rosetta_to_atom_sequence_maps.iteritems():
            s = SequenceMap()
            for k, v, substitution_match in sequence_map:
                s.add(v, k, substitution_match)
            self.atom_to_rosetta_sequence_maps[chain_id] = s

        self.seqres_to_atom_sequence_maps = {}
        for chain_id, sequence_map in self.atom_to_seqres_sequence_maps.iteritems():
            s = SequenceMap()
            for k, v, substitution_match in sequence_map:
                s.add(v, k, substitution_match)
            self.seqres_to_atom_sequence_maps[chain_id] = s

        # This map uses PDB chain IDs as PDB chains may map to zero or one UniParc IDs whereas UniParc IDs may map to many PDB chains
        self.uniparc_to_seqres_sequence_maps = {}
        for chain_id, sequence_map in self.seqres_to_uniparc_sequence_maps.iteritems():
            s = UniParcPDBSequenceMap()
            for k, v, substitution_match in sequence_map:
                s.add(v, k, substitution_match)
            self.uniparc_to_seqres_sequence_maps[chain_id] = s