Previous Thread
Next Thread
Print Thread
Post Analysis of openMM trajctory
#38152 01/14/21 05:01 AM
Joined: Nov 2019
Posts: 46
A
Forum Member
OP Offline
Forum Member
A
Joined: Nov 2019
Posts: 46
Hello All,

Is there any way Charmm can read pdb and dcd produced by openMM? The code that Charmm reads pdb and dcd cannot open files of OpenMM. I know there are software like mdtraj for post analysis of trajectory, but only Charmm has an option to measure nonbond interactions between different parts of molecule.

OPEN UNIT 1 FORM READ NAME step3_pbcsetup.psf
READ PSF CARD UNIT 1
CLOSe UNIT 1
OPEN UNIT 1 READ CARD NAME PFF_8cell_last.pdb
READ COOR pdb UNIT 1
CLOSE UNIT 1

open unit 21 read unform name PFF_8cell_10ns.dcd

OPNLGU> Unit 1 cannot be opened as PFF_8CELL_LAST.PDB

***** LEVEL 0 WARNING FROM *****
***** "OPEN" not possible.

Last edited by Allen_123; 01/14/21 05:16 AM.
Re: Post Analysis of openMM trajctory
Allen_123 #38153 01/14/21 07:37 AM
Joined: Nov 2019
Posts: 46
A
Forum Member
OP Offline
Forum Member
A
Joined: Nov 2019
Posts: 46
I figured out this error by changing the file name to pff_8cell_10ns.dcd

Last edited by Allen_123; 01/14/21 11:19 AM.
Re: Post Analysis of openMM trajctory
Allen_123 #38154 01/14/21 08:39 AM
Joined: Sep 2003
Posts: 4,810
Likes: 2
Forum Member
Online Content
Forum Member
Joined: Sep 2003
Posts: 4,810
Likes: 2
The following should also work (note that there is no need to have OPEN and CLOSE commands with READ and WRITE commands):
read psf card name step3_pbcsetup.psf
read coor pdb name "PFF_8cell_last.pdb"
open unit 21 read unform name "PFF_8cell_10ns.dcd"

Using double quotes preserves case in filenames when you read files.


Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden
Re: Post Analysis of openMM trajctory
lennart #38155 01/14/21 11:20 AM
Joined: Nov 2019
Posts: 46
A
Forum Member
OP Offline
Forum Member
A
Joined: Nov 2019
Posts: 46
Thank you for your fast respond.

Another question is how to extract energy from interaction command? For instance, in the following commands, I want to write vdw and elec energy to a file.

open read unit 21 file name pff_8cell_10ns.dcd
traj query unit 21
traj iread 21 nunit 1
set x 1
label loop
traj read
energy
update
SKIP ALL EXCL vdw Elec
interaction select resname phe .and. type C* end sele resname tip3 .and. type OH2 end

Re: Post Analysis of openMM trajctory
Allen_123 #38157 01/14/21 04:27 PM
Joined: Sep 2003
Posts: 8,532
Likes: 2
rmv Online Content
Forum Member
Online Content
Forum Member
Joined: Sep 2003
Posts: 8,532
Likes: 2
The energy doc file has a detailed list of energy terms available via ? substitutions, including ?ELEC and ?VDW, which can be used to write those values to a file:

open read unit 21 file name pff_8cell_10ns.dcd
OPEN UNIT 2 WRITE CARD NAME INTE.TXT
ECHU 2 ! see miscom doc file for echo usage
traj query unit 21
SET COUNT = ?NFILE
traj iread 21 nunit 1
set x 1
label loop
traj read
energy
update
SKIP ALL EXCL vdw Elec
interaction select resname phe .and. type C* end sele resname tip3 .and. type OH2 end
ECHO @X ?VDW ?ELEC
INCR X BY 1
IF X LE @COUNT GOTO LOOP


A more complete list of ? substitutions can be found in the subst doc file. Also, there is no need to read the PDB file for this, the PSF is sufficient for reading DCD files.


Rick Venable
computational chemist


Moderated by  lennart, rmv 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 5.6.33-0+deb8u1 Page Time: 0.028s Queries: 24 (0.021s) Memory: 0.9233 MB (Peak: 1.0127 MB) Data Comp: Off Server Time: 2021-03-05 23:08:28 UTC
Valid HTML 5 and Valid CSS