5.1. ligandparam.io.coordinates
- class ligandparam.io.coordinates.Coordinates(filename: Path | str, filetype: str = 'pdb')[source]
Bases:
objectA class to handle the coordinates of a structure.
This class is a wrapper around the MDAnalysis Universe class, and provides a simple interface to manipulate the coordinates of a structure.
- Parameters:
filename (Union[Path, str]) – The filename of the structure to read in
filetype (str, optional) – The filetype of the structure to read in
Methods
Grabs the coordinates
Grabs the elements
rotate([alpha, beta, gamma])Rotate the coordinates around specific axes around the center of mass.
update_coordinates(coords[, original])Updates the coordinates
- get_coordinates()[source]
Grabs the coordinates
- Parameters:
None
- Returns:
coords – The coordinates of the atoms in the structure
- Return type:
np.array
- get_elements()[source]
Grabs the elements
- Parameters:
None
- Returns:
elements – The elements of the atoms in the structure
- Return type:
list
- rotate(alpha=0.0, beta=0.0, gamma=0.0)[source]
Rotate the coordinates around specific axes around the center of mass.
The rotation is done in the order alpha, beta, gamma, and the rotation is done around the center of mass.
- Parameters:
alpha (float) – The angle to rotate the structure in the alpha direction (degrees)
beta (float) – The angle to rotate the structure in the beta direction (degrees)
use_original (bool, optional) – If True, the rotation will be applied to the new coordinates
- class ligandparam.io.coordinates.Mol2Writer(u, filename=None, selection='all')[source]
Bases:
objectA class to write a mol2 file.
- Parameters:
u (MDAnalysis Universe) – The universe to write to a mol2 file
filename (str) – The filename to write to
Methods
write()Write the mol2 file.
- ligandparam.io.coordinates.Remove_PDB_CONECT(filename: Path | str, backup: bool = False)[source]
Removes CONECT lines from a PDB file.
This script (1) copies the pdb file to a new file (with input added to the filename) and (2) removes the CONECT records from the original file.
- Parameters:
filename (str) – The name of the file to check
- Return type:
None