-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InSty improvements #1965
InSty improvements #1965
Conversation
prody/proteins/interactions.py
Outdated
|
||
with open(file_path) as f: | ||
data = np.loadtxt(f, dtype=str) | ||
#print("File with energies: ", file_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commented line can be deleted
with open(file_path) as f: | ||
data = np.loadtxt(f, dtype=str) | ||
#print("File with energies: ", file_path) | ||
with open(file_path) as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these makes sense
@@ -2102,7 +2171,7 @@ def calcStatisticsInteractions(data, **kwargs): | |||
"energy": get_energy([element.split('-')[0][:3], element.split('-')[1][:3]], energy_list_type) | |||
} | |||
except: | |||
LOGGER.warn('energy information is not available for ', element.split('-')[0][:3], element.split('-')[1][:3]) | |||
LOGGER.warn('energy information is not available for ', element) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll trust this works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, I am displaying information about the pair ASP609B-ARG687A (element) instead of ASP and ARG. Both versions are OK, but if we keep the previous one and we have a non-standard residue name with four letters, we will not obtain the full name in the warning. If you think that we will not have such a situation we can go back to the previous version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I agree it’s helpful to have all the details
prody/proteins/interactions.py
Outdated
@@ -2124,6 +2193,10 @@ def calcStatisticsInteractions(data, **kwargs): | |||
else: pass | |||
|
|||
statistic.sort(key=lambda x: x[1], reverse=True) | |||
|
|||
if statistic == []: | |||
LOGGER.info("Decrease the value of weight_cutoff parameter to obtain the results. Default is 0.2.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a bit clearer. Perhaps say that results were filtered out or whatever it is that's happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we have a small number of interactions that are not maintained all the time, as it may happen very often for repulsive ionic bonding, we may obtain an empty list from calcStatisticsInteractions() with default weight_cutoff. I am analyzing chain-chain interactions, so we do not have many interactions for Pi-Stacking, Pi-Cation, or RIB, and I noticed that although I had some interactions, I received an empty list with statistics. To obtain something, even not-so-meaningful interactions, you should decrease weight_cutoff to a smaller value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense but too long for message. How about "No meaningful interactions found. Decrease weight_cutoff to obtain some results (default is 0.2)."?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Ready to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems good. I'd just suggest improving the logging when statistic is empty like the error for no waters
I fixed a problem with calcStatisticsInteractions(), added some info warnings for InSty tool and WatFinder.
I also added a new function showInteractionsHist(), which generates bar plots with interactions (see below).
Now we have two options - bar plot and graph like the one below.