CPPTRAJ作为PTRAJ的继任者,拥有比PTRAJ更强大的功能,本教程会简要的介绍CPPTRAJ的用法及注意事项。
需要的文件:
Loading a Topology and Trajectory
使用cpptraj命令可以打开cpptraj,log文件可以在cpptraj.log中找到。
$ cpptraj
CPPTRAJ: Trajectory Analysis. V16.16
___ ___ ___ ___
| \/ | \/ | \/ |
_|_/\_|_/\_|_/\_|_
| Date/time: 03/01/19 11:14:02
| Available memory: 393.146 MB
>
# 载入拓扑文件(topology file)
> parm trpzip2.ff10.mbondi.parm7
# 可以使用list parm命令查看刚刚载入的拓扑文件,详细信息使用parminfo命令查看
> list parm
PARAMETER FILES: 0: 'trpzip2.ff10.mbondi.parm7', 220 atoms, 13 res, box: None, 1 mol
> parminfo 0
Topology trpzip2.ff10.mbondi.parm7 contains 220 atoms. 13 residues. 1 molecules. 227 bonds (104 to H, 123 other). 402 angles (233 with H, 169 other). 853 dihedrals (481 with H, 372 other). Box: None GB radii set: modified Bondi radii (mbondi)
# 载入NetCDF格式的轨迹文件(trajetory file)
>trajin trpzip2.gb.nc
Reading 'trpzip2.gb.nc' as Amber NetCDF
# 同样,可以使用list trajin命令查看刚刚载入的轨迹文件
> list trajin
INPUT TRAJECTORIES: 0: 'trpzip2.gb.nc' is a NetCDF AMBER trajectory, Parm trpzip2.ff10.mbondi.parm7 (reading 1201 of 1201) Coordinate processing will occur on 1201 frames.
Specifying an Action
> help distance
[<name>] <mask1> <mask2> [out <filename>] [geom] [noimage] [type noe]
Options for 'type noe':
[bound <lower> bound <upper>] [rexp <expected>] [noe_strong] [noe_medium] [noe_weak]
Calculate distance between atoms in <mask1> and <mask2>
> resinfo
#Res Name First Last Natom #Orig 1 SER 1 13 13 1 2 TRP 14 37 24 2 3 THR 38 51 14 3 4 TRP 52 75 24 4 5 GLU 76 90 15 5 6 ASN 91 104 14 6 7 GLY 105 111 7 7 8 LYS 112 133 22 8 9 TRP 134 157 24 9 10 THR 158 171 14 10 11 TRP 172 195 24 11 12 LYS 196 217 22 12 13 NHE 218 220 3 13
> atominfo :13
#Atom Name #Res Name #Mol Type Charge Mass GBradius El 218 N 13 NHE 1 N -0.4630 14.0100 1.5500 N 219 HN1 13 NHE 1 H 0.2315 1.0080 1.3000 H 220 HN2 13 NHE 1 H 0.2315 1.0080 1.3000 H
> distance end-to-end :1 :13 out dist-end-to-end.agr
DISTANCE: :1 to :13, center of mass.
> list actions
ACTIONS: 0: [distance end-to-end :1 :13 out dist-end-to-end.agr]
Processing the Trajectory
# 前面的action操作是不会执行的,需要使用run命令或者go命令来执行,执行内容包括导入拓扑文件及轨迹文件,根据action (distance)处理轨迹文件,产生DATASETS及结果文件DATAFILES(dist-end-to-end.agr)等。
> run
---------- RUN BEGIN ------------------------------------------------- PARAMETER FILES: 0: 'trpzip2.ff10.mbondi.parm7', 220 atoms, 13 res, box: None, 1 mol, 1201 frames INPUT TRAJECTORIES: 0: 'trpzip2.gb.nc' is a NetCDF AMBER trajectory, Parm trpzip2.ff10.mbondi.parm7 (reading 1201 of 1201) Coordinate processing will occur on 1201 frames. TIME: Run Initialization took 0.0000 seconds.
BEGIN TRAJECTORY PROCESSING: ..................................................... ACTION SETUP FOR PARM 'trpzip2.ff10.mbondi.parm7' (1 actions): 0: [distance end-to-end :1 :13 out dist-end-to-end.agr] :1 (13 atoms) to :13 (3 atoms), imaging off.
----- trpzip2.gb.nc (1-1201, 1) ----- 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Complete.
Read 1201 frames and processed 1201 frames. TIME: Trajectory processing: 0.0094 s TIME: Avg. throughput= 127372.9982 frames / second. ACTION OUTPUT: DATASETS: 1 data set: end-to-end "end-to-end" (double, distance), size is 1201 DATAFILES: dist-end-to-end.agr (Grace File): end-to-end ---------- RUN END ---------------------------------------------------
# 可以直接在CPPTRAJ里执行xmgrace查看结果
> xmgrace dist-end-to-end.agr
...
Working With Data Sets
# 我们可以对前面产生的DATASET进行处理,如前面产生的”end-to-end“,我们可以使用writedata命令把数据写成标准列格式。
> writedata end-to-end.dat end-to-end
end-to-end
# 同样,我们可以直接在CPPTRAJ中使用linux的head命令,对数据进行查看。
> head end-to-end.dat
#Frame end-to-end 1 6.4251 2 5.9250 3 6.7926 4 6.3125 5 5.7580 6 5.4389 7 6.1086 8 6.5588 9 5.6949
# 最后我们可以使用quit命令退出CPPTRAJ。
>quit
TIME: Total execution time: 131.2112 seconds. -------------------------------------------------------------------------------- To cite CPPTRAJ use: Daniel R. Roe and Thomas E. Cheatham, III, "PTRAJ and CPPTRAJ: Software for Processing and Analysis of Molecular Dynamics Trajectory Data". J. Chem. Theory Comput., 2013, 9 (7), pp 3084-3095.
Running in Batch Mode
# 与tleap一样,我们也可以使用batch模式,直接提交cpptraj的参数文件。
# cpptraj.in
parm trpzip2.ff10.mbondi.parm7 trajin trpzip2.gb.nc distance end-to-end :1 :13 out dist-end-to-end.agr run writedata end-to-end.dat end-to-end
$ cpptraj -i cpptraj.in
原文链接:
http://ambermd.org/tutorials/analysis/tutorial0/index.htm