From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Jul 09 2013 - 13:09:43 CDT

Hi,
  Your script below is making two representations, but the color
method "SecondaryStructure" in your script is not correct,
it should be "Structure". In the GUI, the menu item is named
"SecondaryStructure" but in the text interface it is named "Structure".

If you fix that problem, your script should work much better.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Fri, Jul 05, 2013 at 11:59:18AM -0700, Jorgen Simonsen wrote:
> Hi ,
>
> Thanks it worked like perfectly.
>
> I do have another problem with tcl and it is how to update the graphical
> interface of the system. So I want to color different residues and have
> the cartoon representation colored in a certain way. The problem is that I
> am not able to reset the selection so the last selection seems to set the
> color for the earlier selection:
>
> # Reset the view of the window
> mol delrep 0 all
> # Make dssp representation of protein
> # Numbers at the end are taken from
> mol representation NewCartoon
> # add color
> mol color SecondaryStructure
> # The material used for the representation
> mol material Opaque
> # The selection for all of this
> mol selection {all}
> # Now update the window
> mol addrep top
>
> ## Color part of selection a certain color
> mol representation CPK
> # 0 is blue
> mol material Opaque
> mol selection { residue 30 106 118 and mass 12.011}
> mol color ColorID 23
> mol addrep top
>
> but now everyting get the colorID 23 - I am not sure how to reset the
> selection or if there is an easier way to do it. Thanks
>
> On Fri, Jul 5, 2013 at 11:18 AM, Ajasja LjubetiA:*
> <ajasja.ljubetic_at_gmail.com> wrote:
>
> Just a side not.A
> Creating an atom selection for each frame is bad practise as it is slow
> and causes a memory leak.
> It's much better to create the atom selection before the loop and update
> it to current frame using "$ref frame $frame".
> Regards,
> Ajasja
>
> On 5 July 2013 19:17, JA(c)rA'me HA(c)nin <jerome.henin_at_ibpc.fr> wrote:
>
> Hi,
>
> This could just be incomplete file I/O. Add a line saying "close
> $outfile" at the end to flush the buffer.
>
> Cheers,
> Jerome
>
> ----- Original Message -----
> > Hi,
> >
> > I am trying to make a script that will display the center of mass of
> > a
> > chosen residue in my simulation. I have run into some issues with
> the
> > tcl where I am not familiar with the syntax.
> >
> > My first issues is that I would like to loop over all the frame in
> my
> > simulation
> >
> > set numframes [molinfo 0 get numframes]
> > # Returns 1124 frames which is correct
> > # Loop over frames
> >
> > for {set frame 0} {${frame} < ${numframes}} {incr frame} {
> >
> > set ref [atomselect 0 "resname CFN" frame ${frame}]
> > set com_ref [measure center ${ref} weight mass]
> > puts $outfile "Frame $frame com $com_ref"
> >
> > draw sphere A $com_ref radius 0.5
> >
> > }
> >
> > My problem is that it only outputs 1104 frames and not 1124 as I
> > would
> > expect it to do?
> >
> > Thanks
> >

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/