Page 1 of 3 1 2 3 >
Topic Options
#324 - 10/23/03 06:31 AM merge-orient-trajectory.inp
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
*FILENAME: merge-orient-trajectory.inp
*PURPOSE: merge trajectories, orienting wrt initial protein coordinates, and removing solvent
*AUTHOR: Lennart Nilsson, Karolinska Institutet, October 2003
*
!unix environment variable CHM_HOME points to CHARMM installation directory
read rtf card name $CHM_HOME/toppar/top_all22_prot.inp
read para card name $CHM_HOME/toppar/par_all22_prot.inp
read psf card name my_psf.psf
read coor card name my_reference.crd
! put reference coordinates into comparison set as well
coor copy comp
! Initial trajectory
open unit 51 read unform name traj_1.cor
open unit 52 read unform name traj_2.cor
! New, merged trajectory
open unit 81 write unform name traj_orient_nosolv.cor

merge first 51 nunit 2 output 81 skip 500 - ! one frame/ps is all we need
sele segid prot end orient mass sele segid prot .and. .not. hydrogen end
! first selection picks up those atoms that will be written to new trajectory
! second selection is used in the least squares re-orienting of each frame

! save new psf that is compatible with the new trajectory
delete atom sele .not. segid prot end

write psf card name new_psf.psf
* psf after deleting everything but the protein segment
*
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top
#31906 - 05/13/13 10:27 PM Re: merge-orient-trajectory.inp [Re: lennart]
swmmr1928 Offline
Forum Member

Registered: 10/07/12
Posts: 24
I only want to remove water. Can I remove these lines:

sele segid prot end orient mass sele segid prot .and. .not. hydrogen end
! first selection picks up those atoms that will be written to new trajectory
! second selection is used in the least squares re-orienting of each frame

Top
#31907 - 05/14/13 02:31 AM Re: merge-orient-trajectory.inp [Re: lennart]
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
No.
This is the merge command you need:
merge first 51 nunit 2 output 81 skip 500 sele segid prot end
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top
#31908 - 05/14/13 08:10 AM Re: merge-orient-trajectory.inp [Re: lennart]
swmmr1928 Offline
Forum Member

Registered: 10/07/12
Posts: 24
Thanks.
Can the trajectory be .dcd (NAMD) instead of .cor ?

Top
#31909 - 05/14/13 08:27 AM Re: merge-orient-trajectory.inp [Re: lennart]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
File extensions are not important for CHARMM, only VMD, and for that app, .cor implies a formatted coordinate file, not a trajectory.

If the trajectory you wish to process has a protein and the initial PSF was not made with CHARMM and exported as an X-PLOR PSF, there may be problems, esp. with any subsequent analysis using CHARMM.
_________________________
Rick Venable
computational chemist


Top
#31970 - 05/22/13 11:18 PM Re: merge-orient-trajectory.inp [Re: lennart]
swmmr1928 Offline
Forum Member

Registered: 10/07/12
Posts: 24
I want to merge 94 trajectory files, but this cannot be done in one script without exceeding 99 unit numbers. I merged into 3 parts and then tried to merge the 3 parts. The default skip is 2ooo, but I changed it to 8ooo because I want it compressed.

I get an error when combining the files:
"At line 959 of file dynio.f
Fortran runtime error: End of file"

The script to combine


stream toppar.str

read psf card name "/export/lustre_1/dpc/sim1/w-dpc-1.psf"
open unit 2 card read name "/export/lustre_1/dpc/sim1/w-dpc-1.pdb"
read coor pdb resid unit 2

! put reference coordinates into comparison set as well
coor copy comp

open unit 50 read unform name traj_part1.cor
open unit 51 read unform name traj_part2.cor
open unit 52 read unform name traj_part3.cor

open unit 40 write unform name traj_part1_2_3.cor

merge first 50 nunit 3 output 40 skip 8000

Top
#31971 - 05/23/13 02:33 AM Re: merge-orient-trajectory.inp [Re: lennart]
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
You can open more than 99 files; I recommend starting with unit numbers above 100.

The error message you get means that there is less data in one of the three files than what is indicated in its header. Are the files OK? Perhaps something went wrong in the preceding merge?

It is best to post the complete output.
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top
#31976 - 05/23/13 09:14 PM Re: merge-orient-trajectory.inp [Re: lennart]
swmmr1928 Offline
Forum Member

Registered: 10/07/12
Posts: 24
In that case i will use the units above 100 and avoid this idea. The problem maybe was skipping.

One more question:
Say i merge X trajectories-default skip is 2ooo, but I use 32ooo. I load in VMD and it shows a total of 1438 frames. At frame 600, something interesting happens. What trajectory file did this occur in?
(600/1438)*X

Top
#31977 - 05/23/13 10:45 PM Re: merge-orient-trajectory.inp [Re: lennart]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
The number of frames per file is needed.

It's easier to determine if (requested_SKIP/default_SKIP) divides evenly into the number of frames per file.
_________________________
Rick Venable
computational chemist


Top
#31978 - 05/24/13 11:54 AM Re: merge-orient-trajectory.inp [Re: rmv]
swmmr1928 Offline
Forum Member

Registered: 10/07/12
Posts: 24
VMD shows 250 frames per trajectory (unmodified trajectory)

Top
Page 1 of 3 1 2 3 >

Moderator:  chmgr, John Legato, petrella