AW: How to continue RMSD of previous production simulation

From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Sat Dec 03 2016 - 05:45:35 CST

To continue a simulation you need to add would usually add:

 

coordinates previous.restart.coor; #instead of initial pdb

velocities previous.restart.vel

extendedsystem previous.restart.xsc;

 

Also remove “temperature” since we restart with velocities, and the “CellBasisVector” statements since they come from the xsc file.

Also change “outputname” to separate the outputs of your individual runs.

 

If you can do some scripting in Bash f.i. you can write a script doing all that stuff automatically like :

 

#!/bin/bash -l

##################################### NAMD MD Template (Norman Geist 2016) #############################################

 

######################### OPTIONS ####################################

jobname="myjob01"

basedir="/media/work/$USER/${jobname}"

temperature="300"

outputenergies="1000"

outputtiming="1000"

dcdfreq="1000"

restartfreq="100000"

CellX="100"

CellY="100"

CellZ="100"

pmeon="1"

pmegridspacing="1"

GBIS="0"; #increase cutoff,switchdist & pailistdist to 16, 15, 18 & cellXYZ to 0

GBISions="0.2"

GBSA="1"

timestep="2"

fullelectfrequency="4"

stepspercycle="20"

cutoff="10"

switchdist="9"

pairlistdist="12"

rigidbonds="all"

dielectric="1.0"

twoawayx="0"; #might accelerate GPU runs

twoawayy="0"

langevindamping="1.0"

langevinpistontarget="1.01325"

langevinpistondecay="100"

langevinpistonperiod="200"

excludefrompressure="0"

excludefrompressurefile="${jobname}_pressure.pdb"

excludefrompressurecol="B"

fixedatoms="0"

fixedatomsfile="${jobname}_fixed.pdb"

fixedatomscol="B"

extrabonds="0"

extrabondsfile="extrabonds.txt"

#--------------------------------------------------------------------

ensamblenames="min ${temperature}K d ${temperature}K_2 f"

ensamblesteps="1000 250000 250000 250000 50000000"

ensambletypes="MIN NVT NPT NVT NVE"

ensamblerestarts="none o o o o"; #o for finished pre-ensamble; r for unfinished pre-ensample

cd $basedir

######################################################################

 

################### CUSTOM ENSAMBLE TYPE INCLUDES ####################

cat > "NVE.namd" <<END

  #slight temp control for fullElectFrequency being 4

  langevin on

  langevintemp ${temperature}

  langevinDamping 0.01

END

######################################################################

 

################### CUSTOM ENSAMBLE NAME INCLUDES ####################

cat > "d.namd" <<END

  margin 2

END

#######################################################################

 

############################# BINARY OPTIONS #########################

module load openmpi-1.10.0

# module load namd-2.11

module load namd-2.11-cuda

#PRE="taskset -c 0-7"

POST="+ignoresharing"

######################################################################

 

#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

######################################################################

######## DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT U R DOING ##########

######################################################################

#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

############################# Prepearation hacks #####################

Aensamblenames=($ensamblenames)

Aensamblesteps=($ensamblesteps)

Aensambletypes=($ensambletypes)

Aensamblerestarts=($ensamblerestarts)

#####################################################################

 

######################### SCRIPT GEN & EXEC #########################

enameold="false"

estepsold="false"

etypeold="false"

erestartold="false"

for ((i=0; i<${#Aensamblenames[*]}; i++))

do

  ename=${Aensamblenames[$i]}

  esteps=${Aensamblesteps[$i]}

  etype=${Aensambletypes[$i]}

  erestart=${Aensamblerestarts[$i]}

  nexterestart=${Aensamblerestarts[$i+1]}

 

  #not yet done?

  if [[ ! (-a "${jobname}_$ename.coor") && ! ($nexterestart == "r" && -a "${jobname}_$ename.restart.coor") ]]; then

 

cat > ${jobname}_${ename}.namd <<END

####### basic input #######

amber on

parmfile ${jobname}.top

coordinates ${jobname}.pdb

###########################

 

####### restart input #######

if {"${erestart}" == "o"} {

  bincoordinates ${jobname}_${enameold}.coor

  if {"${etypeold}" != "MIN"} {

    binvelocities ${jobname}_${enameold}.vel

  }

  extendedsystem ${jobname}_${enameold}.xsc

} elseif {"${erestart}" == "r"} {

  bincoordinates ${jobname}_${enameold}.restart.coor

  if {"${etypeold}" != "MIN"} {

    binvelocities ${jobname}_${enameold}.restart.vel

  }

  extendedsystem ${jobname}_${enameold}.restart.xsc

} else {

  cellBasisVector1 ${CellX} 0 0

  cellBasisVector2 0 ${CellY} 0

  cellBasisVector3 0 0 ${CellZ}

  cellOrigin 0 0 0

}

############################

 

########### output options ################

outputname ${jobname}_${ename}

binaryoutput yes

binaryrestart yes

outputEnergies ${outputenergies}

outputTiming ${outputtiming}

restartfreq ${restartfreq}

dcdfreq ${dcdfreq}

###########################################

 

########### simulation options ############

# Basic dynamics

exclude scaled1-4

1-4scaling 0.8333

dielectric ${dielectric}

 

# Simulation space partitioning

if {${switchdist} > 0} {

  switching on

  switchdist ${switchdist}

} else {

  switching off

}

 

cutoff ${cutoff}

pairlistdist ${pairlistdist}

rigidbonds ${rigidbonds}

 

# Multiple timestepping

timestep ${timestep}

stepspercycle ${stepspercycle}

fullElectFrequency ${fullelectfrequency}

 

if {${pmeon}} {

  # PME

  pme yes

  pmegridspacing ${pmegridspacing}

}

 

if {${GBIS}} {

  #Implicit Solvent

  GBIS on

  ionConcentration ${GBISions}

  if {${GBSA}} {

    SASA on

  }

}

###########################################

 

############# performance tweaks ##########

if {${twoawayx}} {

  twoawayx yes

}

if {${twoawayy}} {

  twoawayy yes

}

###########################################

 

############# Thermostat ##################

if {"${etype}" == "NVT" || "${etype}" == "NPT"} {

  langevin on

  langevinTemp ${temperature}

  langevinHydrogen on

  langevinDamping ${langevindamping}

}

if {"${etypeold}" == "MIN" || "${erestart}" == "none"} {

  # initial temperature

  temperature ${temperature}

}

###########################################

 

######## Constant Pressure Control ########

if {"${etype}" == "NPT"} {

  LangevinPiston on

  LangevinPistonTarget ${langevinpistontarget}

  LangevinPistonPeriod ${langevinpistonperiod}

  LangevinPistonDecay ${langevinpistondecay}

  LangevinPistonTemp ${temperature}

  if {${excludefrompressure}} {

    ExcludeFromPressure on

    ExcludeFromPressureFile ${excludefrompressurefile}

    ExcludeFromPressureCol ${excludefrompressurecol}

  }

}

###########################################

 

########### Constraints ###################

if {${fixedatoms}} {

  fixedatoms on

  fixedatomsfile ${fixedatomsfile}

  fixedatomscol ${fixedatomscol}

}

###########################################

 

############ Restraints ###################

if {${extrabonds}} {

  extrabonds on

  extrabondsfile ${extrabondsfile}

}

###########################################

 

########## custom includes ###############

if {[file exists ${etype}.namd]} {

  source ${etype}.namd

}

if {[file exists ${ename}.namd]} {

  source ${ename}.namd

}

###########################################

 

################# RUN #####################

if {"${etype}" == "MIN"} {

  minimize ${esteps}

} else {

  run ${esteps}

}

###########################################

END

  mpirun $PRE namd2 $POST +idlepoll ${jobname}_${ename}.namd > ${jobname}_${ename}.out 2> ${jobname}_${ename}.e

fi

  enameold=$ename

  estepsold=$steps

  etypeold=$etype

  erestartold=$erestart

done

#####################################################################

 

 

 

Good luck

 

Norman Geist

 

Von: owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] Im Auftrag von Chitrak Gupta
Gesendet: Freitag, 2. Dezember 2016 19:43
An: NAMD list <namd-l_at_ks.uiuc.edu>; Farhad Jahanfar <jahanfar.f_at_gmail.com>
Betreff: Re: namd-l: How to continue RMSD of previous production simulation

 

Hi Farhad,

 

How are you calculating RMSD? Are you using VMD's RMSD plugin, and are you doing it separately for each trajectory? Note that by default, VMD calculates RMSD with respect to the first frame that you have loaded (as far as I know). So, if you are loading the trajectories separately each time, then the reference frame is changing each time. If you load all your trajectories together then you should see a consistent RMSD.

 

 

Hope this helps.

Chitrak.

 

On Fri, Dec 2, 2016 at 1:21 PM, Farhad Jahanfar <jahanfar.f_at_gmail.com <mailto:jahanfar.f_at_gmail.com> > wrote:

Dear NAMD users

 

I want to run my production simulation in separate runs.

For example, instead of 10 ns simulation i want to run it in 5 simulations in 2 ns.

I know how to use restart files and continuing, but my problem is RMSD of each simulation which does not starts from where the previous run ends, and i couldn't put RMSDs together like there is no stop between runs.

I think it must be common problem for long time simulations like >1000 ns.

Is there any script that could help?

 

Best regards

 

Farhad Jahanfar

 

This archive was generated by hypermail 2.1.6 : Tue Dec 27 2016 - 23:22:41 CST