MIT
10.637
Lecture 7
Lab 2: Classical MD
hjkulik@mit.edu
9-25-14
MIT
10.637
Lecture 7
Lab 2 overview
water models:
TIP3P, TIP4P, TIP4P-FB, SPC/Fw
equilibration, production, and analysis
MgCl2 solution:
Choose one water model, add ions,
equilibrate, production, and analysis
Ubiquitin WT protein:
Get PDB file, prepare, solvate protein,
equilibrate, production, analysis
Ubiquitin mutant:
Mutate WT protein, solvate, equilibrate,
production, analysis
MIT
10.637
Lecture 7
AMBER nuts and bolts
AMBER dat files + Online repository:
force field files, prepin files, to describe
proteins, nucleotides, water, and ions.
antechamber/RED server:
generates force field and prepin files for
non-standard ligands and residues
tleap: organize and load in force field
properties, solvate, set box dimensions,
neutralize, and generate
topology/coordinate files
sander: run minimizations and molecular
dynamics using topology, coordinates, and
input parameters.
cpptraj/ptraj: process and analyze output
of trajectories.
MIT
10.637
Lecture 7
Using XSEDE
For those who didn’t set up aliases last time:
1) Login to the XSEDE login portal
ssh <xsede username>@login.xsede.org
2) Login to the Maverick machine
gsissh -p 2222 maverick.tacc.xsede.org
Once on Maverick, copy files as needed over from your athena machine:
scp <Athenausername>@athena.dialup.mit.edu:~/<local file name> ./
We’ll want to add a few commands to your bashrc. These are:
export AMBERHOME=/work/02958/hkulik/maverick/shared/amber/
export
LD_LIBRARY_PATH=/work/02958/hkulik/maverick/shared/amber/lib:$LD_LIB
RARY_PATH
export PATH=/work/02958/hkulik/maverick/shared/amber/bin:$PATH
You can add them by editing your ~/.bashrc:
nano ~/.bashrc
Then:
source ~/.bashrc
MIT
10.637
Lecture 7
tleap
Tleap takes commands or an input file.
Example input commands:
source leaprc.ff14SB
mol = loadpdb wat.pdb
check mol
solvatebox mol TIP3PBOX 14.37
savepdb mol tip3pwaterbox.pdb
saveamberparm mol tip3pwater.prmtop tip3pwater.inpcrd
quit
MIT
10.637
Lecture 7
Maverick SLURM queue
• Maverick uses SLURM as a queueing system.
• We write a job script and then submit it to the queueing system to run when
resources are available.
• Example job script:
#!/bin/bash
#SBATCH –J equilibration
#SBATCH –o equil.oe
#SBATCH –N 1
#SBATCH –p gpu
#SBATCH –t 12:00:00
#SBATCH –n 1
. /usr/local/etc/login
module load cuda/6.0
module load intel
#Example run command
./exec < input > output
MIT
10.637
Lecture 7
Maverick SLURM queue
• We issue commands to the SLURM queue to manage our jobs.
• Submit the job script:
sbatch <jobscript>
• Submit a job that depends on another one:
sbatch –d <slurm job #> <jobscript>
• Check the status of all of your jobs
showq –u <xsede username>
• Check the status of everyone’s jobs
showq
• Check specifics of a running or queued job
scontrol show job <slurm job #>
• Cancel a job
scancel <slurm job #>
MIT
10.637
Lecture 7
sander
Minimization example:
unrestrained_min.in:
&cntrl ! Control namelist
imin = 1, ! Minimization is on
maxcyc = 2000, ! Number of cycles to run minimization
ncyc = 2000, ! Number of cycles to run steepest descent
ntb = 1, ! Constant volume PBCs
cut = 9.0, ! Nonbonded cutoff distance in Angstroms-this
is a little small, but our simulation cell is a bit small.
ntxo = 2, ! NetCDF file for coordinates and restart
ioutfm = 1, ! Binary NetCDF trajectory
/
MIT
10.637
Lecture 7
sander
Dynamics example:
constV_equil.in:
&cntrl !Control namelist
nstlim=5000, !Number of dynamics steps
dt=0.002, !Timestep in ps**
ntx=1, !Read in the coordinates without velocities.
irest=0, !We are not restarting the simulation
ntpr=500, !How frequently we print progress
ntwr=5000, !How frequently we write the restart file
ntwx=5000, !How frequently we write the mdcrd file
tempi=100.0, !Initial temperature
temp0=298.15, !Reference target temperature- to compare to
experiment
ntt=3, !Weak coupling thermostat
gamma_ln=1.0, ! Time constant in ps for heat bath coupling.
ig=-1, !Random seed for starting velocities.
ntb=1, ! Constant volume PBCs
ntc=2, ! SHAKE algorithm to constrain bonds with hydrogen**
ntf=2, ! Interactions involving H-atoms omitted**
cut = 9.0, ! Nonbonded cutoff distance in Angstroms
ntxo=2, ! NetCDF file for coordinates and restart
ioutfm=1, ! Binary NetCDF trajectory
/
MIT
10.637
Lecture 7
cpptraj/ptraj
cpptraj processes our trajectory files. It takes an input file, command line
options, or work at the interactive prompt.
To start, we specify a prmtop file:
$AMBERHOME/bin/cpptraj –p <myprmtop>
Example queries:
trajin <mdcrd file>
(can take multiple mdcrd files and will sequentially load them)
trajout mdcrd.pdb pdb
radial myrdf.rdf 0.05 15.0 @O density 0.0033
distance mgcl @MG :2@CL- out mg-cl.dist
go
quit
MIT
10.637
Lecture 7
Working with athena
• Make sure terminal is locked to launcher.
• Pick a text editor to use and get
comfortable– nano for most of you.
• Try some basic linux commands.
MIT
10.637
Lecture 7
Logging into athena
• Locally: here in 14-0637
• Quick stations on campus
• Athena clusters (eg bldg 56)
– At commandline: tellme combo
• Remotely: X11 programs (eg avogadro)
will be very slow over ssh but may be
possible with fast internet at MIT.
– ssh –X <athena
username>@athena.dialup.mit.edu
MIT
10.637
Lecture 7
Commandline tips
ls: lists all visible files in the current directory.
Try: ls -ltrh
to view files with long printing (l), last modified sorting (t),
in reverse (r), and human readable (h) file sizes.
Try: ls .*
to view all hidden files that start with ‘.’ such as .bashrc.
Try: ls */*
to view all files in first layer of subdirectories, etc.
Try: ls */ -d
to view all files that match a wildcard with a directory.
MIT
10.637
Lecture 7
Commandline tips
cd: change directory.
Try: cd ~/
to change directory to home
Try: cd -
to change directory to the previous one.
Try: cd ../
to move up one directory
MIT
10.637
Lecture 7
Commandline tips
mkdir: make a directory.
Try: mkdir -p path/to/directory
to simulatenously make new directory path, with a subdirectory
inside to, with sub-subdirectory inside called ‘directory’
pwd: gets the current working directory.
ln: make a symbolic link for a directory.
Say you have a long source directory like
/usr/local/source/file/compiler/bin/ and want to be able to see its
contents more easily.
Try: ln -s /usr/local/source/file/compiler/bin/ easydir
to make a symbolic link in your existing directory as a
subdirectory called “easydir”.
MIT
10.637
Lecture 7
Commandline tips
cp/mv: copy or move files from one place to another. You may want to copy or
move files around from one place to another. Here are some examples of
copying or moving the old file apples.txt to oranges.txt.
Try: cp -i apples.txt oranges.txt
“i” for interactive means that if oranges.txt already exists, it will ask you if you
want to overwrite.
Try: mv -i apples.txt oranges.txt
“i” for interactive means that if oranges.txt already exists, it will ask you if you
want to overwrite the existing oranges.txt.
Try: mv -f apples.txt oranges.txt
“f” forces the move even if an existing oranges.txt is already there.
Try: cp -p apples.txt oranges.txt
“p” means that permissions and timestamps will be preserved.
Try: cp -r apples/ oranges/
“r” means that you’re recursively copying all the files in a directory. You need to
do this if you’re trying to copy a directory.
MIT
10.637
Lecture 7
Commandline tips
rm: remove a file.
Much like cp and mv, you can remove files (be
careful with this) using a couple different flags.
Try: rm -i apples.txt
to interactively ”i” remove a file (i.e. get a y/n
statement)
Try: rm -v apples.txt
to get a verbose listing of the files removed.
Try: rm -r apples/
to recursively remove an entire directory.
MIT
10.637
Lecture 7
Logging into XSEDE machines
• Best way:
– ssh <xsede portal username>@login.xsede.org
– enter your portal username password
– also, you can add an alias:
• In athena, probably using cshell:
– nano ~/.cshrc.mine
– alias xsede 'ssh <username>@login.xsede.org'
• In bash:
– nano ~/.bashrc
– (on a mac) nano ~/.profile
– alias xsede=‘ssh <username>@login.xsede.org’
– Once at the portal, commands for passwordless login to other machines show up in
MOTD:
• Trestles: gsissh trestles.sdsc.xsede.org
• Maverick: gsissh -p 2222 maverick.tacc.xsede.org
• Alternatives:
– You may be able to login to these machines directly (YMMV)
• ssh <portalusername>@maverick.tacc.xsede.org (likely works)
• ssh <portalusername>@trestles.sdsc.xsede.org (probably doesn’t work)
MIT
10.637
Lecture 7
Aliases
• Useful way to associate long linux commands
with shortcuts
• Forgot which aliases you have set? Type
alias at the commandline
• If you set aliases, you will need to reinitialize
the shell before they’re active. E.g. in bash
type ‘bash’ in cshell type ‘tcsh’ or log out and
log in again.
MIT
10.637
Lecture 7
Copying data
To access data from other machines, use secure copy. You may want to do this
to an open machine such as an athena machine:
Syntax from remote machine to current location:
scp <remote username>@<remote machine>:<remote file loc> <local loc>
Syntax from local machine to remote machine:
scp <local loc> <remote username>@<remote machine>:<remote dir>
You can do this by copying from Maverick/Trestles->Xsede Login->Home
machine
Or you can copy from Maverick/Trestles->Athena.
MIT
10.637
Lecture 7
Summary
• Review on your own, more commandline tips:
– http://hjklol.mit.edu/content/bios-203-useful-
commandline-tools
– Or check for cheat sheet on Stellar.
• Make sure you have set up your xsede
account before you leave today!
• Let’s get started next time with molecular
mechanics!
• Any questions?
MIT
10.637
Lecture 7
OS X
Applications>Utilities>Terminal and add to dock
MIT
10.637
Lecture 7
OS X

Lec7

  • 1.
    MIT 10.637 Lecture 7 Lab 2:Classical MD hjkulik@mit.edu 9-25-14
  • 2.
    MIT 10.637 Lecture 7 Lab 2overview water models: TIP3P, TIP4P, TIP4P-FB, SPC/Fw equilibration, production, and analysis MgCl2 solution: Choose one water model, add ions, equilibrate, production, and analysis Ubiquitin WT protein: Get PDB file, prepare, solvate protein, equilibrate, production, analysis Ubiquitin mutant: Mutate WT protein, solvate, equilibrate, production, analysis
  • 3.
    MIT 10.637 Lecture 7 AMBER nutsand bolts AMBER dat files + Online repository: force field files, prepin files, to describe proteins, nucleotides, water, and ions. antechamber/RED server: generates force field and prepin files for non-standard ligands and residues tleap: organize and load in force field properties, solvate, set box dimensions, neutralize, and generate topology/coordinate files sander: run minimizations and molecular dynamics using topology, coordinates, and input parameters. cpptraj/ptraj: process and analyze output of trajectories.
  • 4.
    MIT 10.637 Lecture 7 Using XSEDE Forthose who didn’t set up aliases last time: 1) Login to the XSEDE login portal ssh <xsede username>@login.xsede.org 2) Login to the Maverick machine gsissh -p 2222 maverick.tacc.xsede.org Once on Maverick, copy files as needed over from your athena machine: scp <Athenausername>@athena.dialup.mit.edu:~/<local file name> ./ We’ll want to add a few commands to your bashrc. These are: export AMBERHOME=/work/02958/hkulik/maverick/shared/amber/ export LD_LIBRARY_PATH=/work/02958/hkulik/maverick/shared/amber/lib:$LD_LIB RARY_PATH export PATH=/work/02958/hkulik/maverick/shared/amber/bin:$PATH You can add them by editing your ~/.bashrc: nano ~/.bashrc Then: source ~/.bashrc
  • 5.
    MIT 10.637 Lecture 7 tleap Tleap takescommands or an input file. Example input commands: source leaprc.ff14SB mol = loadpdb wat.pdb check mol solvatebox mol TIP3PBOX 14.37 savepdb mol tip3pwaterbox.pdb saveamberparm mol tip3pwater.prmtop tip3pwater.inpcrd quit
  • 6.
    MIT 10.637 Lecture 7 Maverick SLURMqueue • Maverick uses SLURM as a queueing system. • We write a job script and then submit it to the queueing system to run when resources are available. • Example job script: #!/bin/bash #SBATCH –J equilibration #SBATCH –o equil.oe #SBATCH –N 1 #SBATCH –p gpu #SBATCH –t 12:00:00 #SBATCH –n 1 . /usr/local/etc/login module load cuda/6.0 module load intel #Example run command ./exec < input > output
  • 7.
    MIT 10.637 Lecture 7 Maverick SLURMqueue • We issue commands to the SLURM queue to manage our jobs. • Submit the job script: sbatch <jobscript> • Submit a job that depends on another one: sbatch –d <slurm job #> <jobscript> • Check the status of all of your jobs showq –u <xsede username> • Check the status of everyone’s jobs showq • Check specifics of a running or queued job scontrol show job <slurm job #> • Cancel a job scancel <slurm job #>
  • 8.
    MIT 10.637 Lecture 7 sander Minimization example: unrestrained_min.in: &cntrl! Control namelist imin = 1, ! Minimization is on maxcyc = 2000, ! Number of cycles to run minimization ncyc = 2000, ! Number of cycles to run steepest descent ntb = 1, ! Constant volume PBCs cut = 9.0, ! Nonbonded cutoff distance in Angstroms-this is a little small, but our simulation cell is a bit small. ntxo = 2, ! NetCDF file for coordinates and restart ioutfm = 1, ! Binary NetCDF trajectory /
  • 9.
    MIT 10.637 Lecture 7 sander Dynamics example: constV_equil.in: &cntrl!Control namelist nstlim=5000, !Number of dynamics steps dt=0.002, !Timestep in ps** ntx=1, !Read in the coordinates without velocities. irest=0, !We are not restarting the simulation ntpr=500, !How frequently we print progress ntwr=5000, !How frequently we write the restart file ntwx=5000, !How frequently we write the mdcrd file tempi=100.0, !Initial temperature temp0=298.15, !Reference target temperature- to compare to experiment ntt=3, !Weak coupling thermostat gamma_ln=1.0, ! Time constant in ps for heat bath coupling. ig=-1, !Random seed for starting velocities. ntb=1, ! Constant volume PBCs ntc=2, ! SHAKE algorithm to constrain bonds with hydrogen** ntf=2, ! Interactions involving H-atoms omitted** cut = 9.0, ! Nonbonded cutoff distance in Angstroms ntxo=2, ! NetCDF file for coordinates and restart ioutfm=1, ! Binary NetCDF trajectory /
  • 10.
    MIT 10.637 Lecture 7 cpptraj/ptraj cpptraj processesour trajectory files. It takes an input file, command line options, or work at the interactive prompt. To start, we specify a prmtop file: $AMBERHOME/bin/cpptraj –p <myprmtop> Example queries: trajin <mdcrd file> (can take multiple mdcrd files and will sequentially load them) trajout mdcrd.pdb pdb radial myrdf.rdf 0.05 15.0 @O density 0.0033 distance mgcl @MG :2@CL- out mg-cl.dist go quit
  • 11.
    MIT 10.637 Lecture 7 Working withathena • Make sure terminal is locked to launcher. • Pick a text editor to use and get comfortable– nano for most of you. • Try some basic linux commands.
  • 12.
    MIT 10.637 Lecture 7 Logging intoathena • Locally: here in 14-0637 • Quick stations on campus • Athena clusters (eg bldg 56) – At commandline: tellme combo • Remotely: X11 programs (eg avogadro) will be very slow over ssh but may be possible with fast internet at MIT. – ssh –X <athena username>@athena.dialup.mit.edu
  • 13.
    MIT 10.637 Lecture 7 Commandline tips ls:lists all visible files in the current directory. Try: ls -ltrh to view files with long printing (l), last modified sorting (t), in reverse (r), and human readable (h) file sizes. Try: ls .* to view all hidden files that start with ‘.’ such as .bashrc. Try: ls */* to view all files in first layer of subdirectories, etc. Try: ls */ -d to view all files that match a wildcard with a directory.
  • 14.
    MIT 10.637 Lecture 7 Commandline tips cd:change directory. Try: cd ~/ to change directory to home Try: cd - to change directory to the previous one. Try: cd ../ to move up one directory
  • 15.
    MIT 10.637 Lecture 7 Commandline tips mkdir:make a directory. Try: mkdir -p path/to/directory to simulatenously make new directory path, with a subdirectory inside to, with sub-subdirectory inside called ‘directory’ pwd: gets the current working directory. ln: make a symbolic link for a directory. Say you have a long source directory like /usr/local/source/file/compiler/bin/ and want to be able to see its contents more easily. Try: ln -s /usr/local/source/file/compiler/bin/ easydir to make a symbolic link in your existing directory as a subdirectory called “easydir”.
  • 16.
    MIT 10.637 Lecture 7 Commandline tips cp/mv:copy or move files from one place to another. You may want to copy or move files around from one place to another. Here are some examples of copying or moving the old file apples.txt to oranges.txt. Try: cp -i apples.txt oranges.txt “i” for interactive means that if oranges.txt already exists, it will ask you if you want to overwrite. Try: mv -i apples.txt oranges.txt “i” for interactive means that if oranges.txt already exists, it will ask you if you want to overwrite the existing oranges.txt. Try: mv -f apples.txt oranges.txt “f” forces the move even if an existing oranges.txt is already there. Try: cp -p apples.txt oranges.txt “p” means that permissions and timestamps will be preserved. Try: cp -r apples/ oranges/ “r” means that you’re recursively copying all the files in a directory. You need to do this if you’re trying to copy a directory.
  • 17.
    MIT 10.637 Lecture 7 Commandline tips rm:remove a file. Much like cp and mv, you can remove files (be careful with this) using a couple different flags. Try: rm -i apples.txt to interactively ”i” remove a file (i.e. get a y/n statement) Try: rm -v apples.txt to get a verbose listing of the files removed. Try: rm -r apples/ to recursively remove an entire directory.
  • 18.
    MIT 10.637 Lecture 7 Logging intoXSEDE machines • Best way: – ssh <xsede portal username>@login.xsede.org – enter your portal username password – also, you can add an alias: • In athena, probably using cshell: – nano ~/.cshrc.mine – alias xsede 'ssh <username>@login.xsede.org' • In bash: – nano ~/.bashrc – (on a mac) nano ~/.profile – alias xsede=‘ssh <username>@login.xsede.org’ – Once at the portal, commands for passwordless login to other machines show up in MOTD: • Trestles: gsissh trestles.sdsc.xsede.org • Maverick: gsissh -p 2222 maverick.tacc.xsede.org • Alternatives: – You may be able to login to these machines directly (YMMV) • ssh <portalusername>@maverick.tacc.xsede.org (likely works) • ssh <portalusername>@trestles.sdsc.xsede.org (probably doesn’t work)
  • 19.
    MIT 10.637 Lecture 7 Aliases • Usefulway to associate long linux commands with shortcuts • Forgot which aliases you have set? Type alias at the commandline • If you set aliases, you will need to reinitialize the shell before they’re active. E.g. in bash type ‘bash’ in cshell type ‘tcsh’ or log out and log in again.
  • 20.
    MIT 10.637 Lecture 7 Copying data Toaccess data from other machines, use secure copy. You may want to do this to an open machine such as an athena machine: Syntax from remote machine to current location: scp <remote username>@<remote machine>:<remote file loc> <local loc> Syntax from local machine to remote machine: scp <local loc> <remote username>@<remote machine>:<remote dir> You can do this by copying from Maverick/Trestles->Xsede Login->Home machine Or you can copy from Maverick/Trestles->Athena.
  • 21.
    MIT 10.637 Lecture 7 Summary • Reviewon your own, more commandline tips: – http://hjklol.mit.edu/content/bios-203-useful- commandline-tools – Or check for cheat sheet on Stellar. • Make sure you have set up your xsede account before you leave today! • Let’s get started next time with molecular mechanics! • Any questions?
  • 22.
  • 23.