updating session with new version of model

Hi there, I have a nice figure saved as a .cxs session file. But I've since had to change the PDB file to refine the model. I think myself and others have asked this in the past, and there isn't a way to substitute one PDB file for another in a ChimeraX session file. Please correct me if I'm wrong. Failing that, I have to recreate the same display style (colors, ribbon vs sticks vs balls, etc) with the new PDB file. What I was thinking of doing is to save a series of files containing attributes' values from the original model (with option ModelId set to false), and then open these files back and read the attribute values into the new model. Things like display, draw_mode, color, ribbon_display, ribbon_color, etc. In principle, do you think this approach should work? One stumbling block: I can't seem to save the display attribute. Specifically, the following command:
save browse format defattr attrName a:display models #1 modelId false
Gives the following output in the log:
One or more attribute values aren't integer, floating-point, string or None (e.g. False); skipping those Saved attribute 'display' of 0 atoms using match mode: 1-to-1 to <filename_redacted>
This is with version 1.6.1 (2023-05-09). I have tried with other attributes (e.g. draw_mode), and they seemed to work. What is the correct way to save the atom display attribute to file? Cheers, Alexis

Hi Alexis, I think mcopy could do some of what you want, although it has the possibly significant limitation that it doesn’t act on surfaces: http://preview.cgl.ucsf.edu/chimerax/docs/user/commands/mcopy.html Cheers Oli
On Aug 28, 2023, at 3:58 PM, Alexis Rohou via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi there,
I have a nice figure saved as a .cxs session file.
But I've since had to change the PDB file to refine the model.
I think myself and others have asked this in the past, and there isn't a way to substitute one PDB file for another in a ChimeraX session file. Please correct me if I'm wrong.
Failing that, I have to recreate the same display style (colors, ribbon vs sticks vs balls, etc) with the new PDB file.
What I was thinking of doing is to save a series of files containing attributes' values from the original model (with option ModelId set to false), and then open these files back and read the attribute values into the new model. Things like display, draw_mode, color, ribbon_display, ribbon_color, etc.
In principle, do you think this approach should work?
One stumbling block: I can't seem to save the display attribute. Specifically, the following command:
save browse format defattr attrName a:display models #1 modelId false
Gives the following output in the log:
One or more attribute values aren't integer, floating-point, string or None (e.g. False); skipping those Saved attribute 'display' of 0 atoms using match mode: 1-to-1 to <filename_redacted>
This is with version 1.6.1 (2023-05-09).
I have tried with other attributes (e.g. draw_mode), and they seemed to work.
What is the correct way to save the atom display attribute to file?
Cheers, Alexis
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Hi Alexis, The "mcopy" command copies display, display styles, and other attributes from one model to another. So I think that would save you a lot of time compared to what you described: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/mcopy.html> I believe you can open your existing session, open the new PDB file, use "mcopy" to copy the settings from the "old" PDB model to the new one, close the old PDB model, and re-save the session. If you wanted the new model to have the same model number that the old one did in the original session, you can use "rename" to change its model number before re-saving the session. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/rename.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 Aug 28, 2023, at 12:58 PM, Alexis Rohou via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi there,
I have a nice figure saved as a .cxs session file.
But I've since had to change the PDB file to refine the model.
I think myself and others have asked this in the past, and there isn't a way to substitute one PDB file for another in a ChimeraX session file. Please correct me if I'm wrong.
Failing that, I have to recreate the same display style (colors, ribbon vs sticks vs balls, etc) with the new PDB file.
What I was thinking of doing is to save a series of files containing attributes' values from the original model (with option ModelId set to false), and then open these files back and read the attribute values into the new model. Things like display, draw_mode, color, ribbon_display, ribbon_color, etc.
In principle, do you think this approach should work?
One stumbling block: I can't seem to save the display attribute. Specifically, the following command: save browse format defattr attrName a:display models #1 modelId false
Gives the following output in the log: One or more attribute values aren't integer, floating-point, string or None (e.g. False); skipping those Saved attribute 'display' of 0 atoms using match mode: 1-to-1 to <filename_redacted>
This is with version 1.6.1 (2023-05-09).
I have tried with other attributes (e.g. draw_mode), and they seemed to work.
What is the correct way to save the atom display attribute to file?
Cheers, Alexis

The mcopy command is in the ChimeraX daily build, and is not in the current ChimeraX 1.6.1 production release since it was added recently. Tom
On Aug 28, 2023, at 1:04 PM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Alexis, The "mcopy" command copies display, display styles, and other attributes from one model to another. So I think that would save you a lot of time compared to what you described: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/mcopy.html>
I believe you can open your existing session, open the new PDB file, use "mcopy" to copy the settings from the "old" PDB model to the new one, close the old PDB model, and re-save the session. If you wanted the new model to have the same model number that the old one did in the original session, you can use "rename" to change its model number before re-saving the session. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/rename.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 Aug 28, 2023, at 12:58 PM, Alexis Rohou via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi there,
I have a nice figure saved as a .cxs session file.
But I've since had to change the PDB file to refine the model.
I think myself and others have asked this in the past, and there isn't a way to substitute one PDB file for another in a ChimeraX session file. Please correct me if I'm wrong.
Failing that, I have to recreate the same display style (colors, ribbon vs sticks vs balls, etc) with the new PDB file.
What I was thinking of doing is to save a series of files containing attributes' values from the original model (with option ModelId set to false), and then open these files back and read the attribute values into the new model. Things like display, draw_mode, color, ribbon_display, ribbon_color, etc.
In principle, do you think this approach should work?
One stumbling block: I can't seem to save the display attribute. Specifically, the following command: save browse format defattr attrName a:display models #1 modelId false
Gives the following output in the log: One or more attribute values aren't integer, floating-point, string or None (e.g. False); skipping those Saved attribute 'display' of 0 atoms using match mode: 1-to-1 to <filename_redacted>
This is with version 1.6.1 (2023-05-09).
I have tried with other attributes (e.g. draw_mode), and they seemed to work.
What is the correct way to save the atom display attribute to file?
Cheers, Alexis
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Thanks all! Looks like I need to install a newer version of ChimeraX. I'll give it a try. Still, curious as to the correct way to save the a:display attribute to file... could come in handy one day... On Mon, Aug 28, 2023 at 1:26 PM Tom Goddard <goddard@sonic.net> wrote:
The mcopy command is in the ChimeraX daily build, and is not in the current ChimeraX 1.6.1 production release since it was added recently.
Tom
On Aug 28, 2023, at 1:04 PM, Elaine Meng via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hi Alexis, The "mcopy" command copies display, display styles, and other attributes from one model to another. So I think that would save you a lot of time compared to what you described: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/mcopy.html>
I believe you can open your existing session, open the new PDB file, use "mcopy" to copy the settings from the "old" PDB model to the new one, close the old PDB model, and re-save the session. If you wanted the new model to have the same model number that the old one did in the original session, you can use "rename" to change its model number before re-saving the session. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/rename.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 Aug 28, 2023, at 12:58 PM, Alexis Rohou via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hi there,
I have a nice figure saved as a .cxs session file.
But I've since had to change the PDB file to refine the model.
I think myself and others have asked this in the past, and there isn't a way to substitute one PDB file for another in a ChimeraX session file. Please correct me if I'm wrong.
Failing that, I have to recreate the same display style (colors, ribbon vs sticks vs balls, etc) with the new PDB file.
What I was thinking of doing is to save a series of files containing attributes' values from the original model (with option ModelId set to false), and then open these files back and read the attribute values into the new model. Things like display, draw_mode, color, ribbon_display, ribbon_color, etc.
In principle, do you think this approach should work?
One stumbling block: I can't seem to save the display attribute. Specifically, the following command: save browse format defattr attrName a:display models #1 modelId false
Gives the following output in the log: One or more attribute values aren't integer, floating-point, string or None (e.g. False); skipping those Saved attribute 'display' of 0 atoms using match mode: 1-to-1 to <filename_redacted>
This is with version 1.6.1 (2023-05-09).
I have tried with other attributes (e.g. draw_mode), and they seemed to work.
What is the correct way to save the atom display attribute to file?
Cheers, Alexis
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Hi Alexis, Saving defattr files wasn’t handling boolean attributes. That’s fixed now and will be in tomorrow’s daily build. Also, if your refined structure has the exact same atoms as the initial structure but with different coordinates, you can copy the conformation of the refined structure into the original with this ChimeraX Recipe <https://rbvi.github.io/chimerax-recipes/copycrds/copycrds.html>. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Aug 28, 2023, at 1:28 PM, Alexis Rohou via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thanks all! Looks like I need to install a newer version of ChimeraX. I'll give it a try.
Still, curious as to the correct way to save the a:display attribute to file... could come in handy one day...
On Mon, Aug 28, 2023 at 1:26 PM Tom Goddard <goddard@sonic.net <mailto:goddard@sonic.net>> wrote:
The mcopy command is in the ChimeraX daily build, and is not in the current ChimeraX 1.6.1 production release since it was added recently.
Tom
On Aug 28, 2023, at 1:04 PM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Hi Alexis, The "mcopy" command copies display, display styles, and other attributes from one model to another. So I think that would save you a lot of time compared to what you described: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/mcopy.html>
I believe you can open your existing session, open the new PDB file, use "mcopy" to copy the settings from the "old" PDB model to the new one, close the old PDB model, and re-save the session. If you wanted the new model to have the same model number that the old one did in the original session, you can use "rename" to change its model number before re-saving the session. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/rename.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 Aug 28, 2023, at 12:58 PM, Alexis Rohou via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Hi there,
I have a nice figure saved as a .cxs session file.
But I've since had to change the PDB file to refine the model.
I think myself and others have asked this in the past, and there isn't a way to substitute one PDB file for another in a ChimeraX session file. Please correct me if I'm wrong.
Failing that, I have to recreate the same display style (colors, ribbon vs sticks vs balls, etc) with the new PDB file.
What I was thinking of doing is to save a series of files containing attributes' values from the original model (with option ModelId set to false), and then open these files back and read the attribute values into the new model. Things like display, draw_mode, color, ribbon_display, ribbon_color, etc.
In principle, do you think this approach should work?
One stumbling block: I can't seem to save the display attribute. Specifically, the following command: save browse format defattr attrName a:display models #1 modelId false
Gives the following output in the log: One or more attribute values aren't integer, floating-point, string or None (e.g. False); skipping those Saved attribute 'display' of 0 atoms using match mode: 1-to-1 to <filename_redacted>
This is with version 1.6.1 (2023-05-09).
I have tried with other attributes (e.g. draw_mode), and they seemed to work.
What is the correct way to save the atom display attribute to file?
Cheers, Alexis
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (5)
-
Alexis Rohou
-
Elaine Meng
-
Eric Pettersen
-
Oliver Clarke
-
Tom Goddard