On 30.10.2008, at 04:39, David M Shechner wrote:
I was wondering if anyone knew of a quick method (say, a publicly-
available
script, or subroutine in a CCP4 program) by which one might
calculate the
Radius of Gyration of a molecule, given its pdb file. Any ideas?
The Python script below will calculate the radius of gyration for the
assembly of all molecules specified in a PDB file (typically the
asymmetric unit). To run it, you need the Molecular Modelling
Toolkit, available from
http://dirac.cnrs-orleans.fr/MMTK/
Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
from MMTK import *
from MMTK.PDB import PDBConfiguration
from MMTK.PDBMoleculeFactory import PDBMoleculeFactory
from Scientific import N
conf = PDBConfiguration('some_molecules.pdb')
factory = PDBMoleculeFactory(conf)
molecules = Collection(factory.retrieveMolecules())
def radiusOfGyration(m):
natoms = m.numberOfAtoms()
center = sum((atom.position() for atom in m.atomList()),
Vector(0., 0., 0.)) / natoms
sum_r = sum(((atom.position()-center).length()**2
for atom in m.atomList()))
return N.sqrt(sum_r/natoms)
print radiusOfGyration(molecules)/Units.Ang, "Angstrom"