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
- atoms
AtomList
List of all atoms in the structure
- residues
ResidueList
List of all residues in the structure
- bonds
TrackedList
(Bond
) List of all bonds in the structure
- angles
TrackedList
(Angle
) List of all angles in the structure
- dihedrals
TrackedList
(Dihedral
) List of all dihedrals in the structure
- rb_torsions
TrackedList
(Dihedral
) List of all Ryckaert-Bellemans torsions in the structure
- urey_bradleys
TrackedList
(UreyBradley
) List of all Urey-Bradley angle bends in the structure
- impropers
TrackedList
(Improper
) List of all CHARMM-style improper torsions in the structure
- cmaps
TrackedList
(Cmap
) List of all CMAP objects in the structure
- trigonal_angles
TrackedList
(TrigonalAngle
) List of all AMOEBA-style trigonal angles in the structure
- out_of_plane_bends
TrackedList
(OutOfPlaneBends
) List of all AMOEBA-style out-of-plane bending angles
- pi_torsions
TrackedList
(PiTorsion
) List of all AMOEBA-style pi-torsion angles
- stretch_bends
TrackedList
(StretchBend
) List of all AMOEBA-style stretch-bend compound bond/angle terms
- torsion_torsions
TrackedList
(TorsionTorsion
) List of all AMOEBA-style coupled torsion-torsion terms
- chiral_frames
TrackedList
(ChiralFrame
) List of all AMOEBA-style chiral frames defined in the structure
- multipole_frames
TrackedList
(MultipoleFrame
) List of all AMOEBA-style multipole frames defined in the structure
- adjusts
TrackedList
(NonbondedException
) List of all nonbonded pair-exception rules
- acceptors
TrackedList
(AcceptorDonor
) List of all H-bond acceptors, if that information is present
- donors
TrackedList
(AcceptorDonor
) List of all H-bond donors, if that information is present
- groups
TrackedList
(Group
) List of all CHARMM-style GROUP objects (whatever those are used for)
- box
list 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_group
str
The space group of the structure (default is “P 1”)
- nrexcl
int
The number of bonds away that an atom can be in order to be excluded from the direct nonbonded summation
- title
str
Cosmetic only, it is an arbitrary title assigned to the system. Default value is an empty string
positions
u.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.
- symmetry
Symmetry
if no symmetry is set, this is set to None.
- links
TrackedList
(Link
) The list of Link definitions for this Structure
- atoms
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.
Returns whether or not any pairs of atom types have their LJ interactions modified by an NBFIX definition
Determines if any of the topology has changed for this structure
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)
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
Creates the OpenMM improper torsion force (quadratic bias)
omm_nonbonded_force
([nonbondedMethod, …])Creates the OpenMM NonbondedForce instance
Creates the Amoeba out-of-plane bend force
Creates the Amoeba pi-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
Create the OpenMM Amoeba stretch-bend force for this system
Create the OpenMM Amoeba coupled-torsion (CMAP) force
Creates the Amoeba trigonal-angle force
Creates the OpenMM Urey-Bradley force
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.
Generates a DataFrame from the current Structure’s atomic properties
unchange
()Toggles all lists so that they do not indicate any changes
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
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.
Returns whether or not any pairs of atom types have their LJ interactions modified by an NBFIX definition
Determines if any of the topology has changed for this structure
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)
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
Creates the OpenMM improper torsion force (quadratic bias)
omm_nonbonded_force
([nonbondedMethod, …])Creates the OpenMM NonbondedForce instance
Creates the Amoeba out-of-plane bend force
Creates the Amoeba pi-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
Create the OpenMM Amoeba stretch-bend force for this system
Create the OpenMM Amoeba coupled-torsion (CMAP) force
Creates the Amoeba trigonal-angle force
Creates the OpenMM Urey-Bradley force
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.
Generates a DataFrame from the current Structure’s atomic properties
unchange
()Toggles all lists so that they do not indicate any changes
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
3, 3-element tuple of unit cell vectors that are Quantity objects of dimension length
A list of 3-element Quantity tuples of dimension length representing the atomic positions for every atom in the system.
The OpenMM Topology object.
Returns an indexable object that can be indexed like a standard Structure, but returns a view rather than a copy