Re: [PyMOL] distance from plane

2004-07-21 Thread Charlie Bond

Gareth Stockwell wrote:

Hi Kristl,

I'm not sure if PyMOL can do it, but it's not too hard to do a bit of
vector algebra which gives the answer.

Let the coordinates of the nitrogens be A, B, C, D, and the iron atom F.

Compute the centre of your nitrogens:
  X = (A + B + C + D) / 4

Then you work out a normal to the plane of the nitrogens using a cross
product of vectors connecting three of your nitrogens *
  N = (AB x AC)
(NB this gives a vector pointing 'out of the page' if A,B,C,D are
labelled anticlockwise)

Now the distance you want is the projection of the vector XF onto the
normal N.  This is given by

  N . (F - X)
  ---
  |N|

If the atoms are labelled in the order described above, this number will
be +ve if the iron is 'above the page' and -ve if it is below.

Hope that's of some help,
Gareth

* There is no way to define a plane guaranteed to contain all four
nitrogen atoms - the way I described only uses three of them.  If you
want to do this robustly, you should really compute the best-fitting
plane for all four Ns, and return the iron-plane distance along with a
measure of the error of the plane fitting.



moleman2 (Gerard Kleywegt, http://xray.bmc.uu.se/usf/moleman2_man.html) 
has a command (ON LS)  for determining a least squares plane and its 
normal for a set of atoms - not sure about deviations from the plane, 
but once you have the plane and the coordinate you can calculate this as 
described by Gareth.


Cheers,
Charlie

--
Dr Charles S. BondUniversity of Dundee   Tel: +44-1382-348325
Honorary Lecturer   Dow St, Dundee   Fax: +44-1382-345764
BBSRC David Phillips Fellow  DD1 5EH, Scotland  c.s.b...@dundee.ac.uk
School of Life Sciences  http://stein.bioch.dundee.ac.uk/~charlie




Re: [PyMOL] distance from plane

2004-07-20 Thread Gareth Stockwell
Hi Kristl,

I'm not sure if PyMOL can do it, but it's not too hard to do a bit of
vector algebra which gives the answer.

Let the coordinates of the nitrogens be A, B, C, D, and the iron atom F.

Compute the centre of your nitrogens:
  X = (A + B + C + D) / 4

Then you work out a normal to the plane of the nitrogens using a cross
product of vectors connecting three of your nitrogens *
  N = (AB x AC)
(NB this gives a vector pointing 'out of the page' if A,B,C,D are
labelled anticlockwise)

Now the distance you want is the projection of the vector XF onto the
normal N.  This is given by

  N . (F - X)
  ---
  |N|

If the atoms are labelled in the order described above, this number will
be +ve if the iron is 'above the page' and -ve if it is below.

Hope that's of some help,
Gareth

* There is no way to define a plane guaranteed to contain all four
nitrogen atoms - the way I described only uses three of them.  If you
want to do this robustly, you should really compute the best-fitting
plane for all four Ns, and return the iron-plane distance along with a
measure of the error of the plane fitting.



On Tue, 2004-07-20 at 16:39, Kristl Adams wrote:
> Hi Pymolers!
> 
> Is there a way for me to define a plane of atoms say 4 Nitrogens in a heme
> complex and then determine how far out-of-plane the Fe atom is?  If so
> either in Pymol or another program I'd love to know the secret.
> 
> Thanks,
> Kristl
> 
> kri...@physics.purdue.edu


-- 
Gareth Stockwell 
European Bioinformatics Institute




[PyMOL] distance from plane

2004-07-20 Thread Kristl Adams
Hi Pymolers!

Is there a way for me to define a plane of atoms say 4 Nitrogens in a heme
complex and then determine how far out-of-plane the Fe atom is?  If so
either in Pymol or another program I'd love to know the secret.

Thanks,
Kristl

kri...@physics.purdue.edu