Skip to content

Commit

Permalink
ligand selection optional in saveInteractionsPDB
Browse files Browse the repository at this point in the history
  • Loading branch information
karolamik13 committed Oct 21, 2023
1 parent ee75aea commit 3e743bd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions prody/proteins/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3938,13 +3938,19 @@ def saveInteractionsPDB(self, **kwargs):
:arg filename: name of the PDB file which will be saved for visualization,
it will contain the results in occupancy column.
:type filename: str """
:type filename: str
:arg ligand_sele: ligand selection,
by default is 'all not (protein or water or ion)'.
:type ligand_sele: str
"""

if self._freq_interactors is None:
raise ValueError('Please calculate frequent interactors using getFrequentInteractors.')

atoms = self._atoms
dictOfInteractions = self._freq_interactors
ligand_sele = kwargs.pop('ligand_sele', 'all not (protein or water or ion)')

freq_contacts_list = np.zeros(atoms.ca.numAtoms(), dtype=int)
for k, v in dictOfInteractions[0].items():
Expand All @@ -3953,7 +3959,7 @@ def saveInteractionsPDB(self, **kwargs):

from collections import Counter
lista_ext = []
ligands = atoms.select('all not (protein or water or ion)')
ligands = atoms.select(ligand_sele)
atoms = atoms.select("protein and noh")
ligand_occupancy = np.zeros(len(ligands.getResnums()))

Expand Down

0 comments on commit 3e743bd

Please sign in to comment.