parmed.amber.ChamberParm

class parmed.amber.ChamberParm(prm_name=None, xyz=None, box=None, rst7_name=None)[source]

Chamber Topology (parm7 format) class.

Gives low, and some high, level access to topology data or interact with some of the high-level classes comprising the system topology and parameters. The ChamberParm class uses the same attributes that the AmberParm class uses, and only the ones unique to ChamberParm will be shown below.

Parameters
prm_namestr, optional

If provided, this file is parsed and the data structures will be loaded from the data in this file

xyzstr or array, optional

If provided, the coordinates and unit cell dimensions from the provided Amber inpcrd/restart file will be loaded into the molecule, or the coordinates will be loaded from the coordinate array

boxarray, optional

If provided, the unit cell information will be set from the provided unit cell dimensions (a, b, c, alpha, beta, and gamma, respectively)

See also

AmberParm
Attributes
LJ_14_radiuslist(float)

The same as LJ_radius, except specific for 1-4 nonbonded parameters, which may differ in the CHARMM force field

LJ_14_depthlist(float)

The same as LJ_depth, except specific for 1-4 nonbonded parameters, which may differ in the CHARMM force field

urey_bradleysTrackedList(UreyBradley)

List of Urey-Bradley terms between two atoms in a valence angle

impropersTrackedList(Improper)

List of CHARMM-style improper torsions

cmapsTrackedList(Cmap)

List of coupled-torsion correction map parameters

urey_bradley_typesTrackedList(UreyBradleyType)

List of parameters defining the Urey-Bradley terms

improper_typesTrackedList(Improper)

List of parameters defining the Improper terms

cmap_typesTrackedList(CmapType)

List of parameters defining the CMAP terms

chamberbool=True

Whether this instance uses the CHARMM force field

amoebabool=False

Whether this instance uses the Amoeba force field

has_cmapbool

Whether this instance has correction map terms or not

Methods

add_atom(atom, resname, resnum[, chain, …])

Adds a new atom to the Structure, adding a new residue to residues if it has a different name or number as the last residue added and adding it to the atoms list.

add_atom_to_residue(atom, residue)

Adds a new atom to the Structure at the end if the given residue

add_flag(flag_name, flag_format[, data, …])

Adds a new flag with the given flag name and Fortran format string and initializes the array with the values given, or as an array of 0s of length num_items

assign_bonds(*reslibs)

Assigns bonds to all atoms based on the provided residue template libraries.

copy(cls[, split_dihedrals])

Makes a copy of the current structure as an instance of a specified subclass

createSystem([nonbondedMethod, …])

Construct an OpenMM System representing the topology described by the prmtop file.

delete_flag(flag_name)

Removes a flag from the topology file

fill_LJ()

Fills the LJ_radius, LJ_depth arrays and LJ_types dictionary with data from LENNARD_JONES_ACOEF and LENNARD_JONES_BCOEF sections of the prmtop files, by undoing the canonical combining rules.

from_rawdata(rawdata)

Take the raw data from a AmberFormat object and initialize an AmberParm from that data.

from_structure(struct[, copy])

Take a Structure instance and initialize a ChamberParm instance from that data.

get_box([frame])

In some cases, multiple conformations may be stored in the Structure.

get_coordinates([frame])

In some cases, multiple conformations may be stored in the Structure.

has_1012()

This routine determines whether there are any defined 10-12 Lennard-Jones interactions that are non-zero

has_NBFIX()

This routine determines whether there are any off-diagonal Lennard-Jones modifications (i.e., if any two atoms have a L-J pair interaction that does not match the combined L-J parameters for that pair).

id_format(filename)

Identifies the file type as either Amber-format file (like prmtop) or an old-style topology file.

initialize_topology([xyz, box])

Initializes topology data structures, like the list of atoms, bonds, etc., after the topology file has been read.

is_changed()

Determines if any of the topological arrays have changed since the last upload

join_dihedrals()

Joins multi-term torsions into a single term and makes all of the parameters DihedralTypeList instances.

load_atom_info()

Loads atom properties into the atoms that have been loaded.

load_dataframe(df)

Loads atomic properties from an input DataFrame

load_pointers()

Loads the data in POINTERS section into a pointers dictionary with each key being the pointer name according to http://ambermd.org/formats.html

load_rst7(rst7)

Loads coordinates into the AmberParm class

load_structure()

Loads all of the topology instance variables.

omm_add_constraints(system, constraints, …)

Adds constraints to a given system

omm_angle_force([constraints, …])

Creates an OpenMM HarmonicAngleForce object (or AmoebaAngleForce if the angles are for an Amoeba-parametrized system)

omm_bond_force([constraints, rigidWater, …])

Creates an OpenMM Bond Force object (or AmoebaBondForce if the bonds are for an Amoeba-parametrized system)

omm_cmap_force()

Creates the OpenMM CMAP torsion force

omm_dihedral_force([split])

Creates the OpenMM PeriodicTorsionForce modeling dihedrals

omm_gbsa_force(implicitSolvent[, …])

Creates a Generalized Born force for running implicit solvent calculations

omm_improper_force()

Creates the OpenMM improper torsion force (quadratic bias)

omm_nonbonded_force([nonbondedMethod, …])

Creates the OpenMM NonbondedForce (and CustomNonbondedForce if necessary) to define the nonbonded interatomic potential for this system.

omm_out_of_plane_bend_force()

Creates the Amoeba out-of-plane bend force

omm_pi_torsion_force()

Creates the Amoeba pi-torsion force

omm_rb_torsion_force()

Creates the OpenMM RBTorsionForce for Ryckaert-Bellemans torsions

omm_set_virtual_sites(system)

Sets the virtual sites in a given OpenMM System object from the extra points defined in this system

omm_stretch_bend_force()

Create the OpenMM Amoeba stretch-bend force for this system

omm_torsion_torsion_force()

Create the OpenMM Amoeba coupled-torsion (CMAP) force

omm_trigonal_angle_force()

Creates the Amoeba trigonal-angle force

omm_urey_bradley_force()

Creates the OpenMM Urey-Bradley force

parse(filename, *args, **kwargs)

Meant for use with the automatic file loader, this will automatically return a subclass of AmberFormat corresponding to what the information in the prmtop file contains (i.e., either an AmberParm, ChamberParm, AmoebaParm, or AmberFormat)

prune_empty_terms()

Looks through all of the topological lists and gets rid of terms in which at least one of the atoms is None or has an idx attribute set to -1 (indicating that it has been removed from the atoms atom list)

ptr(pointer)

Returns the value of the given pointer, and converts to upper-case so it’s case-insensitive.

rdparm(fname[, slow])

Parses the Amber format file

rdparm_old(prmtop_lines[, check])

This reads an old-style topology file and stores the results in the same data structures as a new-style topology file

rdparm_slow(fname)

Parses the Amber format file.

recalculate_LJ()

Takes the values of the LJ_radius and LJ_depth arrays and recalculates the LENNARD_JONES_A/BCOEF topology sections from the canonical combining rules.

rediscover_molecules([solute_ions, fix_broken])

This determines the molecularity and sets the ATOMS_PER_MOLECULE and SOLVENT_POINTERS sections of the prmtops.

remake_parm()

Fills parm_data from the data in the parameter and topology arrays (e.g., atoms, bonds, bond_types, …)

save(fname[, format, overwrite])

Saves the current Structure in the requested file format.

set_version()

Sets the version string

split()

Split the current Structure into separate Structure instances for each unique molecule.

strip(selection)

Deletes a subset of the atoms corresponding to an atom-based selection.

to_dataframe()

Generates a DataFrame from the current Structure’s atomic properties

unchange()

Toggles all lists so that they do not indicate any changes

update_dihedral_exclusions()

Nonbonded exclusions and exceptions have the following priority:

view_as(cls)

Returns a view of the current object as another object.

visualize(*args, **kwargs)

Use nglview for visualization.

write_cif(dest[, renumber, coordinates, …])

Write a PDB file from the current Structure instance

write_parm(name)

Writes the current data in parm_data into a new topology file with a given name.

write_pdb(dest[, renumber, coordinates, …])

Write a PDB file from a Structure instance

write_psf(dest[, vmd])

Writes a PSF file from the stored molecule

write_rst7(name[, netcdf])

Writes a restart file with the current coordinates and velocities and box info if it’s present

__init__(prm_name=None, xyz=None, box=None, rst7_name=None)

Instantiates an AmberParm object from data in prm_name and establishes validity based on presence of POINTERS and CHARGE sections. In general, you should use LoadParm from the readparm module instead. LoadParm will correctly dispatch the object to the ‘correct’ flavor of AmberParm

Methods

__init__([prm_name, xyz, box, rst7_name])

Instantiates an AmberParm object from data in prm_name and establishes validity based on presence of POINTERS and CHARGE sections.

add_atom(atom, resname, resnum[, chain, …])

Adds a new atom to the Structure, adding a new residue to residues if it has a different name or number as the last residue added and adding it to the atoms list.

add_atom_to_residue(atom, residue)

Adds a new atom to the Structure at the end if the given residue

add_flag(flag_name, flag_format[, data, …])

Adds a new flag with the given flag name and Fortran format string and initializes the array with the values given, or as an array of 0s of length num_items

assign_bonds(*reslibs)

Assigns bonds to all atoms based on the provided residue template libraries.

copy(cls[, split_dihedrals])

Makes a copy of the current structure as an instance of a specified subclass

createSystem([nonbondedMethod, …])

Construct an OpenMM System representing the topology described by the prmtop file.

delete_flag(flag_name)

Removes a flag from the topology file

fill_LJ()

Fills the LJ_radius, LJ_depth arrays and LJ_types dictionary with data from LENNARD_JONES_ACOEF and LENNARD_JONES_BCOEF sections of the prmtop files, by undoing the canonical combining rules.

from_rawdata(rawdata)

Take the raw data from a AmberFormat object and initialize an AmberParm from that data.

from_structure(struct[, copy])

Take a Structure instance and initialize a ChamberParm instance from that data.

get_box([frame])

In some cases, multiple conformations may be stored in the Structure.

get_coordinates([frame])

In some cases, multiple conformations may be stored in the Structure.

has_1012()

This routine determines whether there are any defined 10-12 Lennard-Jones interactions that are non-zero

has_NBFIX()

This routine determines whether there are any off-diagonal Lennard-Jones modifications (i.e., if any two atoms have a L-J pair interaction that does not match the combined L-J parameters for that pair).

id_format(filename)

Identifies the file type as either Amber-format file (like prmtop) or an old-style topology file.

initialize_topology([xyz, box])

Initializes topology data structures, like the list of atoms, bonds, etc., after the topology file has been read.

is_changed()

Determines if any of the topological arrays have changed since the last upload

join_dihedrals()

Joins multi-term torsions into a single term and makes all of the parameters DihedralTypeList instances.

load_atom_info()

Loads atom properties into the atoms that have been loaded.

load_dataframe(df)

Loads atomic properties from an input DataFrame

load_pointers()

Loads the data in POINTERS section into a pointers dictionary with each key being the pointer name according to http://ambermd.org/formats.html

load_rst7(rst7)

Loads coordinates into the AmberParm class

load_structure()

Loads all of the topology instance variables.

omm_add_constraints(system, constraints, …)

Adds constraints to a given system

omm_angle_force([constraints, …])

Creates an OpenMM HarmonicAngleForce object (or AmoebaAngleForce if the angles are for an Amoeba-parametrized system)

omm_bond_force([constraints, rigidWater, …])

Creates an OpenMM Bond Force object (or AmoebaBondForce if the bonds are for an Amoeba-parametrized system)

omm_cmap_force()

Creates the OpenMM CMAP torsion force

omm_dihedral_force([split])

Creates the OpenMM PeriodicTorsionForce modeling dihedrals

omm_gbsa_force(implicitSolvent[, …])

Creates a Generalized Born force for running implicit solvent calculations

omm_improper_force()

Creates the OpenMM improper torsion force (quadratic bias)

omm_nonbonded_force([nonbondedMethod, …])

Creates the OpenMM NonbondedForce (and CustomNonbondedForce if necessary) to define the nonbonded interatomic potential for this system.

omm_out_of_plane_bend_force()

Creates the Amoeba out-of-plane bend force

omm_pi_torsion_force()

Creates the Amoeba pi-torsion force

omm_rb_torsion_force()

Creates the OpenMM RBTorsionForce for Ryckaert-Bellemans torsions

omm_set_virtual_sites(system)

Sets the virtual sites in a given OpenMM System object from the extra points defined in this system

omm_stretch_bend_force()

Create the OpenMM Amoeba stretch-bend force for this system

omm_torsion_torsion_force()

Create the OpenMM Amoeba coupled-torsion (CMAP) force

omm_trigonal_angle_force()

Creates the Amoeba trigonal-angle force

omm_urey_bradley_force()

Creates the OpenMM Urey-Bradley force

parse(filename, *args, **kwargs)

Meant for use with the automatic file loader, this will automatically return a subclass of AmberFormat corresponding to what the information in the prmtop file contains (i.e., either an AmberParm, ChamberParm, AmoebaParm, or AmberFormat)

prune_empty_terms()

Looks through all of the topological lists and gets rid of terms in which at least one of the atoms is None or has an idx attribute set to -1 (indicating that it has been removed from the atoms atom list)

ptr(pointer)

Returns the value of the given pointer, and converts to upper-case so it’s case-insensitive.

rdparm(fname[, slow])

Parses the Amber format file

rdparm_old(prmtop_lines[, check])

This reads an old-style topology file and stores the results in the same data structures as a new-style topology file

rdparm_slow(fname)

Parses the Amber format file.

recalculate_LJ()

Takes the values of the LJ_radius and LJ_depth arrays and recalculates the LENNARD_JONES_A/BCOEF topology sections from the canonical combining rules.

rediscover_molecules([solute_ions, fix_broken])

This determines the molecularity and sets the ATOMS_PER_MOLECULE and SOLVENT_POINTERS sections of the prmtops.

remake_parm()

Fills parm_data from the data in the parameter and topology arrays (e.g., atoms, bonds, bond_types, …)

save(fname[, format, overwrite])

Saves the current Structure in the requested file format.

set_version()

Sets the version string

split()

Split the current Structure into separate Structure instances for each unique molecule.

strip(selection)

Deletes a subset of the atoms corresponding to an atom-based selection.

to_dataframe()

Generates a DataFrame from the current Structure’s atomic properties

unchange()

Toggles all lists so that they do not indicate any changes

update_dihedral_exclusions()

Nonbonded exclusions and exceptions have the following priority:

view_as(cls)

Returns a view of the current object as another object.

visualize(*args, **kwargs)

Use nglview for visualization.

write_cif(dest[, renumber, coordinates, …])

Write a PDB file from the current Structure instance

write_parm(name)

Writes the current data in parm_data into a new topology file with a given name.

write_pdb(dest[, renumber, coordinates, …])

Write a PDB file from a Structure instance

write_psf(dest[, vmd])

Writes a PSF file from the stored molecule

write_rst7(name[, netcdf])

Writes a restart file with the current coordinates and velocities and box info if it’s present

Attributes

ANGLE_FORCE_GROUP

BOND_FORCE_GROUP

CMAP_FORCE_GROUP

DIHEDRAL_FORCE_GROUP

IMPROPER_FORCE_GROUP

NONBONDED_FORCE_GROUP

OUT_OF_PLANE_BEND_FORCE_GROUP

PI_TORSION_FORCE_GROUP

RB_TORSION_FORCE_GROUP

STRETCH_BEND_FORCE_GROUP

TORSION_TORSION_FORCE_GROUP

TRIGONAL_ANGLE_FORCE_GROUP

UREY_BRADLEY_FORCE_GROUP

amoeba

Whether this instance uses the Amoeba force field

angles_inc_h

All angles including hydrogen

angles_without_h

All angles including hydrogen

bonds_inc_h

All bonds including hydrogen

bonds_without_h

All bonds without hydrogen

box

box_vectors

3, 3-element tuple of unit cell vectors that are Quantity objects of dimension length

chamber

Whether this instance uses the CHARMM force field

combining_rule

coordinates

dihedrals_inc_h

All dihedrals including hydrogen

dihedrals_without_h

All dihedrals including hydrogen

has_cmap

Whether this instance has correction map terms or not

positions

A list of 3-element Quantity tuples of dimension length representing the atomic positions for every atom in the system.

topology

The OpenMM Topology object.

velocities

view

Returns an indexable object that can be indexed like a standard Structure, but returns a view rather than a copy