This class defines a molecule object, which is basically a list of Atom objects. Each atom object has a specific cartesian position and atom type, creating the construct of a molecule.
Functions have been provided for editing, moving and transforming the atom objects, either as a collective or specific part of the molecule.
Molecule name
Molecule short name
None for empty Molecule, string to read a molecule from a specified file link or a list of either molecules to concatenate these into one object, or a list of atom objects
Examples
Following example generates a benzene molecule without hydrogen atoms
import porems as pms
mol = pms.Molecule("benzene", "BEN")
mol.add("C", [0,0,0])
mol.add("C", 0, r=0.1375, theta= 60)
mol.add("C", 1, r=0.1375, theta=120)
mol.add("C", 2, r=0.1375, theta=180)
mol.add("C", 3, r=0.1375, theta=240)
mol.add("C", 4, r=0.1375, theta=300)
Methods
Calculate the box size of the current molecule. |
|
|
Concatenate a molecule list into one molecule object. |
|
Read a molecule from a file. |
|
Create a temporary molecule of specified atom ids. |
|
Calculate the vector between to two positions as defined in |
|
Add a new atom in polar coordinates. |
|
Append a given molecule to the current object. |
|
Return the bond vector of a specified bond. |
|
Calculate the geometrical center of mass |
Create column list of atom positions |
|
|
Calculate the center of mass |
|
Delete specified atom from the molecule. |
Return the atoms list. |
|
|
Return the atom type of the given atom id. |
|
Return the box size of the molecule. |
Return the total charge of the molecule. |
|
|
Return the molar mass of the molecule. |
Return a list of masses of the atoms. |
|
|
Return the molecule name. |
|
Return the number of atoms. |
Return the molecule short name. |
|
|
Move whole the molecule to a new position, where the dragging point is a given atom that is moved to a specified position. |
|
Search for overlapping atoms. |
|
Change the bond angle of two bond vectors. |
|
Change the length of a specified bond. |
|
Rotate a set of specified atoms around a given bond as the rotation axis. |
|
Get the position of an atom. |
|
Change the position of an atom to a given position vector \(\boldsymbol{a}\in\mathbb{R}^n\). |
|
Rotate data matrix \(\boldsymbol{D}\) around an axis \(\boldsymbol{a}\in\mathbb{R}^3\) with angle \(\alpha\in\mathbb{R}\) using rotation function |
|
Change the atom name of a specified atom. |
|
Change the residue index of a specified atom. |
|
Change the atom type of a specified atom. |
|
Set the box size. |
|
Set the total charge of the molecule. |
|
Set the molar mass of the molecule. |
|
Set the molar masses of the atoms. |
|
Set the molecule name. |
|
Set the molecule short name. |
|
Switch atom order of two atoms. |
|
Translate the atoms data matrix \(\boldsymbol{D}\) along a vector \(\boldsymbol{a}\in\mathbb{R}^n\). |
|
Move whole the molecule, so that the minimal coordinate between all atoms is zero in all dimensions, or rather the values of the position variable |