Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'plot_td_energies'",
"output_type": "error",
"traceback": [
"\u001b[0;31m-----------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0mTraceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-b59dc60d8950>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0mProperTorsionHandler\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mImproperTorsionHandler\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m vdWHandler)\n\u001b[0;32m---> 12\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mplot_td_energies\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mcollect_td_targets_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mplot_td_targets_data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 13\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mpickle\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mmake_torsion_target_new\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'plot_td_energies'"
]
}
],
"source": [
"#imports\n",
"#Created by Jessica\n",
"\n",
"import os\n",
"import json\n",
"import tempfile\n",
"from openforcefield.topology import Molecule, Topology\n",
"from openforcefield.typing.engines.smirnoff import (ForceField,\n",
"UnassignedValenceParameterException, BondHandler, AngleHandler,\n",
"ProperTorsionHandler, ImproperTorsionHandler,\n",
"vdWHandler)\n",
"from plot_td_energies import collect_td_targets_data, plot_td_targets_data\n",
"import pickle\n",
"import make_torsion_target_new\n",
"\n",
"\n",
"force_balance_file = 'optimize.in'"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"#functions\n",
"sub_dir = [x[0] for x in os.walk(directory) if os.path.basename(x[0]).startswith('td')]\n",
"\n",
"def makePlots(ds, ff, param):\n",
" \"\"\"\n",
" Description: \n",
" -Create k versus WBO plots\n",
" -Create MM versus QM plots for each target \n",
" \n",
" \n",
" input:\n",
" ds: List of dataset names\n",
" ff: .offxml style format force field name\n",
" param: List of parameters to generate plots for\n",
" \"\"\"\n",
" \n",
" #make td Targets \n",
" \n",
" \n",
" \n",
" \n",
" \n",
" #Create targets folder in subdirectory \n",
" force_balance_file = 'optimize.in'\n",
"\n",
"\n",
" # Find which line of optimize.in the targets specificaiton begins at\n",
" with open(force_balance_file, 'r') as f:\n",
" replace_index = None\n",
" force_balance_lines = f.readlines()\n",
" for index,line in enumerate(force_balance_lines):\n",
" try:\n",
" #if 'name' in line[:4]:\n",
" if line.startswith('name'):\n",
" replace_index = index\n",
" break\n",
" except:\n",
" pass\n",
" #print(replace_index)\n",
"\n",
" count = 0\n",
" \n",
" \n",
"\n",
" \n",
" #run force balance \n",
" #store the k1 and k2 values\n",
" #getKval(k1, k2)=kval\n",
" \n",
" #store data in dictionary data {cmiles : [wbo, kval], }\n",
" \n",
" #create figure \n",
" \n",
" return \n",
" \n",
"def getKval(k1, k2):\n",
" \"\"\"\n",
" Determine the slope from the k1 and k2 value\n",
" \n",
" k1: \n",
" k2:\n",
" \"\"\"\n",
" \n",
" \n",
" \n",
"\n",
" return kval \n",
"\n",
"\n",
"def make_wbo_versus_k_plots(valDict):\n",
" \"\"\"\n",
" Description: Make plots of k versus WBO and save plots to .pdf \n",
" \n",
" \n",
" input: \n",
" valDict: Dictionary of cmiles as keys and list of [wbo, kval] as the items \n",
" \n",
" \"\"\"\n",
" \n",
" \n",
" \n",
" \n",
" return \n",
"\n",
"\n",
"\n",
"def make_MM_QM_plots(datasets):\n",
" \"\"\"\n",
" datasets: MM_QM_Plots\n",
" \n",
" \"\"\"\n",
"\n",
" \n",
" \n",
" \n",
" return \n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"directory = '/Users/jessica/Downloads/release_1.2.0/fb-fit/targets/'\n",
"ff = '/Users/jessica/Documents/Grad_research/WBO_Torsions_ChayaPaper/release_1.3.0_2/fb-fit/fb-fit0/forcefield/test.offxml'\n",
"\n",
"#all of the molecules there is torsions \n",
"#break them out into subplots for the TIG parameters \n",
"\n",
"\n",
"#Plot for molecules that use TIG5a, but use the TIG-fit0 plots \n",
"#Plot for TIG3 \n",
"\n",
"#run the same experiments with Carbon-Nitrogen central bonds parameters \n",
"\n",
"\n",
"makePlots(datasets, ff, param)\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading