Change atom size and color depending on atomic charge

Hi! I was wondering if it is possible to iteratively change each atom's size and color relative to, let's say, the atomic charge computed by a quantum chemistry package. This is to help the reader understand changes happening between the ground and excited states of the molecules. Cheers!

Hi Henrique! First I'll describe how to use color and size to show values, but not iteratively. If you can format the charge values into a Chimera "attribute assignment file," then you can read it in to assign the values to atoms and use Render by Attribute to map the values to atom size and color. First you would need to open the atomic structure file and figure out how to specify the atoms in the command line, e.g. by residue name and atom name: :HEM@N5 These specifications go into the attribute assignment file. The format is fairly simple as explained here: <https://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/defineattrib/defineattrib.html#attrfile> After you make this file containing your values, when the structure is still open, read the attribute file with Define Attribute (in menu under Tools... Structure Analysis) or "defattr" command: <https://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/defineattrib/defineattrib.html> <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/defattr.html> This will automatically assign the values to the atoms and show the Render by Attribute dialog for showing the values with color and/or size. You can also open Render by Attribute from the menu (under Tools... Structure Analysis). Another way to color by attribute is with the "rangecolor" command. <https://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/render/render.html#render> <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/rangecolor.html> Now if by iteratively you mean that the values are changing and you want to keep changing color and size, that is more difficult. You could make multiple attribute assignment files and then read the first one with "defattr" and color with "rangecolor," then open the next one with "defattr" and color with "rangecolor" again, etc. Or instead of files and "defattr" you can assign or reassign values one by one with the "setattr" command. <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/setattr.html> I believe you would have to explicitly use "rangecolor" or Render by Attribute for each new coloring. For anything fancier or more automatic, some kind of programming (e.g. python script) would be required, but that is beyond my expertise. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 27, 2022, at 5:55 AM, henriquecsj--- via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Hi!
I was wondering if it is possible to iteratively change each atom's size and color relative to, let's say, the atomic charge computed by a quantum chemistry package. This is to help the reader understand changes happening between the ground and excited states of the molecules.
Cheers! _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

On Jan 27, 2022, at 9:44 AM, Elaine Meng via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
I believe you would have to explicitly use "rangecolor" or Render by Attribute for each new coloring. For anything fancier or more automatic, some kind of programming (e.g. python script) would be required, but that is beyond my expertise.
If everything you want to do is available as commands and all you want to do is be able to loop through them, then this "basic primer <https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html>" could be helpful. --Eric Eric Pettersen UCSF Computer Graphics Lab
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
henriquecsj@gmail.com