API¶
- openpharmmdflow.from_cif(path: str | PathLike) openff.toolkit.Molecule¶
Convert a Crystallographic Information File (CIF) to an OpenFF Toolkit Molecule.
Parameters¶
- pathstr or os.PathLike
The path to the CIF file.
Returns¶
- openff.toolkit.Molecule
An OpenFF Toolkit Molecule object representing the molecular structure.
Raises¶
- RuntimeError
If the required external tool ‘apptainer’ is not found.
Notes¶
This function utilizes the ‘codcif2sdf’ external tool inside an apptainer image to convert a CIF file to a Structure Data File (SDF), and then reads the SDF file into an OpenFF Toolkit Molecule object. Bond order is guessed.
Examples¶
>>> from openpharmmdflow import from_cif >>> molecule = from_cif("/path/to/example.cif") >>> molecule.visualize()