{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# SPE calculation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`Auto3D` is mainly designed for generating low-energy 3D structures from the SMILES. It aslo provides a wrapper function `calc_spe` to do single point energy calculation for existing 3D structures, using `ANI2x`, `AIMNET` or `ANI2xt` as the engine. \n", "\n", "Single point energy (SPE) calculation **does not** change the input geometry.\n", "\n", "The source juputer notebook can be downloaded [here](https://github.com/isayevlab/Auto3D_pkg/blob/main/example/single_point_energy.ipynb)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": "import os, sys\nroot = os.path.dirname(os.path.dirname(os.path.abspath(\"__file__\")))\nsys.path.append(root)\n\nimport Auto3D\nfrom Auto3D import Auto3DOptions, main, calc_spe" }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2.2.10\n" ] } ], "source": [ "#Always ensure that you have the latest version\n", "print(Auto3D.__version__)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/home/jack/Auto3D_pkg/example/files/RDKIT_ANI2x_smiles/smiles_out_ANI2x_E.sdf\n" ] } ], "source": [ "path = os.path.join(root, \"example/files/RDKIT_ANI2x_smiles/smiles_out.sdf\")\n", "spe = calc_spe(path, model_name=\"ANI2x\")\n", "print(spe) #SPE are stored in the SDF file under the E_hartree entry" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function calc_spe in module Auto3D.SPE:\n", "\n", "calc_spe(path: str, model_name: str, gpu_idx=0)\n", " Calculates single point energy.\n", " \n", " :param path: Input sdf file\n", " :type path: str\n", " :param model_name: AIMNET, ANI2x or ANI2xt\n", " :type model_name: str\n", " :param gpu_idx: GPU cuda index, defaults to 0\n", " :type gpu_idx: int, optional\n", "\n" ] } ], "source": [ "help(calc_spe)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "py39", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.17" }, "vscode": { "interpreter": { "hash": "1b614daab3e5f7b6a193b72cc0b083bb669e7ee1c6a77737086e3d4b842fe95b" } } }, "nbformat": 4, "nbformat_minor": 2 }