Difference between revisions of "Loading coordinate files into VMD with the help of an AMBER topology file"

From CUC3
Jump to navigation Jump to search
import>Khs26
import>Khs26
Line 22: Line 22:
   
 
To load a number of GMIN runs (with names from lowest1.pdb to lowestxxx.pdb) then use a script like:
 
To load a number of GMIN runs (with names from lowest1.pdb to lowestxxx.pdb) then use a script like:
#!/bin/bash
+
<pre>#!/bin/bash
 
 
if [ -e lowest1.pdb] # Check that lowest1.pdb exists
+
if [ -e lowest1.pdb] # Check that lowest1.pdb exists
then
+
then
VMD_ARGUMENTS = '-f lowest1.pdb ' # The space at the end is important, since we're concatenating strings later.
+
VMD_ARGUMENTS = '-f lowest1.pdb ' # The space at the end is important, since we're concatenating strings later.
else
+
else
echo "lowest1.pdb is not present, please check that GMIN output files are present."
+
echo "lowest1.pdb is not present, please check that GMIN output files are present."
exit 1
+
exit 1
fi
+
fi
  +
INDEX = 2 # Start index at 2, since 1 has already been added to the argument list.
+
INDEX = 2 # Start index at 2, since 1 has already been added to the argument list.
while [ -e "lowest${INDEX}.pdb" ]
+
while [ -e "lowest${INDEX}.pdb" ]
do
+
do
VMD_ARGUMENTS = "${VMD_ARGUMENTS}-f lowest${INDEX}.pdb "
 
echo "lowest${INDEX}.pdb loaded"
+
VMD_ARGUMENTS = "${VMD_ARGUMENTS}-f lowest${INDEX}.pdb "
  +
echo "lowest${INDEX}.pdb loaded"
((INDEX++))
+
((INDEX++))
done
+
done
   
vmd $VMD_ARGUMENTS
+
vmd $VMD_ARGUMENTS
   
exit 0
+
exit 0
  +
</pre>
   
 
This is much faster than loading it by hand in VMD.
 
This is much faster than loading it by hand in VMD.

Revision as of 11:01, 21 August 2008

There are two useful methods for loading coordinate files into VMD for visualisation, either using the GUI or the command line.

GUI

First an Amber topology file is required to visualise the molecule. It can be found by going to File >> New Molecule and then browsing for the topology file you need. Dependent on the version of VMD, it may recognise .prmtop files as Amber 7 topology files and select the file type accordingly. If not, you must select the Amber 7 topology file type before loading it.

Now you can choose either to load a new topology file (by selecting New Molecule in the Load files for drop-down menu) or into the same molecule as the topology file you just loaded. To load coordinate files, browse for the coordinate file and select it. Then check the file type carefully, the new version of VMD automatically assumes that mdcrd files are not periodic, so if your coordinate file is periodic (e.g. if you are using explicit solvent), you must select the periodic option. Amber restart files and .inpcrd files are of file type Amber 7 restart and are not automatically recognised by VMD, so the file type must be specified.

Once you have loaded a single coordinate file, it is possible to load more coordinate files and they are added on as subsequent frames to the existing molecule. To finish loading coordinate files into the molecule, just close the Molecule File Browser window.

Command line

On the command line it is possible to load all of the files you need using the syntax described on the VMD page. To summarise:

  • -f flag separates molecules (i.e. all files between two -f flags are loaded into the same molecule)
  • -parm7 denotes topology files
  • -rst7 denotes restart or inpcrd files
  • -crd denotes coordinate files (mdcrd)
  • -crdbox denotes periodic coordinate files (mdcrd)

Loading GMIN structures

To load a number of GMIN runs (with names from lowest1.pdb to lowestxxx.pdb) then use a script like:

#!/bin/bash
 
if [ -e lowest1.pdb]                 # Check that lowest1.pdb exists
then
VMD_ARGUMENTS = '-f lowest1.pdb '    # The space at the end is important, since we're concatenating strings later.
else
echo "lowest1.pdb is not present, please check that GMIN output files are present."
exit 1
fi
 
INDEX = 2                            # Start index at 2, since 1 has already been added to the argument list.
while [ -e "lowest${INDEX}.pdb" ]
do
VMD_ARGUMENTS = "${VMD_ARGUMENTS}-f lowest${INDEX}.pdb "
echo "lowest${INDEX}.pdb loaded"
((INDEX++))
done

vmd $VMD_ARGUMENTS

exit 0

This is much faster than loading it by hand in VMD.