
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