BFEE2.templates_namd

BFEE2.templates_namd.configTemplate

class BFEE2.templates_namd.configTemplate.configTemplate[source]

Bases: object

generate NAMD/Gromacs/Colvars config files In the Colvars config file, ndx and xyz files are used to indicate the group of atoms The non-hydrogen atoms of protein are labeled as ‘protein’ in complex.ndx The non-hydrogen atoms of ligand are labeled as ‘ligand’ in complex.ndx The non-hydrogen atoms of user-defined reference are labeled as ‘reference’ in complex.ndx

cvABFTemplate(cv)[source]

template for WTM-eABF bias

Parameters

cv (str) – name of the colvars

Returns

string of the WTM-eABF definition

Return type

str

cvEulerAngleTemplate(setBoundary, lowerBoundary, upperBoundary, angle, refFile)[source]

Euler angle template

Parameters
  • setBoundary (bool) – whether set boundary (for free-energy calculation)

  • lowerBoundary (float) – lower boundary of free-energy calculaton

  • upperboundary (float) – upper boundary of free-energy calculation

  • angle (str) – ‘eulerTheta’, ‘eulerPhi’ of ‘eulerPsi’

  • refFile (str) – path to the reference file

Returns

string of Euler angle definition

Return type

string

cvHarmonicTemplate(cv, constant, center, tiWindows=0, tiForward=True, targetForceConstant=0)[source]

template for a harmonic restraint

Parameters
  • cv (str) – name of the colvars

  • constant (float) – force constant of the restraint

  • center (float) – center of the restraint

  • tiWindows (int) – number of windows of the TI simulation (if runs a TI simulation). Defaults to 0.

  • tiForward (bool, optional) – whether the TI simulation is forward (if runs a TI simulation). Defaults to True.

  • targetForceConstant (int, optional) – targeted force constant of the restraint in TI simulation (if runs a TI simulation). Defaults to 0.

Returns

string of the harmonic restraint definition

Return type

str

cvHarmonicWallsTemplate(cv, lowerWall, upperWall)[source]

template of harmonic wall bias

Parameters
  • cv (str) – name of the colvars

  • lowerWall (float) – lower wall of the bias

  • upperWall (float) – upper wall of the bias

Returns

string of the harmonic wall bias definition

Return type

str

cvHeadTemplate(indexFile)[source]

return the head of colvars file

Parameters

indexFile (str) – name of ndx file

Returns

head of colvars file

Return type

str

cvPolarAngleTemplate(setBoundary, lowerBoundary, upperBoundary, angle, refFile)[source]

Polar angle template

Parameters
  • setBoundary (bool) – whether set boundary (for free-energy calculation)

  • lowerBoundary (float) – lower boundary of free-energy calculaton

  • upperboundary (float) – upper boundary of free-energy calculation

  • angle (str) – ‘polarTheta’ or ‘polarPhi’

  • refFile (str) – path to the reference file

Returns

string of polar angle definition

Return type

str

cvProteinTemplate(centerCoor, refFile)[source]

the template of restraining the protein

Parameters
  • centerCoor (np.array, 3) – (x,y,z), center of the protein

  • refFile (str) – path of the reference file

Returns

string of the restraining the protein

Return type

str

cvRMSDTemplate(setBoundary, lowerBoundary, upperBoundary, refFile)[source]

RMSD CV template

Parameters
  • setBoundary (bool) – whether set boundary (for free-energy calculation)

  • lowerBoundary (float) – lower boundary of free-energy calculaton

  • upperboundary (float) – upper boundary of free-energy calculation

  • refFile (str) – path to the reference file

Returns

string of RMSD definition

Return type

str

cvRTemplate(setBoundary, lowerBoundary, upperBoundary)[source]

r distance template

Parameters
  • setBoundary (bool) – whether set boundary (for free-energy calculation)

  • lowerBoundary (float) – lower boundary of free-energy calculaton

  • upperboundary (float) – upper boundary of free-energy

Returns

string of distance r definition

Return type

str

namdConfigTemplate(forceFieldType, forceFieldFiles, topFile, coorFile, NAMDRestartCoor, NAMDRestartVel, NAMDRestartXsc, PBCCondition, outputPrefix, temperature, numSteps, cvFile='', cvDefinitionFile='', CVRestartFile='', fepFile='', fepWindowNum=20, fepForward=True, fepDoubleWide=False, fepMinBeforeSample=False, membraneProtein=False)[source]

the namd config file template

Parameters
  • forceFieldType (str) – ‘charmm’ or ‘amber’

  • forceFieldFiles (list of str) – name of charmm force field files

  • topFile (str) – name of the topology file (psf, parm)

  • coorFile (str) – name of the coordinate file (pdb, rst)

  • NAMDRestartCoor (str) – name of namd binary restart coor file (if restart from a previous simulation)

  • NAMDRestartVel (str) – name of namd binary restart vel file

  • NAMDRestartXsc (str) – name of namd restart xsc file

  • PBCCondition (np.array, 2*3) – PBC vector, ((lengthX, lengthY, lengthZ),(centerX, centerY, centerZ))

  • outputPrefix (str) – prefix of output file

  • temperature (float) – temperature of the simulation

  • numSteps (int) – number of steps of the simulation

  • cvFile (str) – name of Colvars file. Defaults to ‘’.

  • cvDefinitionFile (str, optional) – name of a TCL file defining new CVs. Defaults to ‘’.

  • CVRestartFile (str, optional) – name of Colvars restart file. Defaults to ‘’.

  • fepFile (str, optional) – name of fep file, indicating which atoms will be generated/removed (if run alchemical simulation). Defaults to ‘’.

  • fepWindowNum (int, optional) – number of fep windows. Defaults to 20.

  • fepForward (bool, optional) – whether this is a forward fep simulation. Defaults to True.

  • fepDoubleWide (bool, optional) – whether this is a double-wide fep simulation. Defaults to False.

  • fepMinBeforeSample (bool, optional) – whether do minimization before sampling in each FEP window. Defaults to False.

  • membraneProtein (bool, optional) – whether simulating a membrame protein. Defaults to False.

Returns

a NAMD config string if succeed, and empty string otherwise

Return type

str

BFEE2.templates_namd.scriptTemplate