I have implemented a user function for creating a PDB representation of the Brownian rotational diffusion tensor. The changes have been made to the 'tensor_pdb' branch of the repository. The user function is called 'pdb.create_tensor_pdb()'. Unfortunately Molmol refuses to recognise PDB CONECT records. The CalcBond function only calculates bonds when two atoms are within a certain distance. The representation in PyMOL is however impressive. If you have diffusion tensor results, I recommend generating the tensor PDB representation and then loading the file into PyMOL together with the structure of the macromolecule. Make sure to read the information in the docstring of the 'pdb.create_tensor_pdb()' user function about what the tensor PDB representation means. To create the tensor representation, I have added a number of algorithms to relax. Firstly the centre of mass is calculated for the selected residues (represented by a C atom). Then the axes of the diffusion are calculated, as unit vectors scaled to the appropriate length, and a C atom placed at the position of this vector plus the centre of mass. Finally a uniform distribution of vectors on a sphere is generated using spherical coordinates. By incrementing the polar angle using an arccos distribution, a radial array of vectors representing latitude are created while incrementing the azimuthal angle evenly creates the longitudinal vectors. These unit vectors, which are distributed within the PDB frame and are of 1 Angstrom in length, are first rotated into the diffusion frame using a rotation matrix (the spherical diffusion tensor is not rotated). Then they are multiplied by the diffusion tensor matrix to extend the vector out to the correct length, and finally scaled by 1.8e-6 so that the vectors reasonably superimpose onto the macromolecular structure. The last set of algorithms place all this information into a PDB file. The distribution of vectors are represented by H atoms and are all connected using PDB CONECT records. Each H atom is connected to its two neighbours on the both the longitude and latitude. This results in a representation with longitudinal and latitudinal lines. Edward P.S. I will probably soon merge all this new code back into the 1.3 line. It appears to be bug free at the moment. On Thu, 2006-10-26 at 13:45 +1000, Edward d'Auvergne wrote:
During discussions with James Horne, James helped with a lot of debugging of relax back in 2004 prior to relax being publicly released, a few ideas were raised about how to represent the diffusion tensor superimposed onto the 3D molecular structure. This representation would significantly help in the comparison of different diffusion tensors. To compare diffusion tensors, you really need to compare the eigenvalues (Dx, Dy, and Dz, or Dpar and Dper). However because the corresponding eigenvectors, the axes of the tensor, may not be the same between two tensors (they could be 90 degrees out), you really need to orient the diffusion tensor with respect to the molecule so that you can compare the correct eigenvalues. I'll send another post with a quick tutorial on diffusion tensors which may help if there were parts of this paragraph which didn't make sense. At minimum you need to have the eigenvector representing the unique axis of the spheroid tensors superimposed onto the structure in 3D, or the three eigenvectors (axes) of the ellipsoid. For the spheroids this could possibly be done by adding two bonded atoms into a PDB file, one at the center of mass, the other placed in the correct orientation at a scaled distance away from the center atom. Then you could use the 'neon' representation for them in Molmol. Extending on the idea, it could be possible to create a picture of the diffusion tensors in Molmol. This would look similar to the contours presented in Tensor. By calculating the center of mass, adding atoms to a PDB file, connecting them, and then using 'neon' or 'line' in Molmol, a polygon representation of the tensor could be created. This, combined with the new model-free analysis protocol encoded in the 'full_analysis.py' sample script, could be the final nail in Tensor's coffin ;) In the new PDB file, which by default could be called 'tensor.pdb', the atoms could all be set to a new residue called 'TNS' (an abbrev. of tensor). The residue could be setup using the HET, HETNAM, and FORMUL records, each atom could be represented by a HETATM record, followed by the TER record, and then all the atoms joined up by CONECT records. The file could be terminated with the MASTER and END records. Would anyone know how to get Molmol 2K to recognise the CONECT records as being bonds??? I might try to implement these ideas into the 1.3 development line. Edward