API Examples

Dabble has a lot of functionality, and it can be sometimes difficult to see where to start. Here are a few examples of how I and others have used the Dabble API.

Parameterizing just a ligand

I wanted to run a short simulation of my ligand in implicit solvent to test if the parameters were working, but the ligand atom names were different than my ParamChem .str file, and matching them up by hand is really tedious.

Instead, I'll use the Dabble parameterization API to match up atom names and save an input file suitable for use in AMBER.:

import vmd, molecule
from Dabble.param import AmberWriter

id = molecule.load("mol2", "ligand.mol2")
w = AmberWriter(molid=id, tmp_dir=".", forcefield="charmm",
                extra_topos="ligand_paramchem.str")
w.write("ligand_parameterized")

This will produce two files, ligand_parameterized.prmtop and ligand_parameterized.inpcrd that can be simulated in a vacuum or implicit solvent.