From: Jorgen Simonsen (jorgen589_at_gmail.com)
Date: Fri Jul 05 2013 - 13:59:18 CDT

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 Ljubetič
<ajasja.ljubetic_at_gmail.com>wrote:

> Just a side not.
> 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, Jérôme Hé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 $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
>> >
>>
>
>