parmed.tools.actions module

All of the prmtop actions used in PARMED. Each class is a separate action.

class parmed.tools.actions.Action(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: object

The base class for all ParmEd actions. The metaclass for Action adds the action and its usage statement to a map that is imported and used by the ParmEd interpreter. So just adding the subclass, wherever it happens, and giving it a ‘usage’ attribute is sufficient to have it added to the interpreter map. There are a number of attributes that can refine the behavior of individual Actions in the interpreter:

Parameters
input_parmStructure
arg_liststr or ArgumentList
Attributes
stderrfile-like, optional

Having a write attribute, this is where errors and warnings will be written. Default is sys.stderr

needs_parmbool, optional

If this Action needs a parm instance to operate on. If your Action either acts on the interpreter or creates a parm, this can be False. Default is True

supported_subclassestuple

A tuple of all types whose subclasses can be acted upon by this Action. This is useful for permissive Action classes

strictly_supportedtuple

This Action can only act on a particular set of class instances. If the parm does not have one of the listed types, it is not supported (subclasses do not count here)

not_supportedtuple

These classes are not supported (supplements supported_subclasses)

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = True
not_supported = ()
overwrite = True
stderr = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>
strictly_supported = ()
supported_subclasses = (<class 'parmed.structure.Structure'>,)
class parmed.tools.actions.HMassRepartition(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This action implements hydrogen mass repartitioning in the system by changing the mass of each hydrogen to the desired value (the default new hydrogen mass is 3.024 daltons) and adjusting the mass of the atom to which it is bonded by the amount required to leave the total mass unchanged. By default, water hydrogen masses are unchanged (the SETTLE algorithm for implementing constraints on water molecules is analytical). Water masses can be repartitioned as well with the ‘dowater’ keyword.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '[<mass>] [dowater]'
class parmed.tools.actions.OpenMM(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This class will read a sander/pmemd input file and run an equivalent simulation using the OpenMM Python API. It uses a topology file that has been defined (and/or modified) here. The command-line flags are identical to those used for sander and pmemd (described in the Amber manual). You can additionally specify a computational platform available through OpenMM such as CUDA, OpenCL, Reference, and CPU.

The default prmtop will be the ‘active’ parm. The prmtop can be changed using either the ‘parm’ keyword or the ‘-p’ flag, but it must resolve to one of the stored topology files. Any parm given with the ‘-p’ flag has precedence. If present, the ‘dcd’ keyword triggers writting DCD-formatted trajectory files instead of NetCDF when ioutfm=1. The DCD trajectory writing offers binary trajectory support without requiring a NetCDF-Python library.

The ‘progress’ keyword triggers printing of ParmEd’s progress in setting up and starting the calculation.

The ‘script’ keyword provides a file to write an OpenMM script that performs the same calculation requested by this ParmEd command. The ‘norun’ command will prevent anything from actually being run and can only be used when a script file is provided.

Methods

execute()

Runs the OpenMM simulation

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Runs the OpenMM simulation

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '[-p <parm>|<parm index>] [sander/pmemd options] [-platform <platform>] [-precision <precision model>] [dcd] [progress] [script <script_file.py>] [norun]'
class parmed.tools.actions.add12_6_4(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Adds the LENNARD_JONES_CCOEF term for the new divalent metal ion 12-6-4 Lennard-Jones potential term. If provided, the mask will allow you to specify which ions are divalent. The C4 parameter between the metal ion and water can either be taken from Ref. [1] for the requested [watermodel] (TIP3P, TIP4PEW, or SPCE) or provided in the file specified by the c4file keyword. The polarizabilities must be present in the the polfile file. The chemical symbol of the element will be used to determine the atom type. Parameters are expected in a file with 2 columns:

<atom type> <parameter>

All defaults come from Ref. [1], [2] and [3]

[1] Pengfei Li and Kenneth M. Merz, J. Chem. Theory Comput., 2014, 10,

289-297

[2] Pengfei Li, Lin F. Song and Kenneth M. Merz, J. Phys. Chem. B, 2015,

119, 883-895

[3] Pengfei Li, Lin F. Song and Kenneth M. Merz, J. Chem. Theory Comput.,

2015, 11, 1645-1657.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '[<divalent ion mask>] [c4file <C4 Param. File> | watermodel <water model>] [polfile <Pol. Param File> [tunfactor <tunfactor>]'
class parmed.tools.actions.addAtomicNumber(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Adds the atomic number of each atom to a new section titled “ATOMIC_NUMBER” in the topology file. Elements are identified by the atomic mass found in the MASS section of the topology files. Elements are matched by picking the element whose average atomic mass in the periodic table is closest to each atom, which should work appropriately for all isotopes of all atoms, except possibly Tritium

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
class parmed.tools.actions.addDihedral(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Adds a dihedral between mask1, mask2, mask3, and mask4. Each mask must specify the same number of atoms, and the dihedral is defined around the bond between atoms in mask 2 and 3. If each mask selects 2 atoms, for instance, a dihedral will be placed around atom1 in mask 1, atom1 in mask 2, atom1 in mask 3, and atom1 in mask 4. A second dihedral will be placed around atom2 in mask 1, atom2 in mask 2, atom2 in mask 3, and atom2 in mask4.

  • <mask1> : Selection of one of the end-atoms for each dihedral

  • <mask2>Selection of the middle atom bonded to <mask1> and

    <mask3> in each dihedral

  • <mask3>Selection of the other middle atom bonded to <mask2>

    and <mask4>

  • <mask4> : Selection of the other end-atom in each dihedral

  • <phi_k> : Force constant in kcal/mol

  • <per> : Periodicity

  • <phase> : Torsion phase shift

  • <scnb> : 1-4 Lennard-Jones scaling constant (default 2.0)

  • <scee> : 1-4 electrostatic scaling constant (default 1.2)

  • <type>Type of dihedral, either “improper” or “normal”.

    Default is “normal”

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<mask1> <mask2> <mask3> <mask4> <phi_k> <per> <phase> [<scee>] [<scnb>] [type <type>]'
class parmed.tools.actions.addExclusions(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Allows you to add arbitrary exclusions to the exclusion list. Every atom in <mask2> is added to the exclusion list for each atom in <mask1> so that non-bonded interactions between those atom pairs will not be computed. NOTE that this ONLY applies to direct-space (short-range) non-bonded potentials. For PME simulations, long-range electrostatics between these atom pairs are still computed (in different unit cells).

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<mask1> <mask2>'
class parmed.tools.actions.addLJType(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Turns given mask into a new LJ atom type. It uses the radius and Rmin from the first atom type in <mask> if new_radius or new_epsilon aren’t provided

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '<mask> [radius <new_radius>] [epsilon <new_epsilon>] [radius_14 <new_radius14>] [epsilon_14 <new_epsilon14>]'
class parmed.tools.actions.addPDB(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Adds PDB information to new flags in an Amber topology file to enable analyses based on the original residue information in the PDB file, <filename>. It adds the flags:

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<filename> [elem] [strict] [allicodes]'
class parmed.tools.actions.cd(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes to a new directory like UNIX ‘cd’

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
usage = '<directory>'
class parmed.tools.actions.chamber(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This action will read CHARMM parameter, topology (RTF), and stream (STR) files and apply those parameters to a structure defined in a CHARMM PSF (protein structure file). XPLOR, CHARMM, and VMD-generated PSF files are all supported. You may specify -top, -param, and -str as many times as you want to provide multiple parameter files. All topology files are read first (in the order they are specified), followed by all parameter files, and finally all stream files are read in. Topology files are only necessary if the parameter files do not define the atom types (newer CHARMM force fields define atom types directly in the parameter file. Environment variables and shell wild-cards (* and ?), as well as the home shortcut character ~ are properly expanded when looking for files.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
usage = '-top <RTF> -param <PAR> [-str <STR>] -psf <PSF> [-crd <CRD>] [-nocmap] [-box a,b,c[,alpha,beta,gamma]|bounding] [-radii <radiusset>] [nosettle]'
class parmed.tools.actions.change(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes the property of given atoms to a new value. <property> can be CHARGE, MASS, RADII, SCREEN, ATOM_NAME, ATOM_TYPE, ATOM_TYPE_INDEX, or ATOMIC_NUMBER (note, changing elements with this command will NOT change their assignment for SHAKE!).

If given, the [quiet] keyword will prevent ParmEd from printing out a summary with every property changed for every atom that was changed useful for suppressing overwhelming output if you are zeroing every charge, for instance)

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<property> <mask> <new_value> [quiet]'
class parmed.tools.actions.changeLJ14Pair(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes a particular 1-4 Lennard Jones pair based on a given (pre-combined) epsilon/Rmin. Only valid for CHAMBER prmtops

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._chamberparm.ChamberParm'>,)
usage = '<mask1> <mask2> <Rmin> <epsilon>'
class parmed.tools.actions.changeLJPair(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes a particular Lennard Jones pair based on a given (pre-combined) epsilon/Rmin

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '<mask1> <mask2> <Rmin> <epsilon>'
class parmed.tools.actions.changeLJSingleType(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Allows you to change the radius/well depth of a single LJ type specified by <mask>. Note, this may change more than the atoms selected in just the mask! To find out what else will be changed, look at the output of printLJTypes.

Use addLJType to change the Lennard-Jones parameters on a set of specific atoms.

  • <mask>The selection of atoms to change the LJ type for. All atoms

    selected must have the same LJ type

  • <radius> : Rmin/2 (van der Waals radius of the new type)

  • <depth> : Well-depth (a.k.a., epsilon)

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '<mask> <radius> <depth>'
class parmed.tools.actions.changeProtState(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes the protonation state of a given titratable residue that can be treated via constant pH MD in Amber.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<mask> <state #>'
class parmed.tools.actions.changeRadii(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes intrinsic GB radii to the specified set: Allowed values are

amber6, bondi, mbondi, mbondi2, mbondi3

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<radii_set>'
class parmed.tools.actions.changeRedoxState(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes the reduction state of a given titratable residue that can be treated via constant redox potential MD in Amber.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<mask> <state #>'
class parmed.tools.actions.checkValidity(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Basic checks for prmtop validity.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

output = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
class parmed.tools.actions.defineSolvent(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Allows you to change what parmed will consider to be “solvent”. <residue list> must be a comma-separated set of residue names with no spaces between them.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<residue_list>'
class parmed.tools.actions.deleteBond(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This action deletes any bonds that occur between the atoms in two masks.

  • <mask1> : Amber mask defining one of the atoms in a bond

  • <mask2> : Amber mask defining the other atom in the bond

  • [verbose]Print out every bond that is deleted as well as the

    number of other valence terms that were eliminated.

All bonds will be matched in which one atom comes from <mask1> and the other atom comes from <mask2>. This action will also delete any other valence term (like angles and dihedrals) that would get severed by the deletion of one of the bonds.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<mask1> <mask2>'
class parmed.tools.actions.deleteDihedral(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Deletes the dihedral around <mask2> and <mask3> in which the end-groups are <mask1> and <mask4>. For multi-term dihedrals, it removes each term.

Methods

execute()

Returns the total number of dihedrals deleted

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Returns the total number of dihedrals deleted

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<mask1> <mask2> <mask3> <mask4>'
class parmed.tools.actions.deletePDB(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This action deletes the flags added by addPDB if they are present.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
class parmed.tools.actions.energy(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This action will compute a single-point energy for the loaded structure (you must use ‘loadRestart’ prior to this command to load coordinates). The following options and keywords are supported:

Examples

# Using AMBER import parmed as pmd parm = pmd.load_file(‘prmtop’, xyz=’rst7’) pmd.tools.energy(parm, ‘igb 8’).execute()

# Using Openmm pmd.tools.energy(parm, ‘igb 5 omm’).execute()

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

output = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
usage = '[cutoff <cut>] [[igb <IGB>] [saltcon <conc>] | [Ewald]] [nodisper] [omm] [applayer] [platform <platform>] [precision <precision model>] [decompose]'
class parmed.tools.actions.gromber(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Load a Gromacs topology file with parameters as an Amber-formatted system. Note, if your Gromacs topology file requires any include topology files, you will need to have Gromacs installed for this to work.

  • <top_file>: The Gromacs topology file to load

  • <coord_file>: The coordinate file to load into the system. Can be any

    recognized format (GRO, PDB, mmCIF, inpcrd, etc.)

  • define <DEFINE[=VAR]>: Preprocessor defines that control the

    processing of the Gromacs topology file.

  • topdir <directory>: The directory containing all Gromacs include

    topology files. This is only necessary if Gromacs is not installed in a location that ParmEd can find.

  • radii <radiusset>: The GB radius set to use. Can be ‘mbondi’, ‘bondi’,

    ‘mbondi2’, or ‘amber6’. Default is mbondi

Gromacs topology files do not store the unit cell information. Therefore, in order to make sure that unit cell information is properly assigned to the resulting system, the provided <coord_file> should contain unit cell information (e.g., GRO, PDB, PDBx/mmCIF, and inpcrd files can all store box information).

ParmEd will try to locate the Gromacs topology directory using either the GMXDATA or GMXBIN environment variables (which should point to the $PREFIX/share/gromacs or $PREFIX/bin directories, respectively, where $PREFIX is the install prefix). If neither is set, the topology directory is located relative to the location of the gmx (Gromacs 5+) or pdb2gmx (Gromacs 4 or older) in the user’s PATH. If none of the above is true, the default installation location (/usr/local/gromacs/share/gromacs/top) is used. Any provided topdir will override default choices (but only for this particular command – future gromber actions will use the default location again).

You can provide as many defines as you wish, and the ordering you specify them is preserved. The default value assigned to each define is “1”. To provide multiple defines, use the define keyword multiple times, for example:

define MYVAR=something define MYVAR2=something_else …

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
usage = '<top_file> [<coord_file>] [define <DEFINE[=VAR]>] [topdir <directory>] [radii <radiusset>]'
class parmed.tools.actions.interpolate(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Interpolates between two topology files (VDW and electrostatic terms only). If [eleconly] is present, only the charges will be interpolated. <nparm> is the number of ‘interpolated’ topology files you want (in addition to the two end-points). The second prmtop must be specified if there are more than 2 parms currently loaded in the ParmEd parm list. startnum has no effect on the generated prmtops, but it can be used to control the names of the outputted topology files.

  • <nparm> : Number of topology files that will be generated

  • <other_parm>The other parm object used in interpolation if more

    than 2 parms are present (first parm is active one)

  • eleconly : Only do charge interpolation

  • <prefix>Generated parm objects will be written as <prefix>.#, where

    # starts from <num> and increases by 1

  • <num> : Starting number for file names (see <prefix> above)

Methods

execute()

Interpolates the prmtops

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Interpolates the prmtops

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '<nparm> [parm2 <other_parm>] [eleconly] [prefix <prefix>] [startnum <num>]'
class parmed.tools.actions.listParms(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Lists all of the loaded topology files

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
class parmed.tools.actions.lmod(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Adjusts Lennard Jones parameters to work with the LMOD code in Amber (changes LJ A coefficients that are 0 to 1000).

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
class parmed.tools.actions.loadCoordinates(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Reads a coordinate file and loads the first set of coordinates found into the active structure. File type is auto-detected. Supported file formats include:

  • Amber restart file

  • Amber NetCDF restart file

  • CHARMM coordinate file

  • CHARMM restart file

  • Amber mdcrd trajectory

  • Amber NetCDF trajectory

  • PDB file

  • PDBx/mmCIF file

  • Gromacs GRO file

  • Mol2 file

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<filename>'
class parmed.tools.actions.loadRestrt(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Loads a restart file so we have coordinates. Necessary for distance-based mask criteria and writeOFF

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<restrt_filename>'
class parmed.tools.actions.ls(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Lists directory contents. Like UNIX ‘ls’

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
usage = '[Unix ls options]'
class parmed.tools.actions.minimize(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This action takes a structure and minimizes the energy using either scipy.optimize.minimize (with BFGS) and the sander API or OpenMM. Following this action, the coordinates stored in the topology will be the minimized structure

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '[cutoff <cut>] [[igb <IGB>] [saltcon <conc>]] [[restrain <mask>] [weight <k>]] [norun] [script <script_file.py>] [platform <platform>] [precision <precision model>] [tol <tolerance>] [maxcyc <cycles>] [omm]'
class parmed.tools.actions.netCharge(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints the total charge of all of the atoms given by the mask. Defaults to all atoms

Methods

execute()

Calculates the charge of all atoms selected in mask

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Calculates the charge of all atoms selected in mask

init(arg_list)[source]

This should be overridden if anything needs to be done

outfile = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
usage = '[<mask>]'
class parmed.tools.actions.outCIF(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Write a PDBx/mmCIF file from the currently active system to <file>

  • <file>: The PDBx/mmCIF file to write

  • [norenumber]: Use the original atom and residue numbering if available

  • [anisou]: Write anisotropic B-factors if available

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<file> [norenumber] [charmm] [anisou]'
class parmed.tools.actions.outPDB(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Write a PDB file from the currently active system to <file>

  • <file>: The PDB file to write

  • [norenumber]: Use the original atom and residue numbering if available

  • [charmm]: Put the SEGID, if available, in columns 72 to 76

  • [anisou]: Write anisotropic B-factors if available

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<file> [norenumber] [charmm] [anisou]'
class parmed.tools.actions.outparm(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.parmout

Prints a new prmtop like parmout, but keeps its place in the action stack so several can be written out in 1 parmed session

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

usage = '<prmtop_name> [<inpcrd_name>] [netcdf]'
class parmed.tools.actions.parm(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Either adds a new parm to the list of available parms to edit in ParmEd, or it sets a new ‘active’ parm to edit by default with new commands

Methods

execute()

Either set the new active parm or add the new parm

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Either set the new active parm or add the new parm

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
usage = '<filename> [<filename> [<filename> ...]] || parm copy <filename>|<index> || parm select <filename>|<index>'
class parmed.tools.actions.parmout(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Final prmtop written after all actions are complete

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<prmtop_name> [<inpcrd_name>] [netcdf]'
class parmed.tools.actions.printAngles(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints all of the angles (with their details) for the given atoms in the mask. If a second mask is given, only atoms whose central atom is in the second mask and another atom is in the first mask is printed. If a third mask is given, the central atom must be in the second mask and the other two atoms must appear in the first and third masks (in any order).

If coordinates and parameter types are present, the value of the angle (in degrees) and its energy (in kcal/mol) are reported for each printed angle.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '[<mask> [<mask> [<mask>] ] ]'
class parmed.tools.actions.printBonds(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints all of the bonds (with their details) for the given atoms in the mask. If a second mask is given, only bonds in which one atom appears in each list will be printed. If coordinates and parameter types are present, also print the actual distance (in Angstroms) and energy (in kcal/mol) for each printed bond.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '[<mask> [<mask>] ]'
class parmed.tools.actions.printDetails(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Returns information about all atoms in a given mask

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<mask>'
class parmed.tools.actions.printDihedrals(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints all of the dihedrals (with their details) for the given atoms in the mask. If multiple masks are given, only dihedrals that have one atom in each mask are printed. Ordering is important here, so the first atom must be in the first mask, the second atom in the second, etc. The order can be precisely reversed, but no other ordering is recognized.

If coordinates and parameter types are present, the value of the torsion angle (in degrees) and the energy of each dihedral (in kcal/mol) are reported for each printed dihedral.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '[<mask> [<mask> [<mask> [<mask>] ] ] ]'
class parmed.tools.actions.printFlags(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints all %FLAGs found in the topology file

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
class parmed.tools.actions.printInfo(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints all prmtop data corresponding to the given %FLAG

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

outfile = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<flag>'
class parmed.tools.actions.printLJMatrix(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

This function prints out how every atom type interacts with the atom type(s) in <mask>. The atom types are printed as all type names that have at least one atom with the Lennard Jones index given in square brackets at the end. Alternatively, you can request a particular atom type index

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '<mask>|<index>'
class parmed.tools.actions.printLJTypes(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints the Lennard Jones type index for the given atom mask or, if no value is given, the LJ type index for each atom.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '[<mask>|<type idx>]'
class parmed.tools.actions.printPointers(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints a list of all the POINTERS and their values

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
class parmed.tools.actions.scale(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Multiplies all values in a particular section of an Amber prmtop by a scalar factor

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<FLAG> <factor>'
class parmed.tools.actions.scee(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Sets the 1-4 EEL scaling factor in the prmtop

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<scee_value>'
class parmed.tools.actions.scnb(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Sets the 1-4 VDW scaling factor in the prmtop

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<scnb_value>'
class parmed.tools.actions.setAngle(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes (or adds a non-existent) angle in the topology file. Each mask must select the same number of atoms, and an angle will be placed between the atoms in mask1, mask2, and mask3 (one angle between atom1 from mask1, atom1 from mask2, and atom1 from mask3, another angle between atom2 from mask1, atom2 from mask2, and atom2 from mask3, etc.)

  • <mask1> : The selection of one of the end-atoms in each angle

  • <mask2> : The selection of central atoms in each angle

  • <mask3> : The selection of other end-atoms in each angle

  • <k>Force constant in kcal/mol/radians^2 in energy expression

    k(THET - THETeq)^2

  • <THETeq> : Equilibrium angle (in degrees)

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<mask1> <mask2> <mask3> <k> <THETeq>'
class parmed.tools.actions.setBond(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Changes (or adds a non-existent) bond in the topology file. Each mask must select the same number of atoms, and a bond will be placed between the atoms in mask1 and mask2 (one bond between atom1 from mask1 and atom1 from mask2 and another bond between atom2 from mask1 and atom2 from mask2, etc.)

  • <mask1> : Selection of first atoms in each bond

  • <mask2> : Selection of second atoms in each bond

  • <k> : Force constant (kcal/mol/A^2) in energy expression k(R-Req)^2

  • <Req> : Equilibrium distance (A)

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

not_supported = (<class 'parmed.amber._tinkerparm.AmoebaParm'>,)
usage = '<mask1> <mask2> <k> <Req>'
class parmed.tools.actions.setMolecules(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Determines the molecularity of the system based on the bonding network and correctly determines the SOLVENT_POINTERS and ATOMS_PER_MOLECULE sections of the topology file. It will consider the ions to be part of the solute if True is passed or not if False is passed. Defaults to True.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

supported_subclasses = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '[solute_ions True|False]'
class parmed.tools.actions.setOverwrite(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Necessary to overwrite original topology file name.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
usage = '[True|False]'
class parmed.tools.actions.source(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Sources a file with a list of parmed commands

Methods

execute()

This is a no-op, since a separate command interpreter for this file is launched inside parmed_cmd.py

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

This is a no-op, since a separate command interpreter for this file is launched inside parmed_cmd.py

init(arg_list)[source]

This should be overridden if anything needs to be done

needs_parm = False
usage = '<file>'
class parmed.tools.actions.strip(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Deletes the atoms specified by <mask> from the topology file and rebuilds the topology file according to the parameters that remain. If nobox is provided, the unit cell information is discarded (useful when stripping solvent to run an aperiodic implicit solvent calculation).

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<mask> [nobox]'
class parmed.tools.actions.summary(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Prints out a summary of prmtop contents

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

init(arg_list)[source]

This should be overridden if anything needs to be done

class parmed.tools.actions.tiMerge(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Merges molecules removing redundant bonding terms. Input amber masks corresponding to molecules 1/2 <mol1mask>/<mol2mask>, and the soft core atoms in each molecule as <scmask1>/<scmask2>. The input topology can be created using leap, with the two molecules to be merged adjacent to each other in residue number. This improves the efficiency for pmemd TI when only part of a molecule is being perturbed.

<scmask1/2N> are for softcore molecules that are not going to be merged. These options will just add these atoms to the timask output, correcting for any changes in atom number.

This can also be used for non-softcore simulations, where <scmask1>/<scmask2> represent the perturbed atoms. The output will give the scmask1/scmask2 flags, which can just be ignored.

<tol> is the tolerence to use when matching coordinates (default 0.01). This is used when the atoms in molecules 1/2 are not in the same order and for checking the input coordinates.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

output = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>, <class 'parmed.amber._chamberparm.ChamberParm'>)
usage = '<mol1mask> <mol2mask> <scmask1> <scmask2> [<scmask1N>] [<scmask2N>] [tol <tol>]'
class parmed.tools.actions.writeCoordinates(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Writes the coordinates of the active structure to a coordinate file. The format of the file is detected from filename extension, with the following extensions being recognized:

  • .nc: Amber NetCDF trajectory with a single frame

  • .ncrst: Amber NetCDF restart file

  • .pdb: PDB file

  • .cif: PDBx/mmCIF file

  • .rst7, .restrt, .inpcrd: Amber restart file

  • .mdcrd: Amber mdcrd file

  • .mol2: Sybyl Mol2 file

  • Default is Amber restart file

Alternatively, the following keywords can be used to override the filename extension:

  • netcdftraj: Amber NetCDF trajectory with a single frame

  • netcdf: Amber NetCDF restart file

  • pdb: PDB file

  • cif: PDBx/mmCIF file

  • restart: Amber restart/inpcrd file

  • mdcrd: Amber mdcrd file

  • mol2: Sybyl mol2 file

Note, NetCDF files require scipy or netCDF4 to be installed.

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

usage = '<filename> [netcdftraj | netcdf | pdb | cif | restart | mdcrd | mol2]'
class parmed.tools.actions.writeFrcmod(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Writes an frcmod file from all of the parameters in the topology file.

Methods

execute()

Writes the frcmod file

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Writes the frcmod file

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<frcmod_name>'
class parmed.tools.actions.writeOFF(input_parm, arg_list=None, *args, **kwargs)[source]

Bases: parmed.tools.actions.Action

Writes an Amber OFF Library with all of the residues found in the topology

Methods

execute()

Commands involved in executing the action

init(arg_list)

This should be overridden if anything needs to be done

execute()[source]

Commands involved in executing the action

init(arg_list)[source]

This should be overridden if anything needs to be done

strictly_supported = (<class 'parmed.amber._amberparm.AmberParm'>,)
usage = '<OFF_filename>'