Skip to content
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

Merged
merged 9 commits into from
Oct 2, 2024
Merged

InSty improvements #1965

merged 9 commits into from
Oct 2, 2024

Conversation

karolamik13
Copy link
Contributor

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).

sbs_barplot

Now we have two options - bar plot and graph like the one below.

sbs_iPla2B


with open(file_path) as f:
data = np.loadtxt(f, dtype=str)
#print("File with energies: ", file_path)
Copy link
Contributor

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:
Copy link
Contributor

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)
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

@@ -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.")
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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)."?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced it.

Copy link
Contributor

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

Copy link
Contributor

@jamesmkrieger jamesmkrieger left a 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

@karolamik13 karolamik13 merged commit 89aaa64 into prody:main Oct 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants