Commit beab3780 authored by Jason Swails's avatar Jason Swails

Update imports in examples.

parent e98c43f6
...@@ -8,13 +8,12 @@ import simtk.openmm as mm ...@@ -8,13 +8,12 @@ import simtk.openmm as mm
import simtk.openmm.app as app import simtk.openmm.app as app
# ParmEd Imports # ParmEd Imports
from chemistry.amber import AmberParm from parmed import load_file, unit as u
from chemistry.openmm.reporters import StateDataReporter, NetCDFReporter from parmed.openmm import StateDataReporter, NetCDFReporter
from chemistry import unit as u
# Load the Amber files # Load the Amber files
print('Loading AMBER files...') print('Loading AMBER files...')
ala5_gas = AmberParm('ala5_gas.parm7', 'ala5_gas.rst7') ala5_gas = load_file('ala5_gas.parm7', 'ala5_gas.rst7')
# Create the OpenMM system # Create the OpenMM system
print('Creating OpenMM System') print('Creating OpenMM System')
......
...@@ -8,13 +8,12 @@ import simtk.openmm as mm ...@@ -8,13 +8,12 @@ import simtk.openmm as mm
import simtk.openmm.app as app import simtk.openmm.app as app
# ParmEd Imports # ParmEd Imports
from chemistry.amber import AmberParm from parmed import load_file, unit as u
from chemistry.openmm.reporters import StateDataReporter, NetCDFReporter from parmed.openmm import StateDataReporter, NetCDFReporter
from chemistry import unit as u
# Load the Amber files # Load the Amber files
print('Loading AMBER files...') print('Loading AMBER files...')
ala2_solv = AmberParm('ala2_solv.parm7', 'ala2_solv.rst7') ala2_solv = load_file('ala2_solv.parm7', 'ala2_solv.rst7')
# Create the OpenMM system # Create the OpenMM system
print('Creating OpenMM System') print('Creating OpenMM System')
......
...@@ -8,15 +8,15 @@ import simtk.openmm as mm ...@@ -8,15 +8,15 @@ import simtk.openmm as mm
import simtk.openmm.app as app import simtk.openmm.app as app
# ParmEd Imports # ParmEd Imports
from chemistry.charmm import CharmmPsfFile, CharmmCrdFile, CharmmParameterSet from parmed import load_file, unit as u
from chemistry.openmm import StateDataReporter from parmed.charmm import CharmmParameterSet
from chemistry import unit as u from parmed.openmm import StateDataReporter
# Load the CHARMM files # Load the CHARMM files
print('Loading CHARMM files...') print('Loading CHARMM files...')
params = CharmmParameterSet('toppar/par_all36_prot.prm') params = CharmmParameterSet('toppar/par_all36_prot.prm')
ala5_gas = CharmmPsfFile('ala5_autopsf.psf') ala5_gas = load_file('ala5_autopsf.psf')
ala5_crds = app.PDBFile('ala5_autopsf.pdb') ala5_crds = load_file('ala5_autopsf.pdb')
# NOTE NOTE # NOTE NOTE
# The parameter set we used here is the CHARMM 36 force field, but this is # The parameter set we used here is the CHARMM 36 force field, but this is
......
...@@ -8,16 +8,16 @@ import simtk.openmm as mm ...@@ -8,16 +8,16 @@ import simtk.openmm as mm
import simtk.openmm.app as app import simtk.openmm.app as app
# ParmEd Imports # ParmEd Imports
from chemistry.charmm import CharmmPsfFile, CharmmCrdFile, CharmmParameterSet from parmed import load_file, unit as u
from chemistry.openmm.reporters import StateDataReporter from parmed.charmm import CharmmParameterSet
from chemistry import unit as u from parmed.openmm import StateDataReporter
# Load the CHARMM files # Load the CHARMM files
print('Loading CHARMM files...') print('Loading CHARMM files...')
params = CharmmParameterSet('toppar/par_all36_prot.prm', params = CharmmParameterSet('toppar/par_all36_prot.prm',
'toppar/toppar_water_ions.str') 'toppar/toppar_water_ions.str')
ala2_solv = CharmmPsfFile('ala2_charmmgui.psf') ala2_solv = load_file('ala2_charmmgui.psf')
ala2_crds = CharmmCrdFile('ala2_charmmgui.crd') ala2_crds = load_file('ala2_charmmgui.crd')
# NOTE NOTE # NOTE NOTE
# The parameter set we used here is the CHARMM 36 force field, but this is # The parameter set we used here is the CHARMM 36 force field, but this is
......
...@@ -8,14 +8,13 @@ import simtk.openmm as mm ...@@ -8,14 +8,13 @@ import simtk.openmm as mm
import simtk.openmm.app as app import simtk.openmm.app as app
# ParmEd Imports # ParmEd Imports
from chemistry import load_file from parmed import load_file
from chemistry.openmm.reporters import NetCDFReporter from parmed.openmm.reporters import NetCDFReporter
from chemistry import unit as u from parmed import unit as u
# Load the Gromacs files # Load the Gromacs files
print('Loading Gromacs files...') print('Loading Gromacs files...')
top = load_file('dhfr_gas.top') top = load_file('dhfr_gas.top', xyz='dhfr_gas.gro')
gro = load_file('dhfr_gas.gro')
# Create the OpenMM system # Create the OpenMM system
print('Creating OpenMM System') print('Creating OpenMM System')
...@@ -40,7 +39,7 @@ prop = dict(CudaPrecision='mixed') # Use mixed single/double precision ...@@ -40,7 +39,7 @@ prop = dict(CudaPrecision='mixed') # Use mixed single/double precision
sim = app.Simulation(top.topology, system, integrator, platform, prop) sim = app.Simulation(top.topology, system, integrator, platform, prop)
# Set the particle positions # Set the particle positions
sim.context.setPositions(gro.positions) sim.context.setPositions(top.positions)
# Minimize the energy # Minimize the energy
print('Minimizing energy') print('Minimizing energy')
......
...@@ -8,17 +8,13 @@ import simtk.openmm as mm ...@@ -8,17 +8,13 @@ import simtk.openmm as mm
import simtk.openmm.app as app import simtk.openmm.app as app
# ParmEd Imports # ParmEd Imports
from chemistry import load_file from parmed import load_file
from chemistry.openmm.reporters import NetCDFReporter from parmed.openmm.reporters import NetCDFReporter
from chemistry import unit as u from parmed import unit as u
# Load the Gromacs files # Load the Gromacs files
print('Loading Gromacs files...') print('Loading Gromacs files...')
top = load_file('dhfr_pme.top') top = load_file('dhfr_pme.top', xyz='dhfr_pme.gro')
gro = load_file('dhfr_pme.gro')
# Transfer the unit cell information from the GRO file to the top object
top.box = gro.box[:]
# Create the OpenMM system # Create the OpenMM system
print('Creating OpenMM System') print('Creating OpenMM System')
...@@ -43,7 +39,7 @@ prop = dict(CudaPrecision='mixed') # Use mixed single/double precision ...@@ -43,7 +39,7 @@ prop = dict(CudaPrecision='mixed') # Use mixed single/double precision
sim = app.Simulation(top.topology, system, integrator, platform, prop) sim = app.Simulation(top.topology, system, integrator, platform, prop)
# Set the particle positions # Set the particle positions
sim.context.setPositions(gro.positions) sim.context.setPositions(top.positions)
# Minimize the energy # Minimize the energy
print('Minimizing energy') print('Minimizing energy')
......
...@@ -8,7 +8,7 @@ from simtk.openmm.app import * ...@@ -8,7 +8,7 @@ from simtk.openmm.app import *
from simtk.unit import * from simtk.unit import *
# ParmEd imports # ParmEd imports
from chemistry import load_rosetta from parmed import load_rosetta
# PyRosetta imports # PyRosetta imports
from toolbox import mutate_residue from toolbox import mutate_residue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment