Skip to content

Instantly share code, notes, and snippets.

View jthorton's full-sized avatar

Josh Horton jthorton

View GitHub Profile
@jthorton
jthorton / env.yml
Last active May 26, 2022 09:33
Plot the results of a ForceBalance optimize.out file, supports density and hvap.
name: plot_opt_out
channels:
- simonboothroyd
- conda-forge
dependencies:
- black=22.3.0=pyhd8ed1ab_0
- bokeh=2.4.2=py39h6e9494a_0
- boost=1.74.0=py39ha1f3e3e_4
- boost-cpp=1.74.0=hf3dc895_5
- brotli=1.0.9=h0d85af4_6
@jthorton
jthorton / How_to_train_your_forcefield.ipynb
Last active October 28, 2021 13:40
How to train your force field follow along notebook.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jthorton
jthorton / simple-td.py
Created October 21, 2021 13:42
A simple script to run torsiondrives via qcengine
# A script to quickly run a torsion drive using QCEngine torsiondrive/geometric openff toolkit and rdkit uff
from openff.toolkit.topology import Molecule, Atom, Bond
from qcelemental.models.common_models import Model
from qcelemental.models import DriverEnum
from qcelemental.models.procedures import TDKeywords, TorsionDriveInput, QCInputSpecification, OptimizationSpecification, TorsionDriveResult
import qcengine as qcng
# Make our molecule
print("Building molecule")
@jthorton
jthorton / water_analysis.py
Created October 11, 2021 17:20
A script to collect and plot the results of a forcebalance water optimisation.
"""
Analyses the optimize out file from a forcebalance run.
This is quite specific for the results of a water optimzation to multiple liquid property targets.
This will produce a csv file with all of the results per iteration for the properties and target parameters.
Graphs will also be produced for each iteration showing the csv data.
"""
import matplotlib.pyplot as plt
from typing import List, Dict, Tuple
import pandas as pd
@jthorton
jthorton / protein_ligand_setup.py
Created July 16, 2021 10:36
Build a parametreised protein ligand system using openmmforcefields ready for simulation.
#combine a protein and ligand to build an OpenMM system
# the molecules have been extracted from the PDB file and saved to sdf to work with openff, note they are still in the bound corrdinates.
from simtk import unit
from simtk.openmm import app
from openff.toolkit.topology import Molecule
import parmed
from openmmforcefields.generators import SystemGenerator
from simtk.openmm.app import modeller
@jthorton
jthorton / Running_QCEngine.ipynb
Created November 19, 2020 16:01
Running QCEngine from OFFTK
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jthorton
jthorton / dataset.json
Created April 21, 2020 10:16
The first 100 results of the MM benchmark
This file has been truncated, but you can view the full file.
{
"c[nh2+]c[c@@h](c1ccc(c(c1)o)o)o-3": {
"index": "c[nh2+]c[c@@h](c1ccc(c(c1)o)o)o-3",
"attributes": {
"canonical_explicit_hydrogen_smiles": "[H]c1c(c(c(c(c1C([H])(C([H])([H])[N+]([H])([H])C([H])([H])[H])O[H])[H])O[H])O[H])[H]",
"canonical_isomeric_explicit_hydrogen_mapped_smiles": "[H:14][c:1]1[c:2]([c:5]([c:6]([c:3]([c:4]1[C@:9]([H:22])([C:8]([H:20])([H:21])[N+:10]([H:23])([H:24])[C:7]([H:17])([H:18])[H:19])[O:13][H:27])[H:16])[O:12][H:26])[O:11][H:25])[H:15]",
"canonical_isomeric_explicit_hydrogen_smiles": "[H]c1c(c(c(c(c1[C@]([H])(C([H])([H])[N+]([H])([H])C([H])([H])[H])O[H])[H])O[H])O[H])[H]",
"canonical_isomeric_smiles": "C[NH2+]C[C@@H](c1ccc(c(c1)O)O)O",
"canonical_smiles": "C[NH2+]CC(c1ccc(c(c1)O)O)O",
"inchi_key": "UCTWMZQNUQWSLP-VIFPVBQESA-O",