Skip to content

Commit

Permalink
getInteractors() is now added to InSty
Browse files Browse the repository at this point in the history
  • Loading branch information
karolamik13 committed Oct 12, 2024
1 parent 3a944d1 commit 0615587
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion prody/proteins/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3558,7 +3558,39 @@ def saveInteractionsPDB(self, **kwargs):
writePDB('filename', atoms, **kw)
LOGGER.info('PDB file saved.')



def getInteractors(self, residue_name):
""" Provide information about interactions for a particular residue
:arg residue_name: name of a resiude
example: LEU234A, where A is a chain name
:type residue_name: str
"""

atoms = self._atoms
interactions = self._interactions

InteractionsMap = np.empty([atoms.select('name CA').numAtoms(),atoms.select('name CA').numAtoms()], dtype=object)
resIDs = list(atoms.select('name CA').getResnums())
resChIDs = list(atoms.select('name CA').getChids())
resIDs_with_resChIDs = list(zip(resIDs, resChIDs))
interaction_type = ['hb','sb','rb','ps','pc','hp','dibs']
ListOfInteractions = []

for nr,i in enumerate(interactions):
if i != []:
for ii in i:
m1 = resIDs_with_resChIDs.index((int(ii[0][3:]),ii[2]))
m2 = resIDs_with_resChIDs.index((int(ii[3][3:]),ii[5]))
ListOfInteractions.append(interaction_type[nr]+':'+ii[0]+ii[2]+'-'+ii[3]+ii[5])

for i in ListOfInteractions:
inter = i.split(":")[1:][0]
if inter.split('-')[0] == residue_name or inter.split('-')[1] == residue_name:
LOGGER.info(i)



def getFrequentInteractors(self, contacts_min=3):
"""Provide a list of residues with the most frequent interactions based
on the following interactions:
Expand Down

0 comments on commit 0615587

Please sign in to comment.