Matrix2png
From Christoph's Personal Wiki
- The correct title of this article is matrix2png. The initial letter is capitalized due to technical restrictions.
matrix2png is a simple but powerful programme for making visualizations of microarray data and many other data types. It generates PNG formatted images from text files of data. It is fast, easy to use, and reasonably flexible. It can be used to generate publication-quality images, or to act as a image generator for web applications. It is useful for imaging all kinds of matrix-based data, not just microarray data. Matrix2png is open source.
Contents
Usage
-data <file>
- (required)
-desctext <file>
- (optional)
-range
- values assigned to mincolor and maxcolor as min:max (default is data range)
-con
- contrast (default = 1.0; applies only when not using -range option)
-size
- pixel dimensions per value as x:y (default = 2:2)
-numcolors
- number of colours (default = 64)
-minsize
- minimum image size as x:y pixels
-mincolor
- colour used at lowest value (name or r:g:b triplet) (default = blue)
-maxcolor
- colour used at highest value (name or r:g:b triplet) (default = red)
-bkgcolor
- colour used as background (name or r:g:b triplet) (default = white)
-missingcolor
- colour used for missing values (name or r:g:b triplet) (default = grey)
-map
- colour choices from preset maps: overrides min/max colours and -b (default = 0 (none))
-discrete
- Use discretized mapping of values to colors; use -dmap to assign a mapping file
-dmap <mapping file>
- Discrete colour mapping file to use for discrete mapping (default = preset)
-numr
- Number of rows to process starting from the top of the matrix by default
-numc
- Number of columns to process starting from the left edge of the matrix by default
-startrow
- Index of the first row to be processed; can combine with numr (default=1)
-startcol
- Index of the first column to be processed; can combine with numc (default=1)
-trim
- Trim this percent of data extremes when determining data range (only without the -range option)
-verbose
- Verbosity of the output
1|2|3|4|5
(default=2) -title <title>
- Add a title
-z
- Row-normalize the data to mean 0 and variance 1
-b
- Middle of colour range is black
-d
- Add cell dividers
-s
- Add scale bar
-r
- Add row names
-c
- Add column names
-f
- Data file has a format line
-e
- Draw ellipses instead of rectangles
-l
- Log transform the data (base 2)
Example
If, for an example, you have a matrix file ('foo.mat
') that has something like the following matrix:
foo A1 A2 A3 B1 4 3 9 B2 3 2 1 B3 7 5 8
Note: All entries must be tab delimited.
You can convert this to a PNG like so:
matrix2png -data foo.mat -size 18:18 -mincolor darkred -maxcolor white -c -r -s -con 1.0 >foo.png
Reference
- Pavlidis P, Noble WS (2003). Matrix2png: A Utility for Visualizing Matrix Data. Bioinformatics, 19:295-296.
External links
- Official site
- Web interface to matrix2png
- ColorBrewer — colour schemes used in matrix2png