From: Axel Kohlmeyer (axel.kohlmeyer_at_theochem.ruhr-uni-bochum.de)
Date: Fri Oct 29 2004 - 08:26:48 CDT

On Fri, 29 Oct 2004, Peter Bazeley wrote:

peter,

PB> Hi
PB>
PB> I just subscribed, so not sure if this email will make it through.

it did.

PB>
PB> I have a couple questions:
PB>
PB> 1. Is there a way I can set the drawing method from a script, say, to Tube?

yes, provided you also load the molecules from the script.
to reset the default is more tricky.

PB> 2. Second, I'm having trouble controling the colors in my script.
PB> Here's my code:
PB>
PB> #Name: colorfixed.tcl
PB> #Purpose: color fixed CA atoms according to cutoff angstrom range
PB> #Usage: colorfixed
PB> #
PB>
PB> proc colorfixed {} {
PB>
PB> foreach pdb [lsort [glob *.pdb]] {
PB>
PB> mol load pdb $pdb
PB>
PB> set sel [atomselect top "all"]
PB> set ca_2 [atomselect top "<181 residues>"]
PB> set ca_15 [atomselect top "resid 9 or resid 47 or ...<115 residues>"]

you can save some typing here by using:
{resid 9 47 ...} to select multiple residues instead of
explicite 'or's.

PB>

PB> $sel set beta 9 #set to white
PB> $ca_2 set beta 8 #set to green
PB> $ca_15 set beta 2 #set to red

                         ^^^^
tcl syntax requires you to have a ';' here before the comment.
this is the main problem. but you can

PB>
PB> }
PB> mol modcolor 0 0 "Beta"
PB> mol modcolor 1 0 "Beta"
PB> mol modcolor 2 0 "Beta"
PB> }
PB>
PB> #run the program
PB> colorfixed

your further problems are a combination of
little things, that are all explained in
somewhere in the manual, but difficult to spot.

please adapt the selections and try out
the attached script which will also create
the requested tube visualization.

let us know, if this is helpful.

axel.

p.s.: i have put a large chunk of these kind of 'hacks' at
<http://www.theochem.rub.de/go/cpmd-vmd.html>

PB>
PB> #END
PB>
PB> I'd basically like to color the two atom selections green and red, and
PB> the rest of the molecule white, but at the moment I get the one of my
PB> selections in red and the rest of the molecule blue.

PB>
PB> Any tips?
PB>
PB> Thanks.
PB>
PB>
PB> Peter Bazeley
PB>
PB>

-- 
=======================================================================
Dr. Axel Kohlmeyer   e-mail: axel.kohlmeyer_at_theochem.ruhr-uni-bochum.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum  http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.