GithubHelp home page GithubHelp logo

Comments (9)

peastman avatar peastman commented on May 27, 2024

What you described sounds correct. You need to add the correct bonds to your Topology. Then use a ForceField to create a System from it, and call setUsesPeriodicBoundaryConditions(True) on each of the bonded forces in the System.

from openmm.

yjianzhu avatar yjianzhu commented on May 27, 2024

What you described sounds correct. You need to add the correct bonds to your Topology. Then use a ForceField to create a System from it, and call setUsesPeriodicBoundaryConditions(True) on each of the bonded forces in the System.

thanks a lot. I initialize my topology from gromacs topology file. If I bond two atoms, how does the system know the real bond atoms? If the distance is small enough, bond the atoms in the same box. Otherwise, bond the atom with the mirror box?

I tried to list the force of the system by system.getForces() and modify them to setUsesPeriodicBoundaryConditions(True). But it didn't work.

from openmm.

peastman avatar peastman commented on May 27, 2024

How do you create your System? Do you call createSystem() on a GromacsTopFile or a ForceField?

If you create it directly from the Gromacs file, that file needs to describe an infinite molecule with the ends bonded to each other. Modifying the Topology won't affect the System. You'll still get whatever the Gromacs file describes.

I tried to list the force of the system by system.getForces() and modify them to setUsesPeriodicBoundaryConditions(True). But it didn't work.

Please be more specific. What exactly did you do, and what exactly happened? Show your code.

from openmm.

yjianzhu avatar yjianzhu commented on May 27, 2024

How do you create your System? Do you call createSystem() on a GromacsTopFile or a ForceField?

If you create it directly from the Gromacs file, that file needs to describe an infinite molecule with the ends bonded to each other. Modifying the Topology won't affect the System. You'll still get whatever the Gromacs file describes.

I tried to list the force of the system by system.getForces() and modify them to setUsesPeriodicBoundaryConditions(True). But it didn't work.

Please be more specific. What exactly did you do, and what exactly happened? Show your code.

I want to simulate an infinite long DNA chain in the periodic box. The topology file has defined the bonds between the bottom atoms and top atoms. Bond(<Atom 317 (O3') of chain 0 residue 9 (DC)>, <Atom 0 (P) of chain 0 residue 0 (DG)>)

from openmm.

peastman avatar peastman commented on May 27, 2024

You didn't answer the questions. See my post above.

from openmm.

yjianzhu avatar yjianzhu commented on May 27, 2024

You didn't answer the questions. See my post above.

from openmm.app import *
from openmm import *
from openmm.unit import *
from sys import stdout
from parmed.openmm import load_topology

forcefield = ForceField( 'amber14/tip3pfb.xml',"amber14/DNA.OL15.xml")

pdb = PDBFile('2dna.pdb')


gmx_top_2 = GromacsTopFile('topol.top')
print(type(gmx_top_2.topology))

modeller = Modeller(gmx_top_2.topology, pdb.positions)
modeller.addSolvent(forcefield, model='tip3p', ionicStrength=0.15 * molar,boxSize=Vec3(8, 8, 3.375)*nanometers)
system = forcefield.createSystem(modeller.topology, nonbondedMethod=PME, nonbondedCutoff=1.0*nanometer, constraints=HBonds)
integrator = LangevinMiddleIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
simulation = Simulation(modeller.topology, system, integrator)
simulation.context.setPositions(modeller.positions)

from openmm.

yjianzhu avatar yjianzhu commented on May 27, 2024

You didn't answer the questions. See my post above.

Refer to the code provided above. If the simulation is executed in that manner, the bond Bond(<Atom 317 (O3') of chain 0 residue 9 (DC)>, <Atom 0 (P) of chain 0 residue 0 (DG)>) will link the two atoms within the same box. I hope that the bond can automatically connect the nearest atoms within the periodic boxes.

from openmm.

peastman avatar peastman commented on May 27, 2024

Immediately after creating the System (and before creating the Simulation), you need to call setUsesPeriodicBoundaryConditions(True) on each of the bonded forces in it. Otherwise the bond will connect atoms within the same periodic copy.

from openmm.

yjianzhu avatar yjianzhu commented on May 27, 2024

Immediately after creating the System (and before creating the Simulation), you need to call setUsesPeriodicBoundaryConditions(True) on each of the bonded forces in it. Otherwise the bond will connect atoms within the same periodic copy.

Thanks a lot. I made a mistake in that I set setUsesPeriodicBoundaryConditions(True) before the simulation.

from openmm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.