htmd.builder.amber module#
- htmd.builder.amber.build(mol: Molecule, ff: list | None = None, topo: list | None = None, param: list | None = None, prefix: str = 'structure', outdir: str = './build', caps: dict | None = None, ionize: bool = True, saltconc: float = 0, saltanion: str | None = None, saltcation: str | None = None, disulfide: list | None = None, teleap: str | None = None, teleapimports: list | None = None, execute: bool = True, atomtypes: list | None = None, offlibraries: list | str | None = None, gbsa: bool = False, igb: int = 2, custombonds: list | None = None, remove: list | None = None) Molecule#
Build a system for AMBER.
Uses tleap to build a system for AMBER. Additionally allows for ionization and adding disulfide bridges.
- Parameters:
mol (
Molecule) – The Molecule object containing the system.ff (list, optional) – A list of leaprc forcefield files. Use
amber.listFilesto get a list of available forcefield files. If None, usesamber.defaultFf.topo (list, optional) – A list of topology
prepi/prep/in/ciffiles. CIF and MOL2 files are automatically converted to mol2 format. Useamber.listFilesto get a list of available topology files. If None, usesamber.defaultTopo. When passing residues parameterized with theparameterizetool, pass the .cif file.param (list, optional) – A list of parameter
frcmodfiles. Useamber.listFilesto get a list of available parameter files. If None, usesamber.defaultParam.prefix (str) – The prefix for the generated pdb and prmtop files.
outdir (str) – The path to the output directory.
caps (dict, optional) – A dictionary specifying the caps. Accepts two formats. First format: keys are segids, values are lists of cap strings for that segment. e.g.
caps['P'] = ['ACE', 'NME']orcaps['P'] = ['none', 'none']. If None, ACE and NME caps are applied to every protein segment. Second format: keys are atom selection strings for a residue, values are the cap name. e.g.caps = {"chain A and resid 5": "ACE", "chain A and resid 10": "NME"}.ionize (bool) – Enable or disable ionization.
saltconc (float) – Salt concentration (in Molar) to add to the system after neutralization.
saltanion (str, optional) – The anion type. Available:
'Cl-'. Also accepts'CL','chloride','CLA'.saltcation (str, optional) – The cation type. Available:
'Na+','K+','Cs+','Mg2+','Ca2+','Zn2+'. Also accepts formats such as'NA','sodium','SOD'.disulfide (list, optional) – If None, disulfide bonds are guessed automatically. Otherwise provide a list of pairs of atom selection strings for each pair of residues forming a disulfide bridge.
teleap (str, optional) – Path to the teLeap executable. If None, located automatically from PATH.
teleapimports (list, optional) – A list of directory paths to pass to teLeap via the
-Iflag. If None, determined fromamber.defaultAmberHomeandamber.htmdAmberHome.execute (bool) – If True, run the full build. If False, only write the tleap input script without building. Ionization is skipped when False.
atomtypes (list, optional) – Custom atom types as a list of
('type', 'element', 'hybrid')triplets, e.g.[('C1', 'C', 'sp2'), ('CI', 'C', 'sp3')]. SeeaddAtomTypesin AmberTools docs.offlibraries (list or str, optional) – A path or list of paths to OFF library files. See
loadOFFin AmberTools docs.gbsa (bool) – Modify radii for the GBSA implicit water model.
igb (int) – GB model: 1 for mbondi, 2 and 5 for mbondi2, 7 for bondi, 8 for mbondi3. See section 4 of the AMBER manual on the Generalized Born/Surface Area model.
custombonds (list, optional) – A list of pairs of atom selection strings specifying custom bonds to add.
remove (list, optional) – A list of atom selection strings. Matching atoms or residues are removed from the system. Useful for removing atoms added during building.
- Returns:
molbuilt – The built system as a Molecule object.
- Return type:
Examples
>>> from htmd.ui import * >>> mol = Molecule("3PTB") >>> molbuilt = amber.build(mol, outdir='/tmp/build') >>> # More complex example >>> disu = [['segid P and resid 157', 'segid P and resid 13'], ['segid K and resid 1', 'segid K and resid 25']] >>> molbuilt = amber.build(mol, outdir='/tmp/build', saltconc=0.15, disulfide=disu)
- htmd.builder.amber.defaultAmberHome(teleap: str | None = None) str#
Return the default AMBERHOME directory.
Determined from the location of the teLeap binary, or the tleap_pyodide package directory when running in a pyodide environment.
- htmd.builder.amber.defaultFf()#
Returns the default leaprc forcefield files used by amber.build
- htmd.builder.amber.defaultParam()#
Returns the default parameter frcmod files used by amber.build
- htmd.builder.amber.defaultTopo()#
Returns the default topology prepi files used by amber.build
- htmd.builder.amber.htmdAmberHome()#
Returns the location of the AMBER files distributed with HTMD
- htmd.builder.amber.listFiles()#
Lists all AMBER forcefield files available in HTMD
Example
>>> from htmd.builder import amber >>> amber.listFiles() ---- Forcefield files list: ... ---- leaprc.amberdyes leaprc.conste leaprc.constph leaprc.DNA.bsc1 ...