gromacs xpm eps文件查看

gromacs xpm eps文件查看,第1张

xpm文件矩阵格式,删除上方的注释后,可以用Irfanview打开,But没有注释Label,没有xy轴label,而且颜色也不好(黑白,而且感觉不到80level),需要采用gromacs xpm2ps转换成eps文件查看。

EPS免费软件:EPS Viewer

注意:xpm2ps关于设置矩阵在画布上的位置和离画布边距离有bug,一般无法把标题和标注显示全,不要在参数文件调,直接在别的画图软件手动拼接!!

首先,需要提供一个参数文件 -di  rmsdpara.m2p

然后 用xpm2ps命令将xpm文件转化为eps文件

gmx_mpi xpm2ps -f rmsd.xpm -di rmsdpara.m2p -o rmsd.eps -rainbow blue

一个矩阵的m2p文件(rmsd.xpm):

linewidth= 6 

titlefont                = Arial //标题字符类型

titlefontsize            = 80 //标题字符大小

legend                  = yes //显示legend

legendfont              = Arial //legend字符类型,u sed when there is none in the .xpm

legendlabel              = RMSD (nm) //legend 名字,

legend2label            = // when merging two xpm's

legendfontsize          = 66  //legend字符大小

xbox                    = 10 // x-size of a matrix element 该值的大小影响画布的大小,得到的像素*像素的值改变,当xbox和ybox设置的值一样时,矩阵正方形,不一样时,是长方形

ybox                    = 10

matrixspacing            = 20  // Space between 2 matrices

xoffset                  = 300  // Between matrix and bounding box控制矩阵左边离box边的距离,同时改变x size,例如本来是2600*3400,当设置xoffset为300,则变成了2300*3400,左边离画布边的留白变小300,但是右边离画布边没有任何变化!真是bug!但是可以通过左边留白,把标题放左边

yoffset                  = 300 //控制矩阵下面离box边的距离

boxlinewidth            = 20 //box边框的宽度

ticklinewidth            = 8 //标度tick的宽度

zerolinewidth            = 0 

x-lineat0value          = none //  Draw line at matrix value==0

x-major                  = 20 //x轴大分隔符间距为20,根据自己的数值设定

x-minor                  = 10 //x轴小分隔符间距为20,一般设置为major的一半

x-firstmajor            = 0  // Offset for major tick 调节第一个标度从?开始

x-majorat0              = no  //  Additional Major tick at first frame

x-majorticklen          = 30 //大标度tick的长度

x-minorticklen          = 25 //小标度tick的长度

x-label                  = Time (ns)  //x轴标题

x-fontsize              = 66 //x轴标题字体大小

x-font                  = Arial //x轴标题字体类型 (Time (ns))

x-tickfontsize          = 60 //x轴标度数字大小(0,20,40...) 我发现设置为60时大小刚好,但是!右侧的最后一个数值显示不全,如上图所示,200被截断 了,只显示20,怎么调画布都不行,是个bug!自己画图时需要自己手动补全

x-tickfont              = Arial   //x轴标度数字类型

y-lineat0value          = none

y-major                  = 20 

y-minor                  = 10

y-firstmajor            = 0

y-majorat0              = no

y-majorticklen          = 30

y-minorticklen          = 25

y-label                  = Time (ns)

y-fontsize              = 66

y-font                  = Arial

y-tickfontsize          = 60

black&white              = no

y-tickfont              = Arial

gmx xpm2ps [-f [<.xpm>]] [-f2 [<.xpm>]] [-di [<.m2p>]] [-do [<.m2p>]]

          [-o [<.eps>]] [-xpm [<.xpm>]] [-[no]w] [-[no]frame]

          [-title <enum>] [-[no]yonce] [-legend <enum>] [-diag <enum>]

          [-size <real>] [-bx <real>] [-by <real>] [-rainbow <enum>]

          [-gradient <vector>] [-skip <int>] [-[no]zeroline]

          [-legoffset <int>] [-combine <enum>] [-cmin <real>] [-cmax <real>]

DESCRIPTION

gmx xpm2ps makes a beautiful color plot of an XPixelMap file. Labels and axis can be displayed, when they are supplied in the correct matrix format. Matrix data may be generated by programs such as gmx do_dssp, gmx rms or gmx mdmat.

When no .m2p file is supplied, many settings are taken from command line options. The most important option is -size , which sets the size of the whole matrix in postscript units. This option can be overridden with the -bx and -by options (and the corresponding parameters in the .m2p file), which set the size of a single matrix element.

With -f2 a second matrix file can be supplied. Both matrix files will be read simultaneously and the upper left half of the first one (-f) is plotted together with the lower right half of the second one (-f2) . The diagonal will contain values from the matrix file selected with -diag. 

Plotting of the diagonal values can be suppressed altogether by setting -diag to none. In this case, a new color map will be generated with a red gradient for negative numbers and a blue for positive.对角线值默认显示的是左上矩阵,可以通过-diag变为右下矩阵。

 If the color coding and legend labels of both matrices are identical, only one legend will be displayed, else two separate legends are displayed. 

OPTIONS

Options to specify input files:

-f      [<.xpm>]          (root.xpm)

          X PixMap compatible matrix file

-f2    [<.xpm>]          (root2.xpm)      (Opt.) //第二个矩阵

          X PixMap compatible matrix file

-di    [<.m2p>]          (ps.m2p)        (Opt., Lib.) //参数文件

          Input file for mat2ps

Parameters are set in the .m2p file optionally supplied with -di. Reasonable defaults are provided. Settings for the y-axis default to those for the x-axis. Font names have a defaulting hierarchy: titlefont ->legendfonttitlefont ->(xfont ->yfont ->ytickfont) ->xtickfont, e.g. setting titlefont sets all fonts, setting xfont sets yfont, ytickfont and xtickfont.

Options to specify output files:

-do    [<.m2p>]          (out.m2p)        (Opt.)

          Input file for mat2ps

-o      [<.eps>]          (plot.eps)      (Opt.)

          Encapsulated PostScript (tm) file

-xpm    [<.xpm>]          (root.xpm)      (Opt.) //可以输出一个彩色的或merge的新矩阵

          X PixMap compatible matrix file

Merged  or  rainbowed matrices  can be written to an XPixelMap file with the -xpm option.

Other options:

-[no]w                    (no)

          View output .xvg, .xpm, .eps and .pdb files

-[no]frame                (yes)

          Display frame, ticks, labels, title and legend

-title  <enum>            (top) //更改标题显示的位置,尝试过更改为ylabel,还是不显示,矩阵离边框的距离设置太bug

          Show title at: top, once, ylabel, none

-title can be set to none to suppress the title, or to ylabel to show the title in the Y-label position (alongside the y-axis).

-[no]yonce                (no)

          Show y-label only once

-legend <enum>            (both)

          Show legend: both, first, second, none

-diag  <enum>            (first) //对角线数值默认来自第一个

          Diagonal: first, second, none

-size  <real>            (400) 

          Horizontal size of the matrix in ps units

-bx    <real>            (0) 

          Element x-size, overrides -size (also y-size when -by is not set)

-by    <real>            (0)

          Element y-size

-rainbow <enum>            (no)

          Rainbow colors, convert white to: no, blue, red

With the -rainbow option, dull grayscale matrices can be turned into attractive color pictures.

-gradient <vector>        (0 0 0)

          Re-scale colormap to a smooth gradient from white {1,1,1} to

          {r,g,b}

-skip  <int>              (1)

          only write out every nr-th row and column

-[no]zeroline              (no) 

          insert line in .xpm matrix where axis label is zero

-legoffset <int>          (0)

          Skip first N colors from .xpm file for the legend

-combine <enum>            (halves) //当xpm中有两个矩阵的时候,结合模式默认为一半一半

          Combine two matrices: halves, add, sub, mult, div

With -combine, an alternative operation can be selected to combine the matrices. The output range is automatically set to the actual range of the combined matrix. This can be overridden with -cmin and -cmax.

-cmin  <real>            (0)

          Minimum for combination output

-cmax  <real>            (0)

          Maximum for combination output

总结

gmx rms -f *.xtc -s *.tpr -o *_rmsd.xvg -m *_rmsd.xpm -tu ns

gmx rmsf  -f *.xtc  -s *.tpr  -oq *_bfactor.pdb(默认写到-s文件中,或者用-q提供一个新的pdb写入bfactor) -o *_rmsf.xvg -res(一定要加,否则算的是atom的)

几个概念:rmsd vs rmsf vs rmsdist

RMSD 是对原子总数求平均, RMSF 是对单个原子时间求平均

RMSD表示的是分子结构变化的程度,而RMSF值表示的是分子中各个原子运动的自由程度

rmsd

计算的是某个结构(N个原子)相对于参考结构(-s指定)的 root mean square deviation

rmsf

计算的是一个原子在一段时间的平均,和bfactor有关

rmsdist 计算的是原子i和j直接的距离随时间的变化大小,rmsd算的是原子i相对自己的位置变化大小

OPTIONS

Options to specify input files:

-s      [<.tpr/.gro/...>]  (topol.tpr) //参考结构reference structure

          Structure+mass(db): tpr gro g96 pdb brk ent

The reference structure is taken from the structure file (-s).

-f      [<.xtc/.trr/...>]  (traj.xtc)

          Trajectory: xtc trr cpt gro g96 pdb tng

Each structure from a trajectory (-f) is compared to a reference structure.

-f2    [<.xtc/.trr/...>]  (traj.xtc)      (Opt.) //算矩阵的时候,默认是第一个trj和第一个trj每一帧计算rmsd,用-f2则是第一个trj和第二个trj每一帧比较rmsd

          Trajectory: xtc trr cpt gro g96 pdb tng

With -f2, the 'other structures' are taken from a second trajectory, this generates a comparison matrix of one trajectory versus the other.

-n      [<.ndx>]          (index.ndx)      (Opt.)

          Index file

Options to specify output files:

-o      [<.xvg>]          (rmsd.xvg)

          xvgr/xmgr file

-mir    [<.xvg>]          (rmsdmir.xvg)    (Opt.) // the mirror image of the reference structure 不需要

          xvgr/xmgr file

With option -mir also a comparison with the mirror image of the reference structure is calculated. This is useful as a reference for 'significant' values, see Maiorov &Crippen, Proteins 22, 273 (1995).

-a      [<.xvg>]          (avgrp.xvg)      (Opt.) 不需要

          xvgr/xmgr file

-dist  [<.xvg>]          (rmsd-dist.xvg)  (Opt.)   不需要

          xvgr/xmgr file

-m      [<.xpm>]          (rmsd.xpm)      (Opt.)

          X PixMap compatible matrix file

Option -m produces a matrix in .xpm format of comparison values of each structure in the trajectory with respect to each other structure . This file can be visualized with for instance xv and can be converted to postscript with gmx xpm2ps.

-bin    [<.dat>]          (rmsd.dat)      (Opt.)

          Generic data file

Option -bin does a binary dump of the comparison matrix .

-bm    [<.xpm>]          (bond.xpm)      (Opt.) //角度的矩阵

          X PixMap compatible matrix file

Option -bm produces a matrix of average bond angle deviations analogously to the -m option. Only bonds between atoms in the comparison group are considered.

Other options:

-b      <time>            (0)

          Time of first frame to read from trajectory (default unit ps)

-e      <time>            (0)

          Time of last frame to read from trajectory (default unit ps)

-dt    <time>            (0)

          Only use frame when t MOD dt = first time (default unit ps)

-tu    <enum>            (ps)

          Unit for time values: fs, ps, ns, us, ms, s

-[no]w                    (no)

          View output .xvg, .xpm, .eps and .pdb files

-xvg    <enum>            (xmgrace)

          xvg plot formatting: xmgrace, xmgr, none

-what  <enum>            (rmsd)

          Structural difference measure: rmsd, rho, rhosc

gmx rms compares two structures by computing the root mean square deviation (RMSD), the size-independent rho similarity parameter (rho) or the scaled rho (rhosc), see Maiorov &Crippen, Proteins 22, 273 (1995). This is selected by -what

-[no]pbc                  (yes)

          PBC check

-fit    <enum>            (rot+trans) //默认rot+trans,不需要

          Fit to reference structure: rot+trans, translation, none

Option -fit controls the least-squares fitting of the structures on top of each other: complete fit (rotation and translation), translation only, or no fitting at all.

-prev  <int>              (0) //而不是ref 

          Compare with previous frame

Option -prev produces the comparison with a previous frame the specified number of frames ago.

-[no]split                (no)

          Split graph where time is zero

-skip  <int>              (1)

          Only write every nr-th frame to matrix

-skip2  <int>              (1)

          Only write every nr-th frame to matrix

-max    <real>            (-1)

          Maximum level in comparison matrix

-min    <real>            (-1)

          Minimum level in comparison matrix

-bmax  <real>            (-1)

          Maximum level in bond angle matrix

-bmin  <real>            (-1)

          Minimum level in bond angle matrix

-[no]mw                    (yes) 不需要

          Use mass weighting for superposition

Option -mw controls whether mass weighting is done or not. If you select the option (default) and supply a valid .tpr file masses will be taken from there, otherwise the masses will be deduced from the atommass.dat file in GMXLIB. This is fine for proteins, but not necessarily for other molecules. A default mass of 12.011 amu (carbon) is assigned to unknown atoms. You can check whether this happened by turning on the -debug flag and inspecting the log file.

-nlevels <int>            (80) //xpm为的z分80个level,不需要改

          Number of levels in the matrices

-ng    <int>              (1) //意思可能是可以算两个grp的rms

          Number of groups to compute RMS between

OPTIONS

Options to specify input files:

-f      [<.xtc/.trr/...>]  (traj.xtc)

          Trajectory: xtc trr cpt gro g96 pdb tng

-s      [<.tpr/.gro/...>]  (topol.tpr) // a reference frame

          Structure+mass(db): tpr gro g96 pdb brk ent

gmx rmsf computes the root mean square fluctuation (RMSF, i.e. standard deviation) of atomic positions in the trajectory (supplied with -f) after (optionally) fitting to a reference frame (supplied with -s).

-n      [<.ndx>]          (index.ndx)      (Opt.)

          Index file

-q      [<.pdb>]          (eiwit.pdb)      (Opt.)

          Protein data bank file

Options to specify output files:

-oq    [<.pdb>]          (bfac.pdb)      (Opt.) //计算并保存B-factor values到-s提供的结构中 或者 可以用-q提供一个新的pdb结构

          Protein data bank file

With option -oq the RMSF values are converted to B-factor values, which are written to a .pdb file. By default, the coordinates in this output file are taken from the structure file provided with -s,although you can also use coordinates read from a different .pdb file provided with -q. There is very little error checking, so in this caseit is your responsibility to make sure all atoms in the structure file and .pdb file correspond exactly to each other.

-ox    [<.pdb>]          (xaver.pdb)      (Opt.) //计算并保存B-factor values到平均结构中

          Protein data bank file

Option -ox writes the B-factors to a file with the average coordinates in the trajectory.

-o      [<.xvg>]          (rmsf.xvg)

          xvgr/xmgr file

-od    [<.xvg>]          (rmsdev.xvg)    (Opt.) //和rmsf算出来的一样,没用

          xvgr/xmgr file

With the option -od the root mean square deviation with respect to the reference structure is calculated.

-oc    [<.xvg>]          (correl.xvg)    (Opt.) 

          xvgr/xmgr file

-dir    [<.log>]          (rmsf.log)      (Opt.)

          Log file

With option -dir the average MSF (3x3) matrix is diagonalized. This shows the directions in which the atoms fluctuate the most and the least.

Other options:

-b      <time>            (0)

          Time of first frame to read from trajectory (default unit ps)

-e      <time>            (0)

          Time of last frame to read from trajectory (default unit ps)

-dt    <time>            (0)

          Only use frame when t MOD dt = first time (default unit ps)

-[no]w                    (no)

          View output .xvg, .xpm, .eps and .pdb files

-xvg    <enum>            (xmgrace)

          xvg plot formatting: xmgrace, xmgr, none

-[no]res                  (no) //一定要

          Calculate averages for each residue

-[no]aniso                (no) //各向异性温度因子

          Compute anisotropic termperature factors

With the option -aniso, gmx rmsf will compute anisotropic temperature factors and then it will also output average coordinates and a .pdb file with ANISOU records (corresonding to the -oq or -ox option). Please note that the U values are orientation-dependent, so before comparison with experimental data you should verify that you fit to the experimental coordinates. When a .pdb input file is passed to the program and the -aniso flag is set a correlation plot of the Uij will be created, if any anisotropic temperature factors are present in the .pdb file.

使用-aniso选项,gmx rmsf将计算各向异性温度因子,然后它还将输出平均坐标和带有ANISOU记录的.pdb文件(与-oq或-ox选项相对应)。请注意U值是与方向相关的,因此在与实验数据进行比较之前,您应该验证您是否适合实验坐标。当将.pdb输入文件传递给程序并设置-aniso标志时,如果.pdb文件中存在任何各向异性温度因子,则会创建Uij的相关图。

-[no]fit                  (yes)

          Do a least squares superposition before computing RMSF. Without this you must make sure that the reference structure and the trajectory match.

computes the root mean square deviation of atom distances , which has the advantage that no fit is needed like in standard RMS deviation as computed by gmx rms. The reference structure is taken from the structure file.

The RMSD at time t is calculated as the RMS of the differences in distance between atom-pairs in the reference structure and the structure at time t.

gmx rmsdist can also produce matrices of the rms distances , rms distances scaled with the mean distance and the mean distances and matrices with NMR averaged distances (1/r^3 and 1/r^6 averaging). Finally, lists of atom pairs with 1/r^3 and 1/r^6 averaged distance below the maximum distance (-max, which will default to 0.6 in this case) can be generated, by default averaging over equivalent hydrogens (all triplets of hydrogens named *[123]).

OPTIONS

Options to specify input files:

-f      [<.xtc/.trr/...>]  (traj.xtc)

          Trajectory: xtc trr cpt gro g96 pdb tng

-s      [<.tpr/.gro/...>]  (topol.tpr)

          Structure+mass(db): tpr gro g96 pdb brk ent

-n      [<.ndx>]          (index.ndx)      (Opt.)

          Index file

-equiv  [<.dat>]          (equiv.dat)      (Opt.)

          Generic data file

 Additionally a list of equivalent atoms can be supplied ( -equiv), each line containing a set of equivalent atoms specified as residue number and name and atom name 

e.g.: HB* 3 SER  HB1 3 SER  HB2. //可能第一列要给距离命名

Residue and atom names must exactly match those in the structure file, including case. Specifying non-sequential atoms is undefined.

此外,还可以提供等效原子列表(-equiv),每行包含一组等效原子,这些原子指定为残基编号和名称以及原子名称例如:HB* 3 SER HB1 3 SER HB2。残基编号和原子名称必须与结构文件中的名称完全匹配,包括case。未定义指定非顺序原子。

Options to specify output files:

-o      [<.xvg>]          (distrmsd.xvg)

          xvgr/xmgr file

-rms    [<.xpm>]          (rmsdist.xpm)    (Opt.)

          X PixMap compatible matrix file

-scl    [<.xpm>]          (rmsscale.xpm)  (Opt.)

          X PixMap compatible matrix file

-mean  [<.xpm>]          (rmsmean.xpm)    (Opt.)

          X PixMap compatible matrix file

-nmr3  [<.xpm>]          (nmr3.xpm)      (Opt.)

          X PixMap compatible matrix file

-nmr6  [<.xpm>]          (nmr6.xpm)      (Opt.)

          X PixMap compatible matrix file

-noe    [<.dat>]          (noe.dat)        (Opt.)

          Generic data file

Other options:

-b      <time>            (0)

          Time of first frame to read from trajectory (default unit ps)

-e      <time>            (0)

          Time of last frame to read from trajectory (default unit ps)

-dt    <time>            (0)

          Only use frame when t MOD dt = first time (default unit ps)

-[no]w                    (no)

          View output .xvg, .xpm, .eps and .pdb files

-xvg    <enum>            (xmgrace)

          xvg plot formatting: xmgrace, xmgr, none

-nlevels <int>            (40)

          Discretize RMS in this number of levels

-max    <real>            (-1)

          Maximum level in matrices

-[no]sumh                  (yes)

          Average distance over equivalent hydrogens

-[no]pbc                  (yes)

          Use periodic boundary conditions when computing distances

首先是需要用来着色的轨迹文件,单帧或多帧的都行,文件名为dump.pdb 这里要说明一下:文件名的后缀必须是VMD能识别的,建议使用pdb格式或xyz格式的(VMD默认就能打开的格式)。

打开VMD,成功导入轨迹文件或分子文件,VMD main窗口,filesave coordinatesSelected atoms 选择 all;File type选择 pdb,或xyz。Frames下面用默认的就行。格式转换后的文件存在VMD的安装主目录下。

其次为用于给原子着色的数据文件,就是想让原子按哪些数值显示颜色,命名为user.data 数据文件的名字无所谓,但其格式有要求,数据文件里的数值只有单一的一列,而且从第一个值到最后一个值必须与轨迹文件中的原子一一对应,数值之间不能空行。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/tougao/12008526.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-20
下一篇2023-05-20

发表评论

登录后才能评论

评论列表(0条)

    保存