Author: bugman Date: Sun Oct 29 03:42:18 2006 New Revision: 2679 URL: http://svn.gna.org/viewcvs/relax?rev=2679&view=rev Log: The length of the vector representing the unique axis of the spheroid is now proportional to Dpar. To calculate the new vector, the Dpar unit vector is multiplied by the eigenvalue Dpar. It is also multiplied by the scaling factor 'scale'. This scaling factor comes from the prompt interface user function 'pdb.create_tensor_pdb()' which defaults to 1.8e-6. The result is that the correlation times translate to: 3 ns -> 100 Angstrom 10 ns -> 30 Angstrom 30 ns -> 10 Angstrom The docstring of the 'pdb.create_tensor_pdb()' user function has been expanded to include a description of the scaling factor and how the size of the tensor geometric object is larger for smaller objects. Modified: branches/tensor_pdb/generic_fns/pdb.py branches/tensor_pdb/prompt/pdb.py Modified: branches/tensor_pdb/generic_fns/pdb.py URL: http://svn.gna.org/viewcvs/relax/branches/tensor_pdb/generic_fns/pdb.py?rev=2679&r1=2678&r2=2679&view=diff ============================================================================== --- branches/tensor_pdb/generic_fns/pdb.py (original) +++ branches/tensor_pdb/generic_fns/pdb.py Sun Oct 29 03:42:18 2006 @@ -127,11 +127,12 @@ return R - def create_tensor_pdb(self, run=None, file=None, dir=None, force=0): + def create_tensor_pdb(self, run=None, scale=1.8e-6, file=None, dir=None, force=0): """The pdb loading function.""" # Arguments. self.run = run + self.scale = scale self.file = file self.dir = dir self.force = force @@ -189,15 +190,21 @@ # The Dpar unit vector. Dpar_unit = self.relax.data.diff[self.run].Dpar_unit + # The Dpar vector. + Dpar_vect = Dpar_unit * self.relax.data.diff[self.run].Dpar * scale + # Position relative to the center of mass. - pos = R + Dpar_unit + pos = R + Dpar_vect # Add the position as a HETATM. - hetatm.append(R + self.relax.data.diff[self.run].Dpar_unit) + hetatm.append(pos) # Print out. + print " Scaling factor: " + `scale` print " Unit vector: " + `Dpar_unit` + print " Dpar vector (scaled): " + `Dpar_vect` print " Relative to center of mass: " + `pos` + print # Connectivities. Modified: branches/tensor_pdb/prompt/pdb.py URL: http://svn.gna.org/viewcvs/relax/branches/tensor_pdb/prompt/pdb.py?rev=2679&r1=2678&r2=2679&view=diff ============================================================================== --- branches/tensor_pdb/prompt/pdb.py (original) +++ branches/tensor_pdb/prompt/pdb.py Sun Oct 29 03:42:18 2006 @@ -38,7 +38,7 @@ self.__relax__ = relax - def create_tensor_pdb(self, run=None, file='tensor.pdb', dir=None, force=0): + def create_tensor_pdb(self, run=None, scale=1.8e-6, file='tensor.pdb', dir=None, force=0): """Create a PDB file to represent the diffusion tensor. Keyword Arguments @@ -46,6 +46,8 @@ run: The run to assign the structure to. + scale: Value to scale the diffusion rates into Angstroms. + file: The name of the PDB file. dir: The directory where the file is located. @@ -58,15 +60,29 @@ This function creates a PDB file containing artificial structures which represent the diffusion tensor. A structure must have previously been read. The diffusion tensor is - represented by an ellipsoidal, spheroidal, or spherical geometric centered at the center of - mass. This diffusion tensor PDB file can subsequently read into any molecular viewer. - + represented by an ellipsoidal, spheroidal, or spherical geometric object with its origin + located at the center of mass. This diffusion tensor PDB file can subsequently read into + any molecular viewer. + + As the units of the Brownian rotational diffusion tensor is the rate of diffusion measured + in inverse seconds, the size of the tensor geometric object is hence proportional to the + rate and not the correlation times. Hence the larger the geometric object, the faster the + diffusion of a molecule. For example the diffusion tensor of a water molecule is much + larger than the diffusion tensor of a macromolecule. + + The scaling argument can be used to vary the size of the tensor geometric object. The + default value is 1.8e-6. For spherical diffusion with a global correlation time of 10 ns + (this is equivalent to a Diso diffusion rate of 1.66e7 s^-1), the radius of the sphere then + be equal to 30 Angstrom. When the global correlation time is 30 ns, the radius is 10 + Angstrom. If the global correlation time is 3ns, the radius will be 100 Angstrom (hence the + scaling may need to be adjusted). """ # Function intro text. if self.__relax__.interpreter.intro: text = sys.ps3 + "pdb.create_tensor_pdb(" text = text + "run=" + `run` + text = text + ", scale=" + `scale` text = text + ", file=" + `file` text = text + ", dir=" + `dir` text = text + ", force=" + `force` + ")" @@ -76,6 +92,10 @@ if type(run) != str: raise RelaxStrError, ('run', run) + # Scaling. + if type(scale) != float and type(scale) != int: + raise RelaxNumError, ('scaling factor', scale) + # File name. if type(file) != str: raise RelaxStrError, ('file name', file) @@ -89,7 +109,7 @@ raise RelaxBinError, ('force flag', force) # Execute the functional code. - self.__relax__.generic.pdb.create_tensor_pdb(run=run, file=file, dir=dir, force=force) + self.__relax__.generic.pdb.create_tensor_pdb(run=run, scale=scale, file=file, dir=dir, force=force) def read(self, run=None, file=None, dir=None, model=None, load_seq=1):