ForceBalance API  1.3
Automated optimization of force fields and empirical potentials
Classes | Functions | Variables
src.amberio Namespace Reference

Classes

class  AbInitio_AMBER
 Subclass of Target for force and energy matching using AMBER. More...
 
class  AMBER
 Engine for carrying out general purpose AMBER calculations. More...
 
class  FrcMod_Reader
 Finite state machine for parsing FrcMod force field file. More...
 
class  Interaction_AMBER
 Subclass of Target for calculating and matching ineraction energies using AMBER. More...
 
class  Liquid_AMBER
 Subclass of Target for calculating and matching liquid properties using AMBER. More...
 
class  Mol2_Reader
 Finite state machine for parsing Mol2 force field file. More...
 
class  PrmtopLoader
 Parsed AMBER prmtop file. More...
 
class  Vibration_AMBER
 Subclass of Target for calculating and matching vibrational modes using AMBER. More...
 

Functions

def is_mol2_atom (line)
 
def write_leap (fnm, mol2=[], frcmod=[], pdb=None, prefix='amber', spath=[], delcheck=False)
 Parse and edit an AMBER LEaP input file. More...
 
def splitComment (mystr, debug=False)
 Remove the comment from a line in an AMBER namelist. More...
 
def parse_amber_namelist (fin)
 Parse a file containing an AMBER namelist (only significantly tested for sander input). More...
 
def write_mdin (calctype, fout=None, nsteps=None, timestep=None, nsave=None, pbc=False, temperature=None, pressure=None, mdin_orig=None)
 Write an AMBER .mdin file to carry out a calculation using sander or pmemd.cuda. More...
 

Variables

 logger = getLogger(__name__)
 
float kb_kcal = 0.0019872041
 
dictionary mol2_pdict = {'COUL':{'Atom':[1], 8:''}}
 
dictionary frcmod_pdict
 
string POINTER_LABELS
 
string POINTER_LABEL_LIST = POINTER_LABELS.replace(',', '').split()
 

Function Documentation

◆ is_mol2_atom()

def src.amberio.is_mol2_atom (   line)

Definition at line 59 of file amberio.py.

Here is the call graph for this function:

◆ parse_amber_namelist()

def src.amberio.parse_amber_namelist (   fin)

Parse a file containing an AMBER namelist (only significantly tested for sander input).

Parameters

fin : str Name of file containing the namelist

Returns

comments (list) of lines) List of lines containing comments before first namelist names (list) List of names of each namelist (e.g. cntrl, ewald) block_dicts (list) List of ordered dictionaries containing variable names and values for each namelist suffixes (list) List of list of lines coming after the "slash" for each suffix

Definition at line 206 of file amberio.py.

Here is the call graph for this function:

◆ splitComment()

def src.amberio.splitComment (   mystr,
  debug = False 
)

Remove the comment from a line in an AMBER namelist.

Had to write a separate function because I couldn't get regex to work

Parameters

mystr : str Input string such as: restraintmask='!:WAT,NA&!=', ! Restraint mask for non-water, non-ions

Returns

str Output string with comment removed (but keeping leading and trailing whitespace) such as: restraintmask='!:WAT,NA&!=',

Definition at line 150 of file amberio.py.

◆ write_leap()

def src.amberio.write_leap (   fnm,
  mol2 = [],
  frcmod = [],
  pdb = None,
  prefix = 'amber',
  spath = [],
  delcheck = False 
)

Parse and edit an AMBER LEaP input file.

Output file is written to inputfile_ (with trailing underscore.)

Definition at line 67 of file amberio.py.

Here is the call graph for this function:

◆ write_mdin()

def src.amberio.write_mdin (   calctype,
  fout = None,
  nsteps = None,
  timestep = None,
  nsave = None,
  pbc = False,
  temperature = None,
  pressure = None,
  mdin_orig = None 
)

Write an AMBER .mdin file to carry out a calculation using sander or pmemd.cuda.

Parameters

calctype : str The type of calculation being performed 'min' : minimization 'eq' : equilibration 'md' : (production) MD 'sp' : Single-point calculation

fout : str If provided, file name that the .mdin file should be written to. Each variable within a namelist will occupy one line. Comments within namelist are not written to output.

timestep : float Time step in picoseconds. For minimizations or single-point calculations, this is not needed

nsteps : int How many MD or minimization steps to take For single-point calculations, this is not needed

nsave : int How often to write trajectory and velocity frames (only production MD writes velocities) For single-point calculations, this is not needed

pbc : bool Whether to use periodic boundary conditions

temperature : float If not None, the simulation temperature

pressure : float If not None, the simulation pressure

mdin_orig : str, optional Custom mdin file provided by the user. Non-&cntrl blocks will be written to output. Top-of-file comments will be written to output.

Returns

OrderedDict key : value pairs in the &cntrl namelist, useful for passing to cpptraj or sander/cpptraj Python APIs in the future.

Definition at line 316 of file amberio.py.

Here is the call graph for this function:

Variable Documentation

◆ frcmod_pdict

dictionary src.amberio.frcmod_pdict
Initial value:
1 = {'BONDS': {'Atom':[0], 1:'K', 2:'B'},
2  'ANGLES':{'Atom':[0], 1:'K', 2:'B'},
3  'PDIHS1':{'Atom':[0], 2:'K', 3:'B'},
4  'PDIHS2':{'Atom':[0], 2:'K', 3:'B'},
5  'PDIHS3':{'Atom':[0], 2:'K', 3:'B'},
6  'PDIHS4':{'Atom':[0], 2:'K', 3:'B'},
7  'PDIHS5':{'Atom':[0], 2:'K', 3:'B'},
8  'PDIHS6':{'Atom':[0], 2:'K', 3:'B'},
9  'IDIHS' :{'Atom':[0], 1:'K', 2:'B'},
10  'VDW':{'Atom':[0], 1:'S', 2:'T'}
11  }

Definition at line 47 of file amberio.py.

◆ kb_kcal

float src.amberio.kb_kcal = 0.0019872041

Definition at line 43 of file amberio.py.

◆ logger

src.amberio.logger = getLogger(__name__)

Definition at line 40 of file amberio.py.

◆ mol2_pdict

dictionary src.amberio.mol2_pdict = {'COUL':{'Atom':[1], 8:''}}

Definition at line 45 of file amberio.py.

◆ POINTER_LABEL_LIST

string src.amberio.POINTER_LABEL_LIST = POINTER_LABELS.replace(',', '').split()

Definition at line 672 of file amberio.py.

◆ POINTER_LABELS

string src.amberio.POINTER_LABELS
Initial value:
1 = """
2  NATOM, NTYPES, NBONH, MBONA, NTHETH, MTHETA,
3  NPHIH, MPHIA, NHPARM, NPARM, NEXT, NRES,
4  NBONA, NTHETA, NPHIA, NUMBND, NUMANG, NPTRA,
5  NATYP, NPHB, IFPERT, NBPER, NGPER, NDPER,
6  MBPER, MGPER, MDPER, IFBOX, NMXRS, IFCAP
7 """

Definition at line 663 of file amberio.py.