PDBreporter: Write only a Protein to trajectory

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Dennis Della Corte
Posts: 10
Joined: Wed Apr 17, 2019 7:49 am

PDBreporter: Write only a Protein to trajectory

Post by Dennis Della Corte » Fri Mar 20, 2020 8:59 pm

Hello,

Very basic question that I could not find an answer to. How can I tell the PDBreporter to only write out the protein coordinates and omit solvent/ions? My trajectories are unnecessarily large as I do not care about solvent positions.

Thank you,
Dennis

User avatar
Peter Eastman
Posts: 2591
Joined: Thu Aug 09, 2007 1:25 pm

Re: PDBreporter: Write only a Protein to trajectory

Post by Peter Eastman » Sat Mar 21, 2020 4:00 pm

PDBReporter doesn't offer that feature. On the other hand, it's a really simple class. See https://github.com/openmm/openmm/blob/m ... eporter.py. If you want to, it would be really easy to create a modified version that strips out the water. In the constructor, use Modeller.deleteWater() to create a new Topology with all the water removed, and record the indices of the non-water atoms in the original Topology. In report(), use those indices to create a new list of positions to pass to writeModel().

That said, I really don't recommend using PDB for trajectories. DCDReporter produces much smaller files, and it also stores the positions to higher precision.

POST REPLY