VMD-L Mailing List
From: Ajasja Ljubetič (ajasja.ljubetic_at_gmail.com)
Date: Fri Jul 05 2013 - 13:18:19 CDT
- Next message: Josh Vermaas: "Re: center of mass"
- Previous message: Jérôme Hénin: "Re: center of mass"
- In reply to: Jérôme Hénin: "Re: center of mass"
- Next in thread: Jorgen Simonsen: "Re: center of mass"
- Reply: Jorgen Simonsen: "Re: center of mass"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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, Jrme Hnin <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
> >
>
- Next message: Josh Vermaas: "Re: center of mass"
- Previous message: Jérôme Hénin: "Re: center of mass"
- In reply to: Jérôme Hénin: "Re: center of mass"
- Next in thread: Jorgen Simonsen: "Re: center of mass"
- Reply: Jorgen Simonsen: "Re: center of mass"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]