Removing text labels generated with command distance

Hi, I hope you are doing well. I have a python script, to be executed in nogui mode, which does the following: -open a pdb file -define centroids for specific residues -draw pseudobonds between specific residues -> I am using the command distance for this purpose The issue arises when I have to save the session (.cxs) when in nogui mode, I am getting this error: QGuiApplication::font(): no QGuiApplication instance and no application font set. I believe it is because of the text labels created by the command distance. So, I included the following in my code: run(session, ‘hide #2.*’) and I can now save the session. I noticed in the model panel that the pdb file is assigned to #1 and the pseudobond to #2. The text labels are created as a submodel of the pseudobond (so #2.1, 2.2,..), hence why the ‘hide #2.*’ Will this fix always work? Is the model assignment also dependent on the pdb file being opened? Regards, Shubham Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

Hi Shubham, If you don't mind actually deleting the distance labels instead of hiding them, you could use this instead: label delete pseudobonds That will keep the pseudobonds shown, but delete their (distance) labels. Maybe there should be an option in "distance style" to hide these labels. In your case, what you really wanted was not a distance measurement anyway (if I understood correctly). Another way to add a pseudobond is to read in a pseudobond file, which essentially lists pairs of atoms between which to draw the pseudobonds... however, making a separate file is often inconvenient. <https://rbvi.ucsf.edu/chimerax/docs/user/pseudobonds.html#pbfiles> Maybe there should also be a command for making a generic pseudobond. Another kludgy way besides using the "distance" command is to force the "contacts" command to identify the two atoms/centroids as a contact by using a huge contact distance. i.e. instead of: distance [specification of two atoms] would be something like: contacts [specify one atom] restrict [specify other atom] distance 5000 make true color gold see <https://rbvi.ucsf.edu/chimerax/docs/user/commands/clashes.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On May 14, 2022, at 11:57 PM, Shubham Devesh Ramgoolam via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi, I hope you are doing well. I have a python script, to be executed in nogui mode, which does the following: -open a pdb file -define centroids for specific residues -draw pseudobonds between specific residues -> I am using the command distance for this purpose
The issue arises when I have to save the session (.cxs) when in nogui mode, I am getting this error: QGuiApplication::font(): no QGuiApplication instance and no application font set.
I believe it is because of the text labels created by the command distance. So, I included the following in my code: run(session, ‘hide #2.*’) and I can now save the session.
I noticed in the model panel that the pdb file is assigned to #1 and the pseudobond to #2. The text labels are created as a submodel of the pseudobond (so #2.1, 2.2,..), hence why the ‘hide #2.*’
Will this fix always work? Is the model assignment also dependent on the pdb file being opened?
Regards, Shubham

Your script will work in tomorrow's daily build. --Eric
On May 14, 2022, at 11:57 PM, Shubham Devesh Ramgoolam via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi, I hope you are doing well. I have a python script, to be executed in nogui mode, which does the following: -open a pdb file -define centroids for specific residues -draw pseudobonds between specific residues -> I am using the command distance for this purpose
The issue arises when I have to save the session (.cxs) when in nogui mode, I am getting this error: QGuiApplication::font(): no QGuiApplication instance and no application font set.
I believe it is because of the text labels created by the command distance. So, I included the following in my code: run(session, ‘hide #2.*’) and I can now save the session.
I noticed in the model panel that the pdb file is assigned to #1 and the pseudobond to #2. The text labels are created as a submodel of the pseudobond (so #2.1, 2.2,..), hence why the ‘hide #2.*’
Will this fix always work? Is the model assignment also dependent on the pdb file being opened?
Regards, Shubham
Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>

I made a ChimeraX fix so labels will not cause problems in no gui mode. I put this in the daily builds (and eventually in ChimeraX 1.5), but not in the ChimeraX 1.4 release candidate since we are too close to releasing 1.4 to include it. Tom
On May 16, 2022, at 3:49 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Your script will work in tomorrow's daily build.
--Eric
On May 14, 2022, at 11:57 PM, Shubham Devesh Ramgoolam via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Hi, I hope you are doing well. I have a python script, to be executed in nogui mode, which does the following: -open a pdb file -define centroids for specific residues -draw pseudobonds between specific residues -> I am using the command distance for this purpose
The issue arises when I have to save the session (.cxs) when in nogui mode, I am getting this error: QGuiApplication::font(): no QGuiApplication instance and no application font set.
I believe it is because of the text labels created by the command distance. So, I included the following in my code: run(session, ‘hide #2.*’) and I can now save the session.
I noticed in the model panel that the pdb file is assigned to #1 and the pseudobond to #2. The text labels are created as a submodel of the pseudobond (so #2.1, 2.2,..), hence why the ‘hide #2.*’
Will this fix always work? Is the model assignment also dependent on the pdb file being opened?
Regards, Shubham
Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@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@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Thank you all for the help. I appreciate it. Shubham ________________________________ From: Tom Goddard <goddard@sonic.net> Sent: May 17, 2022 12:25 AM To: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu>; Eric Pettersen <pett@cgl.ucsf.edu> Cc: Shubham Devesh Ramgoolam <sdramgoolam@uwaterloo.ca> Subject: Re: [chimerax-users] Removing text labels generated with command distance I made a ChimeraX fix so labels will not cause problems in no gui mode. I put this in the daily builds (and eventually in ChimeraX 1.5), but not in the ChimeraX 1.4 release candidate since we are too close to releasing 1.4 to include it. Tom On May 16, 2022, at 3:49 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: Your script will work in tomorrow's daily build. --Eric On May 14, 2022, at 11:57 PM, Shubham Devesh Ramgoolam via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: Hi, I hope you are doing well. I have a python script, to be executed in nogui mode, which does the following: -open a pdb file -define centroids for specific residues -draw pseudobonds between specific residues -> I am using the command distance for this purpose The issue arises when I have to save the session (.cxs) when in nogui mode, I am getting this error: QGuiApplication::font(): no QGuiApplication instance and no application font set. I believe it is because of the text labels created by the command distance. So, I included the following in my code: run(session, ‘hide #2.*’) and I can now save the session. I noticed in the model panel that the pdb file is assigned to #1 and the pseudobond to #2. The text labels are created as a submodel of the pseudobond (so #2.1, 2.2,..), hence why the ‘hide #2.*’ Will this fix always work? Is the model assignment also dependent on the pdb file being opened? Regards, Shubham Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (4)
-
Elaine Meng
-
Eric Pettersen
-
Shubham Devesh Ramgoolam
-
Tom Goddard