Reorient-coordinates

How to Reorient Coordinates of a Molecule

Sometimes it is necessary to reorient the molecule to make its dipole moment or any other vector or certain bond of the molecule parallel to a certain Cartesian coordinate axis. The easiest way to orient a certain vector or bond of a molecule parallel to Cartesian coordinate axis is to use the commands provided by VMD. VMD is available for free download at http://www.ks.uiuc.edu/Research/vmd/.

Orient dipole moment parallel to a certain axis

If you have Gaussian Output file of a molecule and want its dipole moment parallel to a certain axis for example Z-axis.

  • Open output file in Gaussview and note dipole moment vector from results ==> charge distribution window).
  • Create Gaussian input file (.gjf) from the output file.
  • Manually convert .gjf to .xyz file format by creating a new text file and in this new file on the first line write the number of atoms in your molecule. Leave second line blank. Then copy molecule coordinates from gaussian input file and paste in the new text file from 3rd line. Finally save the new file with .xyz file extension.
  • Load the .xyz file into VMD.
  • If the dipole moment vector of the molecule is (-6.5624 -3.2697 -2.1767), enter folowing commands in the VMD console to oreint the dipole moment vector along Z-axis.
  • set sel [atomselect top all]
  • $sel move [transvecinv "-6.5624 -3.2697 -2.1767"]
  • $sel move [transaxis y -90]
  • Now save coordinates in .xyz format.
  • copy coordinates from .xyz file to the gaussian input (.gjf) file and do single point energy calculation with the same orignal level of theory as of the optimized structure with an additional keyword nosymm.
  • From Gaussian output file confirm dipole moment oreintation.

Orient a certain bond parallel to a certain axis

First load molecule’s structure file (such as .pdb, .xyz, .mol2) into VMD. Copy the following code to VMD console and execute.

proc alignbond {ind1 ind2} {
set atm1 [atomselect top "serial $ind1"]
set atm2 [atomselect top "serial $ind2"]
set vecx [expr [$atm2 get x] - [$atm1 get x]]
set vecy [expr [$atm2 get y] - [$atm1 get y]]
set vecz [expr [$atm2 get z] - [$atm1 get z]]
set sel [atomselect top all]
$sel move [transvecinv "$vecx $vecy $vecz"]
}

After executing the above code, if you want to align bond between atom 3 and 5 to be parallel to the X axis then enter the following code

alignbond 3 5

After that,  save the coordinate file. If you want this bond to be parallel to other Cartesian axes, then follow the above method to first make this bond parallel to the X axis and then execute the following code.

set sel [atomselect top all]

$sel move [transaxis z 90]

The coordinates are rotated 90 degrees around the Z axis. Z can be changed to X and Y to rotate around the X and Y axes, respectively.