From: Paweł Kędzierski (pawel.kedzierski_at_pwr.wroc.pl)
Date: Tue Mar 22 2011 - 08:19:14 CDT

On 22.03.2011 11:00, ban arn wrote:
> Dear All
>
> Thanks for reply.
>
> with help of useful reply, I modified the script to get formatted
> output. While executing this script
>
> set mol [molinfo top]
> set out [open xy_cordinates.txt w]
> set sel [atomselect top "protein and name CA"]
> set frames [molinfo $mol get numframes]
> for {set i 0} {$i < $frames} {incr i} {
> $sel frame $i
> set coords [$sel get {x y}]
This will give you a list of {x y} pairs for all atoms in selection.
You need to loop over all atoms and to get x and y separately (as
advised in another reply) to use the format statement below.
> puts $out [format "%5i %7.3f %7.3f" $i $coords]
> $sel update
> }
> flush $out
> close $out
>
> It shows error as "*expected floating-point number but got
> "{-13.145000457763672 17.072999954223633} {-15.6020"*
> Kindly advice.
>
> Many Thanks
> Balaji
>
>
> 2011/3/22 Paweł Kędzierski <pawel.kedzierski_at_pwr.wroc.pl
> <mailto:pawel.kedzierski_at_pwr.wroc.pl>>:
> > Hi,
> >
> > On 21.03.2011 16:37, ban arn wrote:
> >>
> >> Dear VMD users
> >>
> >> Thanks for reply.
> >>
> >> But would like to do the same (projection of c-aplha atom coordinates
> >> on xy plane) for trajectories.
> >
> > A quick & dirty way would be:
> >
> > set sel [atomselect top "protein and name CA"]
> > set frames [molinfo top get numframes]
> > for {set i 0} {$i< $frames} {incr i} {
> > $sel frame $i
> > $sel set z 0
> > }
> > animate write dcd CA_z_proj.dcd sel $sel
> > animate write xyz CA_z_proj.xyz sel $sel
> >
> > You may get the projection coordinates in any format supported by
> "animate
> > write". XYZ is the simplest text format at hand.
> > However you will be left with modified structure in VMD.
> > HTH,
> > Pawel
> >
>