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

More improvements and fixes #1928

Merged
merged 12 commits into from
Aug 4, 2024
Merged

Conversation

jamesmkrieger
Copy link
Contributor

  • Critical fix when using start frame - otherwise, it doesn't analyse enough frames
    For both trajectory and multi-model PDB

  • added use_segname to getResidueName for use with calcBridgesResiduesHistogram

  • made selectSurroundingBox select whole residues

Now, we should get sensible results

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.

There is a problem with calcWaterBridgesTrajectory()

calcWaterBridgesTrajectory(coords_traj, trajectory, method='cluster')

@> Frame: 0
@> Frame: 1
@> Frame: 2
Process Process-2:
@> Frame: 3
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
Process Process-3:
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
Traceback (most recent call last):
NameError: free variable 'indices' referenced before assignment in enclosing scope
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
Process Process-4:
@> Frame: 4
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
Process Process-5:
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
NameError: free variable 'indices' referenced before assignment in enclosing scope
Traceback (most recent call last):
@> Frame: 5
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
NameError: free variable 'indices' referenced before assignment in enclosing scope
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
NameError: free variable 'indices' referenced before assignment in enclosing scope
Process Process-6:
Traceback (most recent call last):
Process Process-7:
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
NameError: free variable 'indices' referenced before assignment in enclosing scope
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
NameError: free variable 'indices' referenced before assignment in enclosing scope
@> Frame: 6
@> Frame: 7
@> Frame: 8
Process Process-8:
@> Frame: 9
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
@> Frame: 10
Process Process-9:
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
NameError: free variable 'indices' referenced before assignment in enclosing scope
Process Process-10:
@> Frame: 11
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
Process Process-11:
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
NameError: free variable 'indices' referenced before assignment in enclosing scope
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
NameError: free variable 'indices' referenced before assignment in enclosing scope
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
NameError: free variable 'indices' referenced before assignment in enclosing scope
Process Process-12:
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
Process Process-13:
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
NameError: free variable 'indices' referenced before assignment in enclosing scope
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 575, in analyseFrame
atoms_copy = atoms_copy[indices]
NameError: free variable 'indices' referenced before assignment in enclosing scope
@> Frame: 12
@> Frame: 13
@> Frame: 14
..

@jamesmkrieger
Copy link
Contributor Author

Ah ok. I need to set indices as None if there’s no selection. Thanks

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.

I have a similar error as previously.

calcWaterBridgesTrajectory(coords_traj, trajectory, method='cluster')
@> Frame: 0
@> Frame: 1
@> Frame: 2
@> Frame: 3
@> Frame: 4
@> Frame: 5
Process Process-3:
Process Process-2:
Traceback (most recent call last):
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/atomic/atomgroup.py", line 220, in getitem
index = int(index)
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/atomic/atomgroup.py", line 220, in getitem
index = int(index)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Process Process-4:

During handling of the above exception, another exception occurred:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/atomic/atomgroup.py", line 220, in getitem
index = int(index)
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
Process Process-5:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
File "/home/karolamik/anaconda3/envs/prody/lib/python3.9/site-packages/ProDy-2.4.1-py3.9-linux-x86_64.egg/prody/proteins/waterbridges.py", line 576, in analyseFrame
atoms_copy = atoms_copy[indices]

During handling of the above exception, another exception occurred:
...

I have such problems with two systems with MD, but when I am running your script "example.py" for 4a0v, it looks good.

python example.py
@> Atom group was loaded in 0.47s.
@> DCD file contains 4 coordinate sets for 707044 atoms.
@> DCD file was parsed in 0.04 seconds.
@> 32.37 MB parsed at input rate 902.61 MB/s.
@> 4 coordinate sets parsed at input rate 111 frame/s.

running 1 times with 4 frames for 1 subunit
@> Frame: 0
@> Frame: 1
@> Frame: 2
@> Frame: 3
@> 7 water bridges detected using method chain for frame 0
@> 710 water bridges detected using method chain for frame 1
@> 679 water bridges detected using method chain for frame 2
@> 705 water bridges detected using method chain for frame 3

timing is 0.307 minutes total, or 4.606 seconds/frame

running 1 times with 4 frames for 4 subunits
@> Frame: 0
@> Frame: 1
@> Frame: 2
@> Frame: 3
@> 34 water bridges detected using method chain for frame 0
@> 2180 water bridges detected using method chain for frame 1
@> 2138 water bridges detected using method chain for frame 3
@> 2157 water bridges detected using method chain for frame 2

timing is 0.963 minutes total, or 14.449 seconds/frame

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.

I tested two cases with MD trajectories, all WatFinder functions from the ProDy website tutorial, and your script for TriC/CCT. Everything is working fine.

@jamesmkrieger
Copy link
Contributor Author

ok, now it's working for savePDBWaterBridgesTrajectory too!

@karolamik13
Copy link
Contributor

I tested all main functionalities of WatFinder (two cases with MDs (case study 2 and 4), general WatFinder tutorial, example.py from James, and calculations for TriC/CCT (case study 5 provided by James).
Everything looks good.

@karolamik13 karolamik13 merged commit 922b426 into prody:main Aug 4, 2024
5 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