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

add selstr and box selection to watfinder #1919

Merged
merged 3 commits into from
Jul 28, 2024

Conversation

jamesmkrieger
Copy link
Contributor

New function selectSurroundingsBox selects the surroundings of a selection in a bounding box with the minimum and maximum x, y and z values, and an optional padding. There is an option to just return the x, y, z selection string.

calcWaterBridges and calcWaterBridgesTrajectory have new kwargs selstr and expand_selection to take the output of this function or any other user selstr.

By default, expand_selection is False to not have unexpected results for other selections. If set to True, then it uses the new function after applying the initial selstr.

In [1]: from prody import *
   ...: 
   ...: atoms = parsePDB('4a0v_all_sci.pdb')
   ...: traj = parseDCD('4a0v_all_sci_3frames.dcd')
@> 707044 atoms and 1 coordinate set(s) were parsed in 9.51s.
@> DCD file contains 4 coordinate sets for 707044 atoms.
@> DCD file was parsed in 0.06 seconds.
@> 32.37 MB parsed at input rate 563.60 MB/s.
@> 4 coordinate sets parsed at input rate 69 frame/s.

In [2]: x = calcWaterBridgesTrajectory(atoms, traj, start_frame=1, selstr='segname PROA', expand_selecti
   ...: on=True)
@> Frame: 1
@> 677 water bridges detected using method chain.
@> Frame: 2
@> 552 water bridges detected using method chain.
@> Frame: 3
@> 598 water bridges detected using method chain.

In [3]: x = calcWaterBridgesTrajectory(atoms, traj, start_frame=1)
@> Frame: 1
@> 6077 water bridges detected using method chain.
@> Frame: 2
@> 6011 water bridges detected using method chain.
@> Frame: 3
@> 6127 water bridges detected using method chain.

@karolamik13
Copy link
Contributor

I took the same structure but different frames from the trajectory. Looks good.

In [11]: from prody import *

In [12]: atoms = parsePDB('4a0v_all_sci.pdb')
@> 707044 atoms and 1 coordinate set(s) were parsed in 13.42s.

In [13]: traj = parseDCD('4a0v_4frames.dcd')
@> DCD file contains 4 coordinate sets for 707044 atoms.
@> DCD file was parsed in 0.04 seconds.
@> 32.37 MB parsed at input rate 794.29 MB/s.
@> 4 coordinate sets parsed at input rate 98 frame/s.

In [14]: x = calcWaterBridgesTrajectory(atoms, traj, start_frame=1, selstr='segname PROA', expand_selecti
...: on=True)
@> Frame: 1
@> Frame: 2
@> Frame: 3
@> 605 water bridges detected using method chain.
@> 556 water bridges detected using method chain.
@> 609 water bridges detected using method chain.

In [15]: x = calcWaterBridgesTrajectory(atoms, traj, start_frame=1)
@> Frame: 1
@> Frame: 2
@> Frame: 3
@> 5677 water bridges detected using method chain.
@> 5956 water bridges detected using method chain.
@> 5992 water bridges detected using method chain.

Copy link
Contributor

@karolamik13 karolamik13 left a comment

Choose a reason for hiding this comment

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

It works fine, as I showed in the previous comment.

@jamesmkrieger
Copy link
Contributor Author

Great. Thanks

@karolamik13 karolamik13 merged commit f59c2e6 into prody:main Jul 28, 2024
5 checks passed
@jamesmkrieger jamesmkrieger deleted the watfinder_box_sel branch August 14, 2024 11:04
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