{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "// Load the FFX libraries.\n", "%use @file[ffx.json]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "// Run the Energy script to calculate the current potential energy of ubiquitin.\n", "import ffx.potential.commands.Energy\n", "\n", "val energy = Energy(arrayOf(\"../examples/ubiquitin.xyz\")).run()\n", "println(\" Current Potential Energy\")\n", "println(energy.getForceFieldEnergy())" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "// Plot the energy during a minimization of ubiquitin using Koltin DataFrame and Kandy.\n", "%use kandy\n", "%use dataframe\n", "import ffx.algorithms.commands.Minimize\n", "\n", "val minimize = Minimize(arrayOf(\"../examples/ubiquitin.xyz\", \"-e\", \"1.0\")).run()\n", "println(minimize.toString())\n", "\n", "val energies = minimize.getEnergyList()\n", "val length = energies.size\n", "val steps = (0 until length).toList()\n", "val df = dataFrameOf(\"Step\" to steps, \"Energy\" to energies)\n", "\n", "df.plot {\n", " points {\n", " x(steps) { axis.name = \"Step\" }\n", " y(energies) { axis.name = \"Energy (kcal/mol)\" }\n", " }\n", " layout.title = \"Ubiquitin Minimization\"\n", "}\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Kotlin", "language": "kotlin", "name": "kotlin" }, "ktnbPluginMetadata": { "projectDependencies": [ "ffx-algorithms", "ffx-crystal", "ffx-experiment", "ffx-numerics", "ffx-pj", "ffx-potential", "ffx-ui", "ffx-utilities", "forcefieldx", "jopenmm" ] }, "language_info": { "codemirror_mode": "text/x-kotlin", "file_extension": ".kt", "mimetype": "text/x-kotlin", "name": "kotlin", "nbconvert_exporter": "", "pygments_lexer": "kotlin", "version": "2.2.20-Beta2" } }, "nbformat": 4, "nbformat_minor": 4 }