[BioPython] Bio.PDB centroid

km km at mrna.tn.nic.in
Sat Feb 24 18:58:10 UTC 2007


On Sat, Feb 24, 2007 at 11:04:23AM +0100, Thomas Hamelryck wrote:
> what about:
> 
> centroid=Vector(0,0,0)
> counter=0.0
> for atom in residue:
>    centroid=centroid+atom.get_vector()
>    counter+=1
> centroid=centroid/counter
> 
> This includes all residue atoms - put in a little test to exclude main chain
> atoms if necessary.

well thats gives only  an average of x,y,z coordinates. But i remember that it little more complex than that -
I look at it as a problem of finding the centroid of a polygon which takes into account area of the triangular regions as weightage in the calculation of centroid. I donot know how to approach it in 3 dimensional coordinate  space.

regards,
KM 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Biopython mailing list