-
Notifications
You must be signed in to change notification settings - Fork 657
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
Velocity of residue movement calculation question #1778
Comments
#1053 somewhat related to this |
Confirmed it wasn't my distance calculation (that would've been embarrassing). Changing the calculation to using:
yielded the same numbers. |
Hey @KyleStiers I'm a little confused at what you're trying to calculate, are you trying to show that the Ca positions are moving faster over time? The line for counter, ts in enumerate(u.trajectory):
if counter != 0:
ca_dist[counter, :] = multi_diff(ca.positions - old_positions)
old_positions = ca.positions Where you're comparing the positions in the current timestep to the last |
Doh. You are absolutely right. I actually had been using something exactly like what you posted, albeit less concise, then at some point changed it to my clearly incorrect function. That and then including the nested loop over each residue inside got it, thanks for seeing my rookie mistake. Now on to trying to figure out the center_of_mass() stuff 👍 for counter, ts in enumerate(u.trajectory):
if counter != 0:
for i in range(0,562):
ca_dist[counter,i] = numpy.linalg.norm(ca.positions[i] - old_positions[i])
old_positions = ca.positions |
Hello all,
I am trying to develop a script to show a loop moves much faster in one trajectory than it does in another. I currently am thinking the best way to show this is on a per-residue level. So I have written the below, which gives me an output CSV matrix of distance moved per (Ca) residue per frame - analogous to RMSF but not dependent on an average structure (because I'm interested in speed of change).
However, all the values are nearly identical. It seems like from the log that everything is going correctly, i.e. current and previous coordinates are updating correctly. Am I missing something obvious?
It would also be interesting and informative if I could find a center-of-mass for a group of residues and monitor the distance traversed per frame to compare between two trajectories - but I'm not sure yet how to do that.
NOTES: you may wonder why I wrote my own distance calculation, I had trouble getting dist() to work for some reason and 562 is the number of Ca residues over 1002 frames in each trajectory.
Would appreciate the help or suggestions on how to improve the methodology!
Code to reproduce the behaviour
The text was updated successfully, but these errors were encountered: