
Hi Shubham, Without seeing your code it's hard to comment more specifically, but are you perhaps appending to lists that are then growing through the course of the process. It can sometimes be better to initialise numpy arrays instead and add things to them by indexing. For example, x = np.array((3,2)) for i, frame in enumerate(list_frames): Set current frame to frame for j, pair in enumerate(specific_residue_pairs): x[i, j] = result of computation Best wishes James Shubham Devesh Ramgoolam via ChimeraX-users <chimerax-users@cgl.ucsf.edu> escribió:
I just wanted to specify that I am using the nogui mode of chimeraX for the computation. Shubham.
________________________________ From: Shubham Devesh Ramgoolam Sent: June 12, 2022 1:38 AM To: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Trajectory computation slowing down overtime
Hi all,
I hope you are doing well.
I have a Python script for analyzing specific residue pairs for every frame in a trajectory.
It does so, by using 2 for loops:
For frame in list_frames:
Set current frame to frame
For pair in specific_residue_pairs:
Do computation
The computation involves defining geometric objects(centroids, axes, planes) and performing calculations with them(distance, angles).
The issue here is that as we move further in list_frames, the computation takes longer and longer. There is a somewhat linear increase in computation time, as illustrated below:
[cid:image003.png@01D87E37.C872FDF0]
Is there a way to maintain the same computation time for every frame in the trajectory?
Regards,
Shubham Ramgoolam
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows