Biskit :: AmberParmBuilder :: AmberParmBuilder :: Class AmberParmBuilder
[hide private]
[frames] | no frames]

Class AmberParmBuilder

source code

AmberParmBuilder

Create Amber topology and coordinate file from PDB. Requires the amber programs tleap and ambpdb. Requires leap template files in biskit/external/amber/leap/.


Note: The design of AmberParmBuilder is less than elegant. It would make more sense to split it into two classes that are both derrived from Executor.

Instance Methods [hide private]
  __init__(self, model, leap_template=F_leap_in, leaprc=s.leaprc, leap_out=None, leap_in=None, leap_pdb=None, log=None, debug=0, verbose=0, **kw)
  __runLeap(self, in_script, norun=0, **kw)
Create script file and run Leap.
str parm2pdb(self, f_parm, f_crd, f_out, aatm=0)
Use ambpdb to build PDB from parm and crd.
[(int, int)] __ssBonds(self, model, cutoff=4.)
Identify disulfide bonds.
  __cys2cyx(self, model, ss_residues)
Rename all S-S bonded CYS into CYX.
  capACE(self, model, chain)
Cap N-terminal of given chain.
  capNME(self, model, chain)
Cap C-terminal of given chain.
  centerModel(self, model)
Geometric centar of model.
PDBMod leapModel(self, hetatm=0)
Get a clean PDBModel for input into leap.
  __fLines(self, template, values)
  parmSolvated(self, f_out, f_out_crd=None, f_out_pdb=None, hetatm=0, norun=0, cap=0, capN=[], capC=[], fmod=[], fprep=[], box=10.0, **kw)
[str] __deleteAtoms(self, m, i_atoms)
Delet atoms
[int] __inverseIndices(self, model, i_atoms)
Returns remaining atom indices of m that are NOT in i_atoms
  parmMirror(self, f_out, f_out_crd=None, fmod=[], fprep=[], **kw)
Create a parm7 file whose atom content (and order) exactly mirrors the given PDBModel.

Class Variables [hide private]
  script_mirror_pdb = """ logFile %(leap_out)s source %(leaprc)s %(fmod)s ...
  ss_bond = "bond p.%i.SG p.%i.SG\n"
  F_leap_in = t.projectRoot()+ '/external/amber/leap/solvate_box.l...
  F_ace_cap = t.projectRoot()+ '/external/amber/leap/ace_cap.pdb'
  F_nme_cap = t.projectRoot()+ '/external/amber/leap/nme_cap.pdb'

Method Details [hide private]

__init__(self, model, leap_template=F_leap_in, leaprc=s.leaprc, leap_out=None, leap_in=None, leap_pdb=None, log=None, debug=0, verbose=0, **kw)
(Constructor)

source code 
Parameters:
  • model (PDBModel or str) - model
  • leap_template (str) - path to template file for leap input
  • leaprc (str) - path to parameter file for leap
  • leap_out (str) - target file for leap.log (default: discard)
  • leap_in (str) - target file for leap.in script (default: discard)
  • kw (key=value) - kw=value pairs for additional options in the leap_template

__runLeap(self, in_script, norun=0, **kw)

source code 

Create script file and run Leap.
Parameters:
  • in_script (str) - content of ptraj script with place holders
  • norun (1|0) - 1 - only create leap scrip (default: 0)
  • kw (key=value) - key=value pairs for filling place holders in script
Raises:
  • AmberError - if missing option for leap input file or if could not create leap input file

parm2pdb(self, f_parm, f_crd, f_out, aatm=0)

source code 

Use ambpdb to build PDB from parm and crd.
Parameters:
  • f_parm (str) - existing parm file
  • f_crd (str) - existing crd file
  • f_out (str) - target file name for PDB
Returns: str
f_out, target file name for PDB
Raises:

__ssBonds(self, model, cutoff=4.)

source code 

Identify disulfide bonds.
Parameters:
  • model (PDBModel) - model
  • cutoff (float) - distance cutoff for S-S distance (default: 4.0)
Returns: [(int, int)]
list with numbers of residue pairs forming S-S

__cys2cyx(self, model, ss_residues)

source code 

Rename all S-S bonded CYS into CYX.
Parameters:
  • model (PDBModel) - model
  • ss_residues ([(int, int)]) - original residue numbers of S-S pairs

capACE(self, model, chain)

source code 

Cap N-terminal of given chain.
Parameters:
  • model (PDBMode) - model
  • chain (int) - index of chain to be capped

capNME(self, model, chain)

source code 

Cap C-terminal of given chain.
Parameters:
  • model (PDBMode) - model
  • chain (int) - index of chain to be capped

centerModel(self, model)

source code 

Geometric centar of model.
Parameters:
  • model (PDBMode) - model

leapModel(self, hetatm=0)

source code 

Get a clean PDBModel for input into leap.
Parameters:
  • hetatm (1|0) - keep HETATM records (default: 0)
Returns: PDBMod
model

__fLines(self, template, values)

source code 

parmSolvated(self, f_out, f_out_crd=None, f_out_pdb=None, hetatm=0, norun=0, cap=0, capN=[], capC=[], fmod=[], fprep=[], box=10.0, **kw)

source code 
Parameters:
  • f_out (str) - target file for parm (topology)
  • f_out_crd (str) - target file for crd (coordinates) (default:|f_out_base|.crd)
  • f_out_pdb (str) - target file for pdb (default:|f_out_base|.pdb)
  • hetatm (1|0) - keep hetero atoms (default: 0)
  • cap (1|0) - put ACE and NME capping residue on chain breaks (default: 0)
  • capN ([int]) - indices of chains that should get ACE cap (default: [])
  • capC ([int]) - indices of chains that should get NME cap (default: [])
  • box (float) - minimal distance of solute from box edge (default: 10.0)
  • fmod ([str]) - list of files with amber parameter modifications (to be loaded into leap with loadAmberParams) (default:[])
  • fprep ([str]) - list of files with amber residue definitions (to be loaded into leap with loadAmberPrep) (default: [])
  • kw (key=value) - additional key=value pairs for leap input template
Raises:
  • IOError -

__deleteAtoms(self, m, i_atoms)

source code 

Delet atoms
Parameters:
  • m (PDBMode) - model
  • i_atoms ([int]) - atom index
Returns: [str]
leap statements for deleting given atoms

__inverseIndices(self, model, i_atoms)

source code 
Parameters:
  • model (PDBMode) - model
  • i_atoms ([int]) - atom index
Returns: [int]
remaining atom indices of m that are NOT in i_atoms

parmMirror(self, f_out, f_out_crd=None, fmod=[], fprep=[], **kw)

source code 

Create a parm7 file whose atom content (and order) exactly mirrors the given PDBModel. This requires two leap runs. First we get a temporary topology, then we identify all atoms added by leap and build a final topology where these atoms are deleted. This parm is hence NOT suited for simulations but can be used to parse e.g. a trajectory or PDB into ptraj.
Parameters:
  • f_out (str) - target parm file
  • f_out_crd (str) - target crd file (default: f_out but ending .crd)

Class Variable Details [hide private]

script_mirror_pdb

Value:
"""
    logFile %(leap_out)s
    source %(leaprc)s
    %(fmod)s
    %(fprep)s
    p = loadPdb %(in_pdb)s
    %(delete_atoms)s
    saveAmberParm p %(out_parm)s %(out_crd)s
...                                                                    
      

ss_bond

Value:
"bond p.%i.SG p.%i.SG\n"                                               
      

F_leap_in

Value:
t.projectRoot()+ '/external/amber/leap/solvate_box.leap'               
      

F_ace_cap

Value:
t.projectRoot()+ '/external/amber/leap/ace_cap.pdb'                    
      

F_nme_cap

Value:
t.projectRoot()+ '/external/amber/leap/nme_cap.pdb'