Commit 471bea82 authored by Lee-Ping Wang's avatar Lee-Ping Wang
Browse files

Merge branch 'master' of github.com:SimTk/openmm

parents c5bc333f 02adeefa
...@@ -2026,6 +2026,7 @@ void ReferenceIntegrateCustomStepKernel::initialize(const System& system, const ...@@ -2026,6 +2026,7 @@ void ReferenceIntegrateCustomStepKernel::initialize(const System& system, const
// Create the computation objects. // Create the computation objects.
dynamics = new ReferenceCustomDynamics(system.getNumParticles(), integrator); dynamics = new ReferenceCustomDynamics(system.getNumParticles(), integrator);
SimTKOpenMMUtilities::setRandomNumberSeed((unsigned int) integrator.getRandomNumberSeed());
vector<ReferenceCCMAAlgorithm::AngleInfo> angles; vector<ReferenceCCMAAlgorithm::AngleInfo> angles;
findAnglesForCCMA(system, angles); findAnglesForCCMA(system, angles);
constraints = new ReferenceCCMAAlgorithm(system.getNumParticles(), numConstraints, constraintIndices, constraintDistances, masses, angles, (RealOpenMM)integrator.getConstraintTolerance()); constraints = new ReferenceCCMAAlgorithm(system.getNumParticles(), numConstraints, constraintIndices, constraintDistances, masses, angles, (RealOpenMM)integrator.getConstraintTolerance());
......
...@@ -8,7 +8,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of ...@@ -8,7 +8,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org. Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2012 Stanford University and the Authors. Portions copyright (c) 2012-2013 Stanford University and the Authors.
Authors: Christopher M. Bruns Authors: Christopher M. Bruns
Contributors: Peter Eastman Contributors: Peter Eastman
...@@ -139,6 +139,7 @@ class PdbStructure(object): ...@@ -139,6 +139,7 @@ class PdbStructure(object):
self.models_by_number = {} self.models_by_number = {}
self._unit_cell_dimensions = None self._unit_cell_dimensions = None
self.sequences = [] self.sequences = []
self.modified_residues = []
# read file # read file
self._load(input_stream) self._load(input_stream)
...@@ -178,6 +179,8 @@ class PdbStructure(object): ...@@ -178,6 +179,8 @@ class PdbStructure(object):
if len(self.sequences) == 0 or chain_id != self.sequences[-1].chain_id: if len(self.sequences) == 0 or chain_id != self.sequences[-1].chain_id:
self.sequences.append(Sequence(chain_id)) self.sequences.append(Sequence(chain_id))
self.sequences[-1].residues.extend(pdb_line[19:].split()) self.sequences[-1].residues.extend(pdb_line[19:].split())
elif (pdb_line.find("MODRES") == 0):
self.modified_residues.append(ModifiedResidue(pdb_line[16], int(pdb_line[18:22]), pdb_line[12:15].strip(), pdb_line[24:27].strip()))
self._finalize() self._finalize()
def write(self, output_stream=sys.stdout): def write(self, output_stream=sys.stdout):
...@@ -278,6 +281,14 @@ class Sequence(object): ...@@ -278,6 +281,14 @@ class Sequence(object):
self.chain_id = chain_id self.chain_id = chain_id
self.residues = [] self.residues = []
class ModifiedResidue(object):
"""ModifiedResidue holds information about a modified residue, as specified by a MODRES record."""
def __init__(self, chain_id, number, residue_name, standard_name):
self.chain_id = chain_id
self.number = number
self.residue_name = residue_name
self.standard_name = standard_name
class Model(object): class Model(object):
"""Model holds one model of a PDB structure. """Model holds one model of a PDB structure.
......
...@@ -36,7 +36,8 @@ import sys ...@@ -36,7 +36,8 @@ import sys
import math import math
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
from copy import copy from copy import copy
from simtk.openmm import Vec3 from datetime import date
from simtk.openmm import Vec3, Platform
from simtk.openmm.app.internal.pdbstructure import PdbStructure from simtk.openmm.app.internal.pdbstructure import PdbStructure
from simtk.openmm.app import Topology from simtk.openmm.app import Topology
from simtk.unit import nanometers, angstroms, is_quantity, norm, Quantity from simtk.unit import nanometers, angstroms, is_quantity, norm, Quantity
...@@ -242,6 +243,7 @@ class PDBFile(object): ...@@ -242,6 +243,7 @@ class PDBFile(object):
- topology (Topology) The Topology defining the molecular system being written - topology (Topology) The Topology defining the molecular system being written
- file (file=stdout) A file to write the file to - file (file=stdout) A file to write the file to
""" """
print >>file, "REMARK 1 CREATED WITH OPENMM %s, %s" % (Platform.getOpenMMVersion(), str(date.today()))
boxSize = topology.getUnitCellDimensions() boxSize = topology.getUnitCellDimensions()
if boxSize is not None: if boxSize is not None:
size = boxSize.value_in_unit(angstroms) size = boxSize.value_in_unit(angstroms)
......
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