From bc432db50e7baa08313be7e2df42614e9b914db1 Mon Sep 17 00:00:00 2001 From: karolamik13 Date: Wed, 18 Oct 2023 20:59:59 +0200 Subject: [PATCH] Selection of ligand added to getFrequentInteractors --- prody/proteins/interactions.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/prody/proteins/interactions.py b/prody/proteins/interactions.py index b0210b4d5..007934c7f 100644 --- a/prody/proteins/interactions.py +++ b/prody/proteins/interactions.py @@ -3827,11 +3827,21 @@ def getFrequentInteractors(self, **kwargs): ligs[ligs_names].append(res_name) for i in ligs.keys(): - LOGGER.info('LIGAND: {0}'.format(i)) - aa_counter = Counter(ligs[i]) - dictOfInteractions.append(aa_counter) + + if selection == None: + LOGGER.info('LIGAND: {0}'.format(i)) + aa_counter = Counter(ligs[i]) + dictOfInteractions.append(aa_counter) + + for j in aa_counter.items(): + LOGGER.info('{0}: {1}'.format(j[0],j[1])) + + else: + LOGGER.info('LIGAND: {0}'.format(selection)) + aa_counter = Counter(ligs[selection]) + dictOfInteractions.append(aa_counter) - for j in aa_counter.items(): - LOGGER.info('{0}: {1}'.format(j[0],j[1])) + for j in aa_counter.items(): + LOGGER.info('{0}: {1}'.format(j[0],j[1])) return dictOfInteractions