Utilities¶
Helper functions for energy file I/O, atom type detection, and data processing.
Usage¶
from parametrizani import (
read_energy_file,
write_energy_file,
get_dihedral_atom_types,
extract_atom_info_from_pdb,
relative_energies,
)
# Read/write energy profiles
angles, energies = read_energy_file('profile.dat')
write_energy_file('output.dat', angles, energies)
# Detect atom types from MOL2
atom_types = get_dihedral_atom_types('ligand.mol2', [8, 9, 10, 15])
# Returns e.g. ['ca', 'ca', 'os', 'ca']
# Extract atom info from PDB
atom_info = extract_atom_info_from_pdb('molecule.pdb')
API Reference¶
parametrizani.utils ¶
ParametrizANI - Utility Functions¶
Common helper functions used across modules.
read_energy_file ¶
Read an energy profile file with columns: angle energy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the data file. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[List[float], List[float]]
|
Tuple of (angles, energies). |
Source code in parametrizani/utils.py
write_energy_file ¶
Write an energy profile file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Output file path. |
required |
angles
|
List[float]
|
Dihedral angles in degrees. |
required |
energies
|
List[float]
|
Energy values in kcal/mol. |
required |
Source code in parametrizani/utils.py
relative_energies ¶
Convert absolute energies to relative energies (min = 0).
get_dihedral_atom_types ¶
Get atom types for a specific dihedral from a MOL2 file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mol2_file
|
str
|
Path to MOL2 file with atom type assignments. |
required |
dihedral_indices
|
List[int]
|
Four atom indices defining the dihedral. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Four atom type strings for the dihedral atoms. |
Source code in parametrizani/utils.py
get_atom_types_from_mol2 ¶
Extract GAFF/SYBYL atom types from a MOL2 file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mol2_file
|
str
|
Path to MOL2 file (e.g., from antechamber). |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List of atom type strings, one per atom. |
Source code in parametrizani/utils.py
extract_atom_info_from_pdb ¶
Extract atom information from a PDB file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pdb_file_path
|
str
|
Path to PDB file. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of atom dictionaries with keys: index, name, element, x, y, z. |