From: Axel Kohlmeyer (
Date: Thu Aug 09 2012 - 11:12:39 CDT

On Thu, Aug 9, 2012 at 4:55 PM, Jim Kress <> wrote:
> I’ll probably get a RTFM from Axel on this :>} , but I couldn’t figure
> out how to do it so I’ll ask the community.
> I have a pdb trajectory file in which I have created my own unique “residue”
> names (e.g. AAA, AAB, AAC, etc.). I have a variety of the “residue” names
> and I would like to set the display so I can assign specific display
> attributes to each “residue” (e.g. ball and stick to AAA, lines to AAB, vdw
> to AAC, the color red to AAA, blue to AAB, green to AAC, etc.).

> How do I do this with VMD 1.9.1?

similar problems have been discussed
on this mailing list in the past and in principle
it is all described in the user's guide in one way
or another. however, here is a strategy that
should work even for people that only want to
learn a minimal amount of VMD scripting:

load your file
build your various visualizations
save this state to a file and load
it into a text editor.

delete everything from the beginning up to
and including the line starting with "mol new"

and then delete everything until the end starting
from and including the line starting with "mol rename".

save this file to "myviz.vmd"

in principle, you could trim this file down even
more by keeping only:

mol delrep 0 top

and all lines with:

mol representation <...>
mol color <...>
mol selection <...>
mol material <...>
mol addrep top

once you have this. load a new file
and then do "play myviz.vmd"
and you are done.

if you want to automate this even more,
have a look at this hack:


> Thanks.
> Jim

Dr. Axel Kohlmeyer
International Centre for Theoretical Physics, Trieste. Italy.