localpdb/plugins/PDBSeqresMapper.py
def map_pdb_feat_to_seqres(self, value_dict, pdb_chain_id, na_value=0, regions=False):
        """
        Maps pdb features onto the seqres sequence
        :param value_dict: Dict with PDB resnames as keys and arbitrary values
        :param pdb_chain_id: pdb_chain identifier
        :param na_value: format for the missing values in seqres (usually not all PDB resids are mapped onto seqres)
        :param regions: bool flag to return also continous seqres fragments corresponding to the continous fragments in PDB
        :return: list of length equal to seqres sequence with mapped PDB values
        """

        if pdb_chain_id not in self.lpdb._mapping_dict.keys():
            raise ValueError('Mapping for id \'{}\' is not available!'.format(pdb_chain_id))

        mapping_dict = self.get_pdbseqres_mapping(pdb_chain_id)
        seqres_seq = self.lpdb.chains.loc[pdb_chain_id, 'sequence']
        mapping = [na_value] * len(seqres_seq)

        for key, value in value_dict.items():
            if key in mapping_dict.keys():
                mapping[mapping_dict[key]] = value
        if regions:
            return mapping, self.lpdb.mapped_seqres_regions[pdb_chain_id]
        else:
            return mapping

        Maps pdb features onto the seqres sequence
        :param value_dict: Dict with PDB resnames as keys and arbitrary values
        :param pdb_chain_id: pdb_chain identifier
        :param na_value: format for the missing values in seqres (usually not all PDB resids are mapped onto seqres)
        :param regions: bool flag to return also continous seqres fragments corresponding to the continous fragments in PDB
        :return: list of length equal to seqres sequence with mapped PDB values
        
Maps pdb features onto the seqres sequence
Maps pdb features onto the seqres sequence
def map_pdb_feat_to_seqres(self, value_dict, pdb_chain_id, na_value=0, regions=False):
        if pdb_chain_id not in self.lpdb._mapping_dict.keys():
            raise ValueError('Mapping for id \'{}\' is not available!'.format(pdb_chain_id))
        mapping_dict = self.get_pdbseqres_mapping(pdb_chain_id)
        seqres_seq = self.lpdb.chains.loc[pdb_chain_id, 'sequence']
        mapping = [na_value] * len(seqres_seq)
        for key, value in value_dict.items():
            if key in mapping_dict.keys():
                mapping[mapping_dict[key]] = value
        if regions:
            return mapping, self.lpdb.mapped_seqres_regions[pdb_chain_id]
        else:
            return mapping
def map_pdb_feat_to_seqres ( self , value_dict , pdb_chain_id , na_value = 0 , regions = False ) : if pdb_chain_id not in self . lpdb . _mapping_dict . keys ( ) : raise ValueError ( 'Mapping for id \'{}\' is not available!' . format ( pdb_chain_id ) ) mapping_dict = self . get_pdbseqres_mapping ( pdb_chain_id ) seqres_seq = self . lpdb . chains . loc [ pdb_chain_id , 'sequence' ] mapping = [ na_value ] * len ( seqres_seq ) for key , value in value_dict . items ( ) : if key in mapping_dict . keys ( ) : mapping [ mapping_dict [ key ] ] = value if regions : return mapping , self . lpdb . mapped_seqres_regions [ pdb_chain_id ] else : return mapping
Maps pdb features onto the seqres sequence
Maps pdb features onto the seqres sequence
"""
        Maps pdb features onto the seqres sequence
        :param value_dict: Dict with PDB resnames as keys and arbitrary values
        :param pdb_chain_id: pdb_chain identifier
        :param na_value: format for the missing values in seqres (usually not all PDB resids are mapped onto seqres)
        :param regions: bool flag to return also continous seqres fragments corresponding to the continous fragments in PDB
        :return: list of length equal to seqres sequence with mapped PDB values
        """
list of length equal to seqres sequence with mapped PDB values
list of length equal to seqres sequence with mapped PDB values
self
value_dict
Dict with PDB resnames as keys and arbitrary values
Dict with PDB resnames as keys and arbitrary values
pdb_chain_id
None
na_value
format for the missing values in seqres (usually not all PDB resids are mapped onto seqres)
format for the missing values in seqres ( usually not all PDB resids are mapped onto seqres )
regions
bool flag to return also continous seqres fragments corresponding to the continous fragments in PDB
bool flag to return also continous seqres fragments corresponding to the continous fragments in PDB