VMD-L Mailing List
From: Lutz Maibaum (lutz.maibaum_at_gmail.com)
Date: Mon Apr 13 2015 - 19:09:18 CDT
I am having trouble assigning different colors to atoms that have names that start with the same letter. For example, a cholesterol molecule in the Martini force field has "atoms" with names ROH, R1, R2, R3, R4, R5, C1, C2. Here is an example configuration in gromacs (.gro) format:
$ cat 1chol.gro
1CHOL ROH 1 0.543 0.599 4.990
1CHOL R1 2 0.586 0.547 4.750
1CHOL R2 3 0.690 0.752 4.570
1CHOL R3 4 0.528 0.585 4.390
1CHOL R4 5 0.677 0.810 4.300
1CHOL R5 6 0.584 0.555 4.180
1CHOL C1 7 0.541 0.531 3.820
1CHOL C2 8 0.518 0.581 3.400
1.00000 1.00000 6.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
I load this molecule into VMD, set the Drawing Method to "VDW", and leave the Coloring Method as "Name". By default C1 and C2 are shown in cyan, and the other six atoms are shown in pink. The latter is the default color for the "R" entry in the "Name" color category that was created when loading the molecule. It seems that this color is chosen for all atoms whose name start with the letter R.
I would like to choose a different color for, say, the ROH atom. I create a new entry in the "Name" color category:
color add item Name ROH yellow
I can see in the Graphics->Colors dialog that this entry is indeed created. However, the ROH atom is still shown in pink.
My first thought was that when the different coloring rules are tested to see which one matches the ROH atom, the "R" rule matches before the "ROH" rule does, so I tried to reverse their order. Starting vmd, then creating the ROH color, and then loading the molecule puts the "ROH" entry before the "R" entry in the Colors dialog. However, even then the ROH atom is still shown in the color specified in the "R" entry.
Is it possible to specify different colors for, say, the ROH atom vs. all other R* atoms based solely on their name property? If possible I would like to avoid using selections for the various atom names. I am using VMD 1.9.2 on OS X.