Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Activate the openmm environment by running the following command in your terminal:

    source activate openmm

  2. Set up a simulation folder for your protein by running the following command:

    python YOUR_OPENAWSEM_LOCATION/mm_create_project.py 1r69 --frag

    If you already have the PDB file for your protein, use the following command instead:

    python YOUR_OPENAWSEM_LOCATION/mm_create_project.py PATH_TO_YOUR_PDB/1r69.pdb --frag

  3. Run the simulation using the following command:

    python mm_run.py 1r69 --platform CPU --steps 1e5 --tempStart 800 --tempEnd 200 -f forces_setup.py

  4. To compute the energy and Q of your protein, run the following command:

    python mm_analysis.py 1r69 > energy.dat

    The qvalue can be found in the second column of energy.dat

    Note: The forces_setup.py file controls which force (energy) terms will be included in the simulation.

    Note 2: If you don't have a GPU available, you may want to consider using http://awsem-md.org. For small proteins, the LAMMPS version could be faster than openAWSEM.

    Note 3: Due to size limitations, the data for the paper "OpenAWSEM with Open3SPN2: a fast, flexible, and accessible framework for large-scale coarse-grained biomolecular simulations" is stored in https://app.globus.org/file-manager?origin_id=b4cef8ce-7773-4016-8513-829f388f7986&origin_path=%2FopenAWSEM_data%2F.

DNA simulations

To simulate a short piece of DNA using open3SPN2, follow these steps:

Import the open3SPN2 module by running the following code:
Copy code
import open3SPN2
If you get a ModuleNotFoundError error, you may need to check that open3SPN2 is in the installation path as detailed in the installation instructions.

After importing the module, initialize the DNA from a sequence using the open3SPN2.DNA.fromSequence method. Here, seq is the sequence of the DNA and dna_type is the type of DNA (can be 'A' or 'B').
Copy code
seq='ATACAAAGGTGCGAGGTTTCTATGCTCCCACG'
dna=open3SPN2.DNA.fromSequence(seq,dna_type='B_curved')
Compute the topology for the DNA structure using the computeTopology method. If the DNA was generated from the sequence using X3DNA, you don't need to recompute the geometry.
Copy code
dna.computeTopology(template_from_X3DNA=False)
Create the system using the open3SPN2.System class. If you want to use periodic boundary conditions, set the periodicBox parameter to the size of the periodic box in nanometers. Otherwise, set periodic to False.
Copy code
dna.periodic=False
s=open3SPN2.System(dna, periodicBox=None)
Add the 3SPN2 forces to the system using the add3SPN2forces method.
Copy code
s.add3SPN2forces(verbose=True)
Import the openmm package and its classes to set up the simulation.
Copy code
import simtk.openmm
import simtk.openmm.app
import simtk.unit
import sys
import numpy as np
Initialize the molecular dynamics simulations using the initializeMD method of the System class. 

Specify the temperature and the platform name (can be 'OpenCL', 'CUDA', 'CPU', or 'Reference') as the arguments.

Copy code
s.initializeMD(temperature=300 * simtk.unit.kelvin, platform_name='OpenCL')
simulation = s.simulation
Set the initial positions of the system using the setPositions method of the Context class.
Copy code
simulation.context.setPositions(s.coord.getPositions())
Compute the total energy of the system using the getState method of the Context class.
Copy code
energy_unit = simtk.openmm.unit.kilojoule_per_mole
state = simulation.context.getState(getEnergy=True)
energy = state.getPotentialEnergy().value_in_unit(energy_unit)
print('TotalEnergy', round(energy, 6), energy_unit.get_symbol())
Compute the detailed energy of the system using the getState method of the Context class.
Copy code
energies = {}
for force_name, force in s.forces.items():
group = force.getForceGroup()
state = simulation.context.getState(getEnergy=True, groups=2**group)
energies[force_name] = state.getPotentialEnergy().value_in_unit(energy_unit)

for force_name in s.forces.keys():
print(force_name, round(energies[force_name], 6), energy_unit.get_symbol())
Make sure that the energies obtained coincide with the energies shown in the example. You can also check the energy obtained using other platforms by changing the platform_name parameter in step 7.

Add simulation reporters to the simulation to output the simulation data to a file.
Copy code
dcd_reporter = simtk.openmm.app.DCDReporter('output.dcd', 1000)
energy_reporter = simtk.openmm.app.StateDataReporter(sys.stdout, 1000, step=True, time=True,
potentialEnergy=True, temperature=True)
simulation.reporters.append(dcd_reporter)
simulation.reporters.append(energy_reporter)
Run the simulation for a specified number of steps using the step method of the Simulation class.
Copy code
simulation.step(10000)
This will run the simulation for 10,000 steps and output the simulation data to the specified file. You can modify the number of steps and the output file name as needed

Protein-DNA simulations

 Detailed instruction for DNA simulations and protein-DNA simulations can be found in https://open3spn2.readthedocs.io/en/latest/tutorial.html.

Running simulations in the CTBP cluster

...