Search found 26 matches

by Marcelo D Poleto
Thu Jan 25, 2024 2:10 pm
Forum: OpenMM
Topic: Recalculate forces on atoms
Replies: 3
Views: 1785

Re: Recalculate forces on atoms

Thanks Peter. I think I stared at the code for so long that I forgot that CHARMM uses Angstrom as default distance unit. That solves the case. One quick question: if by any chance I decide to decompose the forces by ForceGroup, would it make sense to use the code below? forces = simulation.context.g...
by Marcelo D Poleto
Thu Jan 25, 2024 12:53 pm
Forum: OpenMM
Topic: Recalculate forces on atoms
Replies: 3
Views: 1785

Recalculate forces on atoms

Hi, I am trying to recalculate the forces acting on each atom of my system. I am combining OpenMM and MDTraj to 1) build the System, 2) loop over the trajectory frames and 3) extract the array of Forces and slice it to get only a few atoms of interest. Here is my current code for a single frame: pri...
by Marcelo D Poleto
Tue Nov 07, 2023 1:12 pm
Forum: OpenMM
Topic: Gradually reduce the box volume accessible to solute
Replies: 4
Views: 1014

Re: Gradually reduce the box volume accessible to solute

Hi Peter, Thanks for the clarification. It worked very well! I used pretty much all of your suggestions here, but for future reference this is how my code looks like: flat_vol_constant = 100 * (kilojoule_per_mole/nanometer**2) flat_name = "Flat-external-force" external = CustomExternalForce("Kvol*ma...
by Marcelo D Poleto
Sat Nov 04, 2023 10:04 am
Forum: OpenMM
Topic: Gradually reduce the box volume accessible to solute
Replies: 4
Views: 1014

Re: Gradually reduce the box volume accessible to solute

Hi Peter, Your suggestion makes total sense. I will try to implement it and I will come back with the final structure. Could you explain a bit more the rationale behind the expression " maxDist-i*(maxDist-minDist)/1000 "? Also, we will be working with a periodic system not centered at (0,0,0) and th...
by Marcelo D Poleto
Fri Nov 03, 2023 8:45 am
Forum: OpenMM
Topic: Gradually reduce the box volume accessible to solute
Replies: 4
Views: 1014

Gradually reduce the box volume accessible to solute

Hi, The subject is odd, but our lab is studying aggregation patterns of 4-6 peptides in a large box of solvent. We would like to promote several aggregation events and we want to gradually reduce the volume to accessible to the peptides over time. We are trying to design a CustomExternalForce that r...
by Marcelo D Poleto
Mon Apr 10, 2023 11:50 am
Forum: OpenMM
Topic: Loop over trajectory to decompose OpenMM energies
Replies: 7
Views: 678

Re: Loop over trajectory to decompose OpenMM energies

Hi, I just want to update the topic with my final code. I checked that forces from this code matches the forces calculated with the CHARMM software. import simtk.openmm as mm from simtk.openmm import * from simtk.openmm.app import * from simtk.unit import * import mdtraj as md import os, argparse im...
by Marcelo D Poleto
Mon Apr 03, 2023 5:40 pm
Forum: OpenMM
Topic: Loop over trajectory to decompose OpenMM energies
Replies: 7
Views: 678

Re: Loop over trajectory to decompose OpenMM energies

Not really. stru.positions = traj.xyz[frame] AttributeError: can't set attribute I also tried to use: energies = pmd.openmm.energy_decomposition(stru, simulation.context) But I get the following: File "/home/mdpoleto/Documents/Softwares/anaconda3/envs/openmm7.7/lib/python3.9/site-packages/parmed/ope...
by Marcelo D Poleto
Mon Apr 03, 2023 2:24 pm
Forum: OpenMM
Topic: Loop over trajectory to decompose OpenMM energies
Replies: 7
Views: 678

Re: Loop over trajectory to decompose OpenMM energies

Hi Peter, Thanks for your input and correction. However, I don't see how the Structure object is updated with the new positions. The simulation context is being updated, but I don't think that is being passed to Structure. I tested your suggestion with the code below: top = 'ala.c36.psf' coord = 'al...
by Marcelo D Poleto
Mon Apr 03, 2023 12:38 pm
Forum: OpenMM
Topic: Loop over trajectory to decompose OpenMM energies
Replies: 7
Views: 678

Loop over trajectory to decompose OpenMM energies

Hi, I want to loop over a MD trajectory written by OpenMM to get the decomposed energy groups and write them to a file. I am using ParmEd's (pmd.openmm.energy_decomposition_system()) to read a single coordinate file as shown below: top = 'ala.c36.psf' coord = 'ala.c36.crd' traj = '100frames.dcd' psf...
by Marcelo D Poleto
Tue Aug 09, 2022 11:08 am
Forum: OpenMM
Topic: Flat-bottom potential
Replies: 10
Views: 337

Re: Flat-bottom potential

Of course. Thank you Peter. This has now been solved.