parmed.utils package

Module contents

Various utilities used by ParmEd that don’t really fit elsewhere

parmed.utils.canonical_improper_order(atom1, atom2, atom3, atom4, center=1)[source]

Controls how improper torsion keys are generated from Structures. Different programs have different conventions as far as where the “central” atom is placed.

Note, different programs use different conventions for where the “central” atom comes in the overall torsion ordering. CHARMM puts the central atom first, whereas AMBER puts the central atom third. A central atom is defined as the one that is bonded to the other 3.

Parameters
atom1parmed.topologyobjects.Atom

The first atom in the improper

atom2parmed.topologyobjects.Atom

The second atom in the improper

atom3parmed.topologyobjects.Atom

The third atom in the improper

atom4parmed.topologyobjects.Atom

The fourth atom in the improper

centerint, optional

Which location represents the center atom. Default is 1 (first location).

Returns
a1, a2, a3, a4tuple of parmed.topologyobjects.Atom

The atoms in the necessary parameter order

parmed.utils.find_atom_pairs(struct, dist, subset=None)[source]

Finds all pairs of atoms in a structure within a requested distance

Parameters
structparmed.structure.Structure

The structure for which to find all atom pairs

distfloat

The maximum distance between identified pairs. No pairs separated by less than dist will be omitted, although some pairs greater than dist will be identified.

subsetset of Atom, optional

If specified, the pairlist will be built only considering these atoms

Returns
pairslist of set of Atom

The list of set of atoms that may be pairs

Raises
ValueError if struct does not have any coordinates.

Notes

This function does not do anything with periodic boundary conditions.

parmed.utils.tag_molecules(struct)[source]

Sets the marked attribute of every Atom in struct to the molecule number it is a part of. If no bonds are present, every atom is its own molecule.

Parameters
structparmed.Structure

Input structure to tag the molecules for

parmed.utils.which(prog)[source]

Returns the full path of a program if it exists in PATH

Parameters
progstr

The name of a program to try and locate in PATH

Returns
pathstr or None

The full path of the program. If it cannot be found, None