ForceBalance API  1.3
Automated optimization of force fields and empirical potentials
Classes | Namespaces | Functions | Variables
molecule.py File Reference

Go to the source code of this file.

Classes

class  src.molecule.ActuallyArcError
 
class  src.molecule.RawStreamHandler
 Exactly like output.StreamHandler except it does no extra formatting before sending logging messages to the stream. More...
 
class  src.molecule.MolfileTimestep
 Wrapper for the timestep C structure used in molfile plugins. More...
 
class  src.molecule.Molecule
 Lee-Ping's general file format conversion class. More...
 

Namespaces

 src.molecule
 

Functions

def src.molecule.getElement (mass)
 
def src.molecule.elem_from_atomname (atomname)
 Given an atom name, attempt to get the element in most cases. More...
 
def src.molecule.unmangle (M1, M2)
 Create a mapping that takes M1's atom indices to M2's atom indices based on position. More...
 
def src.molecule.nodematch (node1, node2)
 
def src.molecule.isint (word)
 ONLY matches integers! If you have a decimal point? None shall pass! More...
 
def src.molecule.isfloat (word)
 Matches ANY number; it can be a decimal, scientific notation, integer, or what have you. More...
 
def src.molecule.CubicLattice (a)
 This function takes in three lattice lengths and three lattice angles, and tries to return a complete box specification. More...
 
def src.molecule.BuildLatticeFromLengthsAngles (a, b, c, alpha, beta, gamma)
 This function takes in three lattice lengths and three lattice angles, and tries to return a complete box specification. More...
 
def src.molecule.BuildLatticeFromVectors (v1, v2, v3)
 This function takes in three lattice vectors and tries to return a complete box specification. More...
 
def src.molecule.TopEqual (mol1, mol2)
 For the nanoreactor project: Determine whether two Molecule objects have the same topologies. More...
 
def src.molecule.MolEqual (mol1, mol2)
 Determine whether two Molecule objects have the same fragments by looking at elements and connectivity graphs. More...
 
def src.molecule.format_xyz_coord (element, xyz, tinker=False)
 Print a line consisting of (element, x, y, z) in accordance with .xyz file format. More...
 
def src.molecule.format_gro_coord (resid, resname, aname, seqno, xyz)
 Print a line in accordance with .gro file format, with six decimal points of precision. More...
 
def src.molecule.format_xyzgen_coord (element, xyzgen)
 Print a line consisting of (element, p, q, r, s, t, ...) where (p, q, r) are arbitrary atom-wise data (this might happen, for instance, with atomic charges) More...
 
def src.molecule.format_gro_box (box)
 Print a line corresponding to the box vector in accordance with .gro file format. More...
 
def src.molecule.is_gro_coord (line)
 Determines whether a line contains GROMACS data or not. More...
 
def src.molecule.is_charmm_coord (line)
 Determines whether a line contains CHARMM data or not. More...
 
def src.molecule.is_gro_box (line)
 Determines whether a line contains a GROMACS box vector or not. More...
 
def src.molecule.add_strip_to_mat (mat, strip)
 
def src.molecule.pvec (vec)
 
def src.molecule.grouper (n, iterable)
 Groups a big long iterable into groups of ten or what have you. More...
 
def src.molecule.even_list (totlen, splitsize)
 Creates a list of number sequences divided as evenly as possible. More...
 
def src.molecule.both (A, B, key)
 
def src.molecule.diff (A, B, key)
 
def src.molecule.either (A, B, key)
 
def src.molecule.EulerMatrix (T1, T2, T3)
 Constructs an Euler matrix from three Euler angles. More...
 
def src.molecule.ComputeOverlap (theta, elem, xyz1, xyz2)
 Computes an 'overlap' between two molecules based on some fictitious density. More...
 
def src.molecule.AlignToDensity (elem, xyz1, xyz2, binary=False)
 Computes a "overlap density" from two frames. More...
 
def src.molecule.AlignToMoments (elem, xyz1, xyz2=None)
 Pre-aligns molecules to 'moment of inertia'. More...
 
def src.molecule.get_rotate_translate (matrix1, matrix2)
 
def src.molecule.cartesian_product2 (arrays)
 Form a Cartesian product of two NumPy arrays. More...
 
def src.molecule.extract_int (arr, avgthre, limthre, label="value", verbose=True)
 Get the representative integer value from an array. More...
 
def src.molecule.extract_pop (M, verbose=True)
 Extract our best estimate of charge and spin-z from the comments section of a Molecule object created with Nanoreactor. More...
 
def src.molecule.arc (Mol, begin=None, end=None, RMSD=True, align=True)
 Get the arc-length for a trajectory segment. More...
 
def src.molecule.EqualSpacing (Mol, frames=0, dx=0, RMSD=True, align=True)
 Equalize the spacing of frames in a trajectory with linear interpolation. More...
 
def src.molecule.AtomContact (xyz, pairs, box=None, displace=False)
 Compute distances between pairs of atoms. More...
 
def src.molecule.form_rot (q)
 Given a quaternion p, form a rotation matrix from it. More...
 
def src.molecule.axis_angle (axis, angle)
 Given a rotation axis and angle, return the corresponding 3x3 rotation matrix, which will rotate a (Nx3) array of xyz coordinates as x0_rot = np.dot(R, x0.T).T. More...
 
def src.molecule.main ()
 

Variables

 src.molecule.input = raw_input
 
dictionary src.molecule.FrameVariableNames
 
dictionary src.molecule.AtomVariableNames
 
dictionary src.molecule.MetaVariableNames
 
dictionary src.molecule.QuantumVariableNames = {'qcrems', 'qctemplate', 'charge', 'mult', 'qcsuf', 'qm_ghost', 'qm_bondorder'}
 
dictionary src.molecule.AllVariableNames = QuantumVariableNames | AtomVariableNames | MetaVariableNames | FrameVariableNames
 
string src.molecule.package = "ForceBalance"
 
 src.molecule.logger = getLogger("MoleculeLogger")
 
 src.molecule.handler = RawStreamHandler()
 
 src.molecule.module_name = __name__.replace('.molecule','')
 
list src.molecule.Radii
 
list src.molecule.Elements
 
 src.molecule.PeriodicTable
 
bool src.molecule.have_dcdlib = False
 
float src.molecule.bohr2ang = 0.529177210
 One bohr equals this many angstroms. More...
 
 src.molecule.splitter = re.compile(r'(\s+|\S+)')
 
 src.molecule.Box = namedtuple('Box',['a','b','c','alpha','beta','gamma','A','B','C','V'])
 
int src.molecule.radian = 180. / np.pi
 
 src.molecule.Alive