Events News Research CBS CBS Publications Bioinformatics
Staff Contact About Internal CBS CBS Other

MatrixPlot 1.2: MatrixPlot manual

Introduction Data format User matrix Mutual Nucl Mutual Prot Dist matrix

Inform pdb2mp MatrixPlot zoom

MatrixPlot - display a matrix of an mp file.
MatrixPlot [options] mpfile
MatrixPlot produces a high quality matrix plot of the data listed in the mp file following the given specifications. The program is written in nawk and options must be written by entire variable names, for example MatrixPlot colorgrain=y mpfile. The output is generated to stdout and is written in postscript. Data can be piped to MatrixPlot.
File. Contains the color specifications and the intervals for which the "val" of the "M" rows in the mp file are to be colored. The rows in the mp file "M x y val" imply that at position (x,y) in the matrix plot, a color is displayed according to the specifications in scalefile. The scalefile consist of a number of rows (limited to 50 on the web page) and four columns, all numbers. The first column specify an a lower value for which val is converted to an RGB color specified by three remaining columns. An example is a color scale suited for interatomic distances:
               4    1.00  0.00  0.00
               10   1.00  0.40  0.00
               20   1.00  0.90  0.00
               30   0.60  0.90  0.10
               40   0.20  0.70  0.10
               50   0.00  0.30  0.10
               60   0.00  0.45  0.50
               70   0.00  0.20  0.60
               85   0.00  0.00  0.40
The last number "85" can be replaced by a string such as "max" and the plot will display "max" rather than "85". The scalefile must be given.
Linearly interpolate the RGB colors specified in the scale file. Default is n.
The amount of space between the squares in the matrix plot. Default is 0.05.
The interval size for adding a grid on top of the matrix plot. If zero no grid is plotted. Default is 0.
Same as gridsize, but only in horizontal direction. Is not shown if equal zero. Default is "gridsize".
Same as gridsize, but only in vertical direction. Is not shown if equal zero. Default is "gridsize".
The thickness of the grid. Default is 0.05.
The title of the plot.
The size of the title field. Default is 20.
Horizontal position of "title". Default is 35.
Vertical position of "title". Default is 275.
Show the color scale specified in "scalefile". Default is n.
The size of the letters in the color scale. Default is 15.
Horizontal position of the color scale. Default is 35.
Vertical position of the color scale. Default is 50.
Print position numbers along the axes. Default is y.
Position of the numbers along the axes. Positive number moves number upwards in vertical direction and to the left in horizontal direction. Default is 2. (Note that as the default page width is 140, the numbers can be placed on the opposite edges by having numpos=-142.)
Same as numpos, but only in horizontal direction. Default is "numpos".
Default is "numpos".
Same as numpos, but only in vertical direction. Default is 15.
Show sequence logo profile along the edges of the plot. The position of the logo profile is fixed relative to the matrix itself. Default is n.
For the sequence logo profile; show information values that is less than zero due to inclusion of gaps (y). Or rescale (n). For details, see the discussion in the introduction. Default is y.
Show gap frequency profile (on top or under) the sequence logo profile. Default is y.
Show bar that is encoded by val1 in the "B" rows of the mp file; these rows typically having the form "B posno. val1 val2". val1 must be a number ranging from 0-8 both included. Each number is converted to an rgb encoded color. Default is n.
Same as "bars" just for val2. Default is n.
Position of the bars. The numbering is equivalent to that of "numpos". Default is 15.
Same as barpos, just in horizontal direction. Default is value of "barpos".
Number. Same as barpos, just in vertical direction. Default is value "barpos".
Same as "barpos", just for bar2. Default is 25.
Same as "xbarpos", just for bar2. Default is value of "barpos2".
Same as "ybarpos", just for bar2. Default is value of "barpos2".
The thickness of the bar produced by "bars". Default is 5.
The thickness of the bar produced by "bars2". Default is 5.
Show the text of val1 rather than encoding for "bars". Overwrites "bars". Position is specified by xbarpos and ybarpos. Default is n.
Show the text of val2 rather than encoding for "bars2". Overwrites "bars2". Position is specified by xbarpos2 and ybarpos2. Default is n.
Scale the text printed by "stringout". Values less than one scales the text down; values larger than one scales the test up. Default is 1.
As "stringscale", but for "stringout2" Default is 1.
Contract val1 and val2 to one string. An arbitrary number of val's can be add to the "B" rows, e.g., they can have the form "B posno. val1 val2 ..... valn". Default is n.
Print the maximum value found in the matrix plot. Default is n.
Reverse the horizontal direction on the plot. Default is n.
Reverse the vertical direction on the plot. Default is n.
Number. Initial position in horizontal direction.
Number. End position in horizontal direction.
Number. Initial position in vertical direction.
Number. End position in vertical direction.
(zoom options used here causes the entire mp file to be read by MatrixPlot. The program zoom cuts out the specified region of the mp file before it is read by MatrixPlot. For large mp files where only a small region is of interest the zoom program should be applied.)
Set the page width. It is advised that this option only is used together with the "onstring" option. Maximum value: 140. Default is 140.
Show the complementary matrix elements. It is advised that one uses the complementary matrix element options on the programs that generates the mp file. If not, this command will for some zoom options, fail to show the complete specified region of the matrix. Use with CAUTION! Be absolutely sure that your mp file only contains the one part of the matrix, or else ..... Default is n.
Rather than writing all the options listed above on the command line they can be written in a single configuration file only. An example is listed here.
A matrix plot having sequence logo profile:
MatrixPlot scalefile=scaleCol title="Fig (a) Mutual Information" seqlogo=y neg=n maxout=y >

A distance matrix plot having a bar and residue labeling along the edges:

pdb2mp pdbfile | MatrixPlot scalefile=scaleCol bars=y stringout2=y barpos=10 barpos2=20 >
Alternatively write pdb2mp pdbfile > and execute MatrixPlot.

Thanks to Anders G. Pedersen and Dave W. Ussery for feedback on early versions of the program.
Original version by Jan Gorodkin,
Early optimization by Ole Lund.
Program optimized by Hans Henrik Stærfeldt,
Man pages by Jan Gorodkin, April 1999.
MatrixPlot: visualizing sequence constraints. J. Gorodkin, H. H. Stærfeldt, O. Lund, and S. Brunak. Bioinformatics. 15:769-770, 1999. (


Scientific problems:        Technical problems: