parmed.structure.Structure

class parmed.structure.Structure[source]

A chemical structure composed of atoms, bonds, angles, torsions, and other topological features

Notes

This class also has a handful of type lists for each of the attributes above (excluding atoms, residues, chiral_frames, and multipole_frames). They are all TrackedList instances that are designed to hold the relevant parameter type. The list is:

bond_types, angle_types, dihedral_types, urey_bradley_types, improper_types, cmap_types, trigonal_angle_types, out_of_plane_bend_types, pi_torsion_types, stretch_bend_types, torsion_torsion_types, adjust_types

dihedral_types _may_ be a list of DihedralType instances, since torsion profiles are often represented by a Fourier series with multiple terms

Attributes
atomsAtomList

List of all atoms in the structure

residuesResidueList

List of all residues in the structure

bondsTrackedList (Bond)

List of all bonds in the structure

anglesTrackedList (Angle)

List of all angles in the structure

dihedralsTrackedList (Dihedral)

List of all dihedrals in the structure

rb_torsionsTrackedList (Dihedral)

List of all Ryckaert-Bellemans torsions in the structure

urey_bradleysTrackedList (UreyBradley)

List of all Urey-Bradley angle bends in the structure

impropersTrackedList (Improper)

List of all CHARMM-style improper torsions in the structure

cmapsTrackedList (Cmap)

List of all CMAP objects in the structure

trigonal_anglesTrackedList (TrigonalAngle)

List of all AMOEBA-style trigonal angles in the structure

out_of_plane_bendsTrackedList (OutOfPlaneBends)

List of all AMOEBA-style out-of-plane bending angles

pi_torsionsTrackedList (PiTorsion)

List of all AMOEBA-style pi-torsion angles

stretch_bendsTrackedList (StretchBend)

List of all AMOEBA-style stretch-bend compound bond/angle terms

torsion_torsionsTrackedList (TorsionTorsion)

List of all AMOEBA-style coupled torsion-torsion terms

chiral_framesTrackedList (ChiralFrame)

List of all AMOEBA-style chiral frames defined in the structure

multipole_framesTrackedList (MultipoleFrame)

List of all AMOEBA-style multipole frames defined in the structure

adjustsTrackedList (NonbondedException)

List of all nonbonded pair-exception rules

acceptorsTrackedList (AcceptorDonor)

List of all H-bond acceptors, if that information is present

donorsTrackedList (AcceptorDonor)

List of all H-bond donors, if that information is present

groupsTrackedList (Group)

List of all CHARMM-style GROUP objects (whatever those are used for)

boxlist of 6 floats

Box dimensions (a, b, c, alpha, beta, gamma) for the unit cell. If no box is defined, box is set to None

space_groupstr

The space group of the structure (default is “P 1”)

nrexclint

The number of bonds away that an atom can be in order to be excluded from the direct nonbonded summation

titlestr

Cosmetic only, it is an arbitrary title assigned to the system. Default value is an empty string

positionsu.Quantity(list(Vec3), u.angstroms)

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

coordinatesnp.ndarray of shape (nframes, natom, 3)

If no coordinates are set, this is set to None. The first frame will match the coordinates present on the atoms.

symmetrySymmetry

if no symmetry is set, this is set to None.

linksTrackedList (Link)

The list of Link definitions for this Structure

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

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.

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_NBFIX()

Returns whether or not any pairs of atom types have their LJ interactions modified by an NBFIX definition

is_changed()

Determines if any of the topology has changed for this structure

join_dihedrals()

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

load_dataframe(df)

Loads atomic properties from an input DataFrame

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 instance

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

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)

save(fname[, format, overwrite])

Saves the current Structure in the requested file format.

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:

visualize(*args, **kwargs)

Use nglview for visualization.

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

Write a PDB file from the current Structure instance

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

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

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

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.

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_NBFIX()

Returns whether or not any pairs of atom types have their LJ interactions modified by an NBFIX definition

is_changed()

Determines if any of the topology has changed for this structure

join_dihedrals()

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

load_dataframe(df)

Loads atomic properties from an input DataFrame

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 instance

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

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)

save(fname[, format, overwrite])

Saves the current Structure in the requested file format.

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:

visualize(*args, **kwargs)

Use nglview for visualization.

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

Write a PDB file from the current Structure instance

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

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

box

box_vectors

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

combining_rule

coordinates

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