User Tools

Site Tools


simulating_hydrocarbon_mixtures

(The files mention below can be found at here instructions_manual.zip )

A) Generating the required files for a molecule (Example: Cyclohexane)

1. Go to http://www.acdlabs.com/home/ and create a free account.
2. Download free version of ChemSketch.
3. Open ChemSketch.
4. Click on “Structure” in upper left corner and draw your molecule.
5. Click on “Structure” in upper left corner, and under “Tools” tab, select “3D Structure Optimization”.
6. Under “File” tab, click “Export…” and save your molecule as a “MDL Molfiles [V3000] (*.mol)” files

  (see example cyclohexane/cyclohexane.mol)

7. Download Open Babel GUI and convert .mol file to .pdb file.

  (see example cyclohexane/cyclohexane1.pdb)

8. Ensure that each atom has a unique name by opening the .pdb file and adding numbers to atom names.

  (see example cyclohexane/cyclohexane2.pdb)

9. Go to https://cgenff.paramchem.org/ and create a free account
10. Upload the .pdb file and obtain a .str file

  (see example cyclohexane/cyclohexane1.str)

11. Change “/scrat” to a four-letter name for your molecule

  (see example cyclohexane/cyclohexane2.str)

12. Use the .str file to create .rtf and .prm files by copying and pasting the appropriate parts

  (see example cyclohexane/cyclohexane.rtf and cyclohexane/cyclohexane.prm)

B) The TIP4P-2005 Water Model

– The water .pdb file was obtained by isolating a water molecule from “TIP45/water box/tip4p-after1ns.pdb”

  (see water/water.pdb)

– The water .rtf file was obtain from “TIP45/water molecule/TIP4P_2005.top”

  (see water/top_tip4p_2005.rtf)

– The water .prm file was obtain from “TIP45/water molecule/par_TIP4P2005.inp”

  (see water/par_tip4p_2005.prm)

C) How to Access Deepthought2 (DT2)

1. Download WinSCP from https://winscp.net/eng/download.php
– WinSCP allows you to upload files to and download files from Deep Thought 1
2. Open WinSCP and log-in using:

  Host name: login.deepthought2.umd.edu 
  Port number: 22 
  User name: universityID             <- this is your university id (not id number) 
  Password: ‘your university password’ 

– Server files will appear on the right side and your local files will appear on the left.
3. Upload “startup.csh” from your machine to the “lustre/home/universityID” folder on the server

  (see startup.csh) 

4. Next, download Putty from http://www.putty.org/
– Putty allows you to access Deep Thought 1 via a console and execute scripts
5. Open Putty and log-in using:

  Host Name: login.deepthought2.umd.edu 
  Port: 22 
  Click “Open” 
  Login as: universityID 
  Password: ‘your university password’

– When you first login, you will be in the “lustre/home/universityID” folder on the server.
6. Type “source startup.csh” to execute the script you previously uploaded
– The previous step must be done every time you login into DT2
– The startup.csh script assigns the location of the 2 programs: Packmol and CHARMM to the environment variables “$packmol” and “$charmm”, respectively. This will ease the execution of future scripts.

  (see startup.csh)

D) Packing a Mixture of Water and Cyclohexane

1. In WinSCP, navigate to “lustre/universityID” on DT2 and create a folder called “packing”
– (to create a folder, look for the icon on the right side of the screen)
2. Transfer “cyclohexane/cyclohexane2.pdb” and “water/water.pdb” to this folder on DT2
3. Transfer the packmol script “packing/packing.inp” to the “packing” folder on DT2
4. The packmol script is explained via comments inside the file.
5. In Putty, navigate to “lustre/universityID/packing”
6. To run packmol and generate a mixture file, type the following into the console:

  dos2unix packing.inp
  chmod 700 packing.inp
  $packmol < packing.inp > packing.out

– This should result in two new files being generated in the “packing” folder on DT2
– (you might need to Refresh to see the new files)
– One of the files will be called “packing.out” which outlines the progress of Packmol as it packs the mixture. The other file will be called “mixture.pdb” which will contain the packed mixture. If the “mixture.pdb” file was not generated, then an error occurred while packing. You will need to read “packing.out” to understand and correct the error.
– Make sure to transfer the newly generated files from the server to your local machine. This can be done in WinSCP by clicking and dragging the files from the server to the “packing” folder on your machine.

7. If you would like to visualize your mixture:
– Go to http://www.ks.uiuc.edu/Research/vmd/ and download the latest version of VMD for your system.
– Open VMD and click “File”, “New molecule”, “Browse” and navigate to and select the “mixture.pdb” file.

E) Generating a .psf file for the mixture

– Now that we have packed the mixture, the next step is to generate a .psf file for the mixture. This .psf file “contains all of the molecule-specific information needed to apply a particular force field to a molecular system”(http://www.ks.uiuc.edu/Training/Tutorials/namd/namd-tutorial-unix-html/node23.html). We will use CHARMM to generate this file.

1. In WinSCP, navigate to “lustre/universityID” on DT2 and create a folder called “generatingPSF”.
2. In WinSCP, drag the following into the “generatingPSF” folder:

  water/top_tip4p_2005.rtf
  water/par_tip4p_2005.prm
  cyclohexane/cyclohexane.rtf
  cyclohexane/cyclohexane.prm              <- not necessary, reason explained in CHARMM script
  packing/mixture.pdb
  generatingPSF/top_all36_cgenff.rtf       <- contains the topology of common molecules
  generatingPSF/par_all36_cgenff.prm       <- contains the interaction parameters for common molecules
  generatingPSF/generatingPSF.inp          <- contains CHARMM script for generating the .psf file

– (these should be the only files in the “generatingPSF” folder before running the CHARMM script)
– (the CHARMM script is explained via comments inside the file)

3. In Putty, navigate to “lustre/universityID/generatingPSF”
4. To run CHARMM on your CHARMM script, type the following into the console:

  dos2unix generatingPSF.inp
  chmod 700 generatingPSF.inp
  $charmm < generatingPSF.inp > generatingPSF.out

– This should result in three new files being generated in the “generatingPSF” folder on DT2:
– (if this is not the case, check the generatingPSF.out file to understand and correct any errors)

  mixture_charmm.pdb         <- coordinates of our mixture generated by CHARMM
  mixture_charmm.psf         <- interaction parameters of our mixture generated by CHARMM
  generatingPSF.out          <- details the progress of CHARMM as it executes the input script

– Even if all three files are generated, this does not mean the CHARMM script executed properly.

5. Perform a visual check of the “mixture_charmm.pdb” file.
– Open “mixture_charmm.pdb” in WordPad and scroll through to the bottom.
– If any of the atoms have “9999.000” for their x,y,z coordinates, then an error has occurred. Check the generatingPSF.out file to understand and correct the error.

– Now we are ready to run a simulation!!!

F) Running a Simulation

– We will use NAMD to run our simulations. You need to provide NAMD with your mixture system (pdb, psf, prm files) along with an input script, that outlines simulation parameters (temperature, pressure, duration, among other things). After you have gathered all the necessary files, you submit these files along with instructions to Slurm. Slurm is the system that will assign you a node on the Deep Thought 1 cluster for your simulation to run. There are two parts to running a simulation. The first part is a short (1 ns) simulation to allow the mixture to reach equilibrium. The second part is an extended simulation where you can observe how your system behaves. The second part is usually done in chunks. For example, first, you simulate your system for 10 ns. After that simulation ends, you use the positions and velocities of the molecules at the end of the simulation to start another simulation for another 10ns, thus extending the simulation for another 10ns, and so on. This is done so that it is easier manage and analyze the output files generated by NAMD. Note: This short (1ns) equilibrium simulation requires a different set of simulation parameters than the extended simulations.

First, let’s run the short (1ns) simulation:

1. In WinSCP, navigate to “lustre/universityID” on DT2 and create a folder called “runningSim”.
2. In this folder, create another folder called “equalize”.
3. In WinSCP, drag the following into the “equalize” folder:

  generatingPSF/par_all36_cgenff.prm
  generatingPSF/par_tip4p_2005.prm
  generatingPSF/mixture_charmm.pdb
  generatingPSF/mixture_charmm.psf
  runningSim/equalize/runningSim.inp                     <- NAMD input script with simulation parameters
  runningSim/equalize/slurmInstructions.csh              <- Instructions for Slurm to run your simulation on DT2

– (these should be the only files in the “equalize” folder before submitting the job to Slurm)
– (See comments inside “runningSim.inp” and “slurmInstructions.csh”)
– (To learn more about NAMD simulation parameters and for a full explanation of “runningSim.inp”, see http://www.ks.uiuc.edu/Research/namd/2.9/ug/node9.html)
– (For a full explanation of “slurmInstructions.csh”, see https://www.glue.umd.edu/hpcc/help/jobs.moab-torque.html)
– (To learn more about Slurm and how to monitor or cancel a job submitted to Slurm, see https://www.glue.umd.edu/hpcc/help/managing.html)

4. In Putty, navigate to “lustre/universityID/runningSim/equalize”
5. To submit your job to Slurm, type the following into the console:

  dos2unix slurmInstructions.csh
  chmod 700 slurmInstructions.csh
  sbatch -A energybio-hi slurmInstructions.csh

– If the job submission is successful, you should see “Submitted batch job ######” in the console.
– To view all jobs that you are running on DT2, type “squeue -u universityID” into the console.

Tracking your simulation:

– The file “runningSim.out” will be generated in the “equalize” folder that will outline the progress of the simulation. After all the files have been read and the simulation has begun, you will start to see estimates of time remaining until the simulation is complete in “runningSim.out”. A few other files will be generated as well. The file that will allow you to watch the progression of your simulation is the .dcd file. Snapshots of your system are taken periodically and added to this dcd file. While the simulation is running, the dcd file should be increasing in size. To view these snapshots, we will use VMD:

6. Transfer “runningSim/equalize/mixture_prod.dcd” from DT2 to your machine
7. Transfer “runningSim/equalize/mixture_charmm.psf” from DT2 to your machine
8. Open VMD
9. Click File > New Molecule… > Browse > navigate to and select “mixture_charmm.psf” > Ok > Load
10. Next, Click Browse > navigate to and select “mixture_prod.dcd” > ok > Load

– Your mixture should appear in the VMD Display window. In the VMD main window, you will see a sliding bar along the bottom. This slide bar lets you navigate to certain snapshots (the snapshots are in chronological order).
– Play around with the controls below this slide bar to understand how they work.
– Once your equilibrium simulation is complete, you can begin to run extended simulations on your mixture.

Running Extended Simulations:

11. In WinSCP, navigate to the “runningSim” folder on DT2 and create a folder called “sim1”.
12. In WinSCP, drag the following into the “sim1” folder:

  runningSim/equalize/mixture_prod.coor
  runningSim/equalize/mixture_prod.vel
  runningSim/equalize/mixture_prod.xsc
  runningSim/equalize/par_all36_cgenff.prm
  runningSim/equalize/par_tip4p_ew.prm
  runningSim/equalize/mixture_charmm.pdb
  runningSim/equalize/mixture_charmm.psf
  runningSim/sim1/slurmInstructions1.csh          <- slightly different for an extended simulation
  runningSim/sim1/runningSim1.inp                 <- Contains NAMD parameters for an extended simulation which differ from parameters for the equilibrium simulation

– (See comments inside “runningSim.inp” and “slurmInstructions.csh”)
– The process for submitting a job is the same:

13. In Putty, navigate to “lustre/universityID/runningSim/sim1”
14. To submit your job to Slurm, type the following into the console:

  dos2unix slurmInstructions1.csh
  chmod 700 slurmInstructions1.csh
  sbatch -A energybio-hi slurmInstructions1.csh

– If the job submission is successful, you should see “Submitted batch job ######” in the console.
– To view all jobs that you are running on DT2, type “squeue -u universityID” into the console.

– Once the first simulation finishes running, you transfer the output the “.coor”,”.vel” and “.xsc” files generated by this simulation to a new folder, along with the other necessary files. You must tweek “runningSim1.inp” and “slurmInstructions1.csh” to account for the different file input and output names and then you run the extended simulation again. I’ve included an example of this process in the “runningSim/sim2” folder. Review the files “runningSim2.inp” and “slurmInstructions2.inp” to see the tweeks that must be made to start this simulation from where the first simulation ended.

If you have any question, feel free to email me at kmanayer(at)yahoo(dot)com

simulating_hydrocarbon_mixtures.txt · Last modified: 2018/05/31 14:13 by admin