﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
6947	Make coordset act immediately if a single frame specified	sdramgoolam@…	Tom Goddard	"Using the coordset in a script to jump to a specific frame does not take effect until a frame is drawn with a wait command.  This is confusing.  Better if jumping to a single frame happens immediately.

Begin forwarded message:

From: Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu>
Subject: Re: [chimerax-users] Coordset command not working in nogui mode
Date: May 24, 2022 at 11:15:06 AM PDT
To: Shubham Devesh Ramgoolam 
Cc: ""chimerax-users@cgl.ucsf.edu"" <chimerax-users@cgl.ucsf.edu>


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@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"	enhancement	assigned	moderate		MD/Ensemble Analysis				Elaine Meng Eric Pettersen				all	ChimeraX
