[chimerax-users] Coordset command not working in nogui mode

Tom Goddard goddard at sonic.net
Tue May 24 12:33:43 PDT 2022


Hi Shubham,

  This coordset command behavior is confusing so I changed it in tomorrow's ChimeraX daily build (not in 1.4) so that "coordset #1 5" will act immediately without waiting for a frame to be drawn.  If you specify a range of frames "coordset #1 5,15" then they are still only drawn one at a time when the graphics is drawn -- that is for recording movies.

	Tom

> On May 24, 2022, at 11:15 AM, Eric Pettersen via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
> 
> Hi Shubham,
> 	Since the "coordset" command sets up playback of coordinate frames, it doesn't actually do anything until a frame is drawn, which is why in nogui mode nothing changes, and why you have to "create a delay" in GUI mode.  You can force a frame to get drawn with the "wait 1" command, which will get your script working in both modes.
> 	Alternatively, if you have the structure model in a variable (i.e. from the list of models returned by the 'open' command, or culled from session.models), you can change the coordset directly, e.g.:
> 
> 	# if the structure model is in the 's' variable
> 	for cid in s.coordset_ids:
> 		s.active_coordset_id = cid
> 		# do whatever you need to do with this coordset
> 
> --Eric
> 
> 	Eric Pettersen
> 	UCSF Computer Graphics Lab
> 
> 
>> On May 24, 2022, at 1:22 AM, Shubham Devesh Ramgoolam via ChimeraX-users <chimerax-users at cgl.ucsf.edu <mailto:chimerax-users at cgl.ucsf.edu>> wrote:
>> 
>> Hi all,
>> I hope you are doing well.
>>  
>> I have a python script for measuring the distance between aromatic rings of specific residues for different frames of a trajectory.
>> To measure the distance, I am first defining centroids at the center of aromatic rings and then use the command distance. This process is repeated for each frame to be analyzed.
>> To navigate between frames, I am using the command ‘coordset #1 {desired frame}’.
>>  
>> When executing the script in no gui mode, the centroids are always defined with respect to the residue’s location in frame 1 even though the command coordset has changed the frame.
>>  
>> In gui mode, the script only works if a delay is created between changing the frame and defining the new centroids.
>> I introduced that delay by asking for a dummy user input (I ran the script from python Shell):
>> run(session, 'coordset #1 ' + {new_frame})
>> y = input('dummy')
>> run (session, 'define centroid /A:8 & aromatic-ring radius 0.3 color yellow mass false name d1’)
>>  
>> My chimeraX version: 1.4rc202205060510 (2022-05-06)
>>  
>> Should I be using a different command for changing frames of trajectories when in nogui mode?
>>  
>> Regards,
>> Shubham
>>               
>>  
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
>>  
>> _______________________________________________
>> ChimeraX-users mailing list
>> ChimeraX-users at cgl.ucsf.edu <mailto:ChimeraX-users at cgl.ucsf.edu>
>> Manage subscription:
>> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu
> Manage subscription:
> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20220524/e3d0393c/attachment.html>


More information about the ChimeraX-users mailing list