From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Tue Sep 30 2014 - 14:22:56 CDT

Hi Pawel,

Fundamentally, it comes down to an assumption VMD makes when it comes
down to coloring things by name. In general, the assumption is that we
want to see all atoms of the same element have the same name. For
proteins, which have all their carbons with names like "CA CB CC, etc.",
we see that only the first character matters in letting VMD guess that
its a carbon atom. VMD doesn't let you set these independently if that's
what you want without some trickery (if you use the command "color add
item Name CA green", CA atoms will still be cyan, not green for
instance, because it matches with the C first before encountering CA in
the color list). For you, the same logic means that VMD wants to treat
1, 10, 11, 12, 13, 14 and 15 as one element when you want them to be 7
separate ones. What I do is to rename things so that VMD cannot try and
be clever. For you, that means the following:

$core set name A
$Hchain set name B
$d set name C
$Pt set name D
$cptN set name E
$Cl set name F
$cptH set name G

color Name A magenta
color Name B green
color Name C red
color Name D yellow
color Name E blue
color Name F green
color Name G red

This will do exactly what you want it to, at the cost of you needing to
rename some atoms. This isn't scalable, and I think you are manually
doing what a datastructure with atomnames rather than numbers would do
automatically. Is your input convertable to pdb or something first so
that the atomnames will be more meaningful than just plain numbers and
VMD's guessing will work to your benefit?
-Josh Vermaas

On 09/30/2014 01:08 PM, Paweł Wolski wrote:
> Hi
>
> In VMD -> Graphics -> Colors... -> Categories
> I don't have "10".
> I'm tryinf to run a script. Script look like this:
> /
> mol load lammpstrj k165r1.lammpstrj
>
> color Display Background white
>
> set CNT [atomselect top "name 1"]
> set CA [atomselect top "name 2"]
> set MNP [atomselect top "name 3"]
> set Opeg [atomselect top "name 4"]
> set core [atomselect top "name 11"]
> set Si [atomselect top "name 5"]
> set Cchain [atomselect top "name 6"]
> set OA [atomselect top "name 7"]
> set HA [atomselect top "name 8"]
> set N [atomselect top "name 9"]
> set Hchain [atomselect top "name 10"]
> set d [atomselect top "name 33"]
> set Pt [atomselect top "name 12"]
> set cptN [atomselect top "name 13"]
> set Cl [atomselect top "name 14"]
> set cptH [atomselect top "name 15"]/
>
> /$CNT set radius 0.849917
> $CA set radius 0.849917
> $MNP set radius 50.000000
> $core set radius 50.000000
> $Opeg set radius 0.750000
> $Si set radius 0.750000
> $Pt set radius 0.914750
> $cptN set radius 0.844575
> $Cl set radius 1.156800
> $cptH set radius 0.617838
> $Cchain set radius 0.849917
> $d set radius 5.000000
> $OA set radius 0.739980
> $HA set radius 0.534540
> $N set radius 0.812500
> $Hchain set radius 0.617838/
>
> color Name 8 green
> color Name 10 green
> color Name 1 gray
> color Name 2 gray
> color Name 6 gray
> color Name 4 red
> color Name 7 red
> color Name 5 black
> color Name 12 yellow
> color Name 13 blue
> color Name 14 green
> color Name 15 red
> color Name 9 blue
> color Name 3 yellow
> color Name 33 red
> color Name 11 magenta
>
> when i run it, I get error: Unable to change color name. when I delete
> command with 10,11,12,13 ...
> everything works well
> what is wrong?
>
>
>
> 2014-09-30 18:08 GMT+02:00 Axel Kohlmeyer <akohlmey_at_gmail.com
> <mailto:akohlmey_at_gmail.com>>:
>
> On Tue, Sep 30, 2014 at 10:54 AM, Paweł Wolski
> <pawl.wolski_at_gmail.com <mailto:pawl.wolski_at_gmail.com>> wrote:
> > Hi,
> >
> > I have problem with change atoms colors when it's name have two
> chars, eg:
> > when I use command:
> > color Name 1 gray
> > - everything is ok, by when I use:
> > color Name 10 gray
> > I get error: Unable to change color name.
> > In this structure I have atom's name 10.
> > What I do wrong?
>
> nothing.
>
> however VMD limits how strings are recognized in the Name field for
> most entries to the first character. this has its origin in the custom
> that in PDB files atom names indicate their topological position with
> the second character (CA is alpha carbon, HA hydrogen at alpha carbon,
> CB is beta carbon as so on).
>
> axel.
>
> >
> > Best,
> > Pawel
>
>
>
> --
> Dr. Axel Kohlmeyer akohlmey_at_gmail.com <mailto:akohlmey_at_gmail.com>
> http://goo.gl/1wk0
> College of Science & Technology, Temple University, Philadelphia
> PA, USA
> International Centre for Theoretical Physics, Trieste. Italy.
>
>