Re: set center

From: Luis Rosales (ludwig_at_correo.biomedicas.unam.mx)
Date: Tue Jun 21 2005 - 17:33:53 CDT

Hi all,
Swarna,

I think that the easiest way to do this is to center everything on the origin.
Using vmd you can run a tcl script like this one, the idea on this one is
that you calculate the center of a selection and move all atoms to the origin,
centered on the previous selection (the selection colud be all or just part of
the atoms on the molecules, but ALL atoms are translated):

## Takes a selection calculates the center and fit all atoms to that center
## (all atoms are moved, but the fit is based on the selection).
##
## For example: ce_atom top "protein"
##
## -Luis Rosales León
proc ce_atom { molid seltext } {
set all [atomselect $molid all]
set seltext [atomselect $molid $seltext]
$all moveby [vecinvert [measure center $seltext]]
}

Hope this helps,

Ludovico

---------- Original Message -----------
From: Swarna Patra <swarna_at_physics.usyd.edu.au>
To: <namd-l_at_ks.uiuc.edu>
Cc: "Blake Charlebois" <bdc_at_mie.utoronto.ca>
Sent: Fri, 17 Jun 2005 13:53:28 +1000
Subject: namd-l: set center

> Hi Blake,
> thanks for the reply. My question is I have a lipid and a protein. I
> want to put the protein in the middle of lipid. so I want to set the
> center of protein to center of lipid. if u understand it pl let me
> know, how I can do that using tcl. Swarna
------- End of Original Message -------

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:40:52 CST