def _map_seqprop_resnums_to_structprop_chain_index(self, resnums, seqprop=None, structprop=None, chain_id=None,
                                                       use_representatives=False):
        """Map a residue number in any SeqProp to the mapping index in the StructProp + chain ID. This does not provide
        a mapping to residue number, only a mapping to the index which then can be mapped to the structure resnum!

        Args:
            resnums (int, list): Residue numbers in the sequence
            seqprop (SeqProp): SeqProp object
            structprop (StructProp): StructProp object
            chain_id (str): Chain ID to map to index
            use_representatives (bool): If representative sequence/structure/chain should be used in mapping

        Returns:
            dict: Mapping of resnums to indices

        """
        resnums = ssbio.utils.force_list(resnums)

        if use_representatives:
            seqprop = self.representative_sequence
            structprop = self.representative_structure
            chain_id = self.representative_chain
            if not structprop:
                raise ValueError('No representative structure set, please specify sequence, structure, and chain ID')
        else:
            if not seqprop or not structprop or not chain_id:
                raise ValueError('Please specify sequence, structure, and chain ID')

        if self.representative_structure:
            if structprop.id == self.representative_structure.id:
                full_structure_id = '{}-{}'.format(structprop.id, chain_id).replace('REP-', '')
            else:
                full_structure_id = '{}-{}'.format(structprop.id, chain_id)
        else:
            full_structure_id = '{}-{}'.format(structprop.id, chain_id)

        aln_id = '{}_{}'.format(seqprop.id, full_structure_id)
        access_key = '{}_chain_index'.format(aln_id)
        if access_key not in seqprop.letter_annotations:
            raise KeyError('{}: structure mapping {} not available in sequence letter annotations. Was alignment parsed? '
                           'Run ``align_seqprop_to_structprop`` with ``parse=True``.'.format(access_key, aln_id))
        chain_index_mapping = seqprop.letter_annotations[access_key]

        resnum_to_chain_index = {}
        for x in resnums:
            ix = chain_index_mapping[x - 1] - 1

            if np.isnan(ix):
                log.warning('{}-{}, {}: no equivalent residue found in structure sequence'.format(structprop.id,
                                                                                                  chain_id,
                                                                                                  x))
            else:
                resnum_to_chain_index[int(x)] = int(ix)

        return resnum_to_chain_index
def _map_seqprop_resnums_to_structprop_chain_index ( self , resnums , seqprop = None , structprop = None , chain_id = None , use_representatives = False ) : resnums = ssbio . utils . force_list ( resnums ) if use_representatives : seqprop = self . representative_sequence structprop = self . representative_structure chain_id = self . representative_chain if not structprop : raise ValueError ( 'No representative structure set, please specify sequence, structure, and chain ID' ) else : if not seqprop or not structprop or not chain_id : raise ValueError ( 'Please specify sequence, structure, and chain ID' ) if self . representative_structure : if structprop . id == self . representative_structure . id : full_structure_id = '{}-{}' . format ( structprop . id , chain_id ) . replace ( 'REP-' , '' ) else : full_structure_id = '{}-{}' . format ( structprop . id , chain_id ) else : full_structure_id = '{}-{}' . format ( structprop . id , chain_id ) aln_id = '{}_{}' . format ( seqprop . id , full_structure_id ) access_key = '{}_chain_index' . format ( aln_id ) if access_key not in seqprop . letter_annotations : raise KeyError ( '{}: structure mapping {} not available in sequence letter annotations. Was alignment parsed? ' 'Run ``align_seqprop_to_structprop`` with ``parse=True``.' . format ( access_key , aln_id ) ) chain_index_mapping = seqprop . letter_annotations [ access_key ] resnum_to_chain_index = { } for x in resnums : ix = chain_index_mapping [ x - 1 ] - 1 if np . isnan ( ix ) : log . warning ( '{}-{}, {}: no equivalent residue found in structure sequence' . format ( structprop . id , chain_id , x ) ) else : resnum_to_chain_index [ int ( x ) ] = int ( ix ) return resnum_to_chain_index
Map a residue number in any SeqProp to the mapping index in the StructProp + chain ID. This does not provide
        a mapping to residue number, only a mapping to the index which then can be mapped to the structure resnum!

        Args:
            resnums (int, list): Residue numbers in the sequence
            seqprop (SeqProp): SeqProp object
            structprop (StructProp): StructProp object
            chain_id (str): Chain ID to map to index
            use_representatives (bool): If representative sequence/structure/chain should be used in mapping

        Returns:
            dict: Mapping of resnums to indices