htmd.builder.charmm module#
- htmd.builder.charmm.build(mol: Molecule, topo: 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, regenerate: list | None = ['angles', 'dihedrals'], patches: list | str | None = None, noregen: list | None = None, aliasresidues: dict | None = None, psfgen: str | None = None, execute: bool = True, _clean: bool = True) Molecule#
Build a system for CHARMM.
Uses psfgen to build a system for CHARMM. Additionally allows for ionization and adding disulfide bridges.
- Parameters:
mol (
Molecule) – The Molecule object containing the system.topo (list, optional) – A list of topology files (
.rtfor CHARMM.strstream files). Stream files are passed to psfgen’stopologycommand; psfgen parses the RTF portion and ignores thePARAMETERsections. Usecharmm.listFilesto get a list of available topology/stream files. If None, usesdefaultTopo.prefix (str) – The prefix for the generated pdb and psf files.
outdir (str) – The path to the output directory.
caps (dict, optional) – A dictionary with keys as segids and values as lists of strings describing the caps of that segment. e.g.
caps['P'] = ['first ACE', 'last CT3']orcaps['P'] = ['first none', 'last none']. If None, ACE and CT3 caps are applied to proteins and none to the rest.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. Use CHARMM ion atom names (e.g.
'CLA').saltcation (str, optional) – The cation type. Use CHARMM ion atom names (e.g.
'SOD','MG','POT','CES','CAL','ZN2').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.
regenerate (list, optional) – Angle/dihedral regeneration control. Pass
Noneto disable, or a list of'angles'and/or'dihedrals'to enable selectively.patches (list or str, optional) – Additional psfgen patches to apply.
noregen (list, optional) – A list of patch names that must not have angles/dihedrals regenerated. If None, uses
['FHEM', 'PHEM', 'PLOH', 'PLO2', 'PLIG', 'PSUL'].aliasresidues (dict, optional) – A dictionary of
{old_name: new_name}residue name aliases.psfgen (str, optional) – Path to the psfgen executable. If None, located automatically from PATH.
execute (bool) – If True, run the full build. If False, only write the psfgen input script without building. Ionization is skipped when False.
- Returns:
molbuilt – The built system as a Molecule object.
- Return type:
Examples
>>> from htmd.ui import * >>> mol = Molecule("3PTB") >>> mol.filter("not resname BEN") >>> molbuilt = charmm.build(mol, outdir='/tmp/build', ionize=False) Bond between A: [serial 185 resid 42 resname CYS chain A segid 0] B: [serial 298 resid 58 resname CYS chain A segid 0]... >>> # More complex example >>> topos = ['top/top_all36_prot.rtf', './BEN.rtf', 'top/top_water_ions.rtf'] >>> disu = [['segid P and resid 157', 'segid P and resid 13'], ['segid K and resid 1', 'segid K and resid 25']] >>> ar = {'SAPI24': 'SP24'} # Alias large resnames to a short-hand version >>> molbuilt = charmm.build(mol, topo=topos, outdir='/tmp/build', saltconc=0.15, disulfide=disu, aliasresidues=ar)
- htmd.builder.charmm.defaultTopo()#
Returns the default topology/stream files used by charmm.build.
- htmd.builder.charmm.htmdCharmmHome()#
Returns the location of the CHARMM files distributed with HTMD
- htmd.builder.charmm.listFiles()#
Lists all available Charmm topology, parameter and stream files.
charmm.build only consumes topology/stream files, but parameter files are listed too since the user typically needs to copy them (or equivalent stream files) into their simulation directory to run MD afterwards.
Examples
>>> from htmd.builder import charmm >>> charmm.listFiles() ---- Topologies files list...