gp_map produces on-the-fly gene map graphic files in PNG format. It is especially suitable to draw interactive gene maps in WWW CGI scripts. You have to provide it with a list of genes in a text file, and feed it to the program -- it will draw automagically a diagram representing the gene map. Another file the program needs is a "color" file containing the definitions of the colors you would like to use with your names. The standard color file provided with the distribution contains the basic colors (red, green etc.).
The map files containing a text description of the gene map have conventionally the extension .map. The format is simple: for each gene, you need two numbers -- that is, the genome position at which the gene start and the position of the 3' end. Next you put some additional, optional keywords -- specifying the color, for example. Finally, if you want to see a name of the gene on the diagram, you put the keyword "name". Whatever comes after that will be displayed on the chart. Example:
692 1834 color green url 001 name 001
This will draw a gene ranging from 692 to 1834 bp, in green and you bearing name "001" on the map. The special keyword "url" denotes the link which will be used in the USEMAP file (see below). You can use the following keywords:
stardit()
Lines starting with an '#' or empty are ignored. There should be a file called "myco.map" provided with this distribution -- it contains the description of all ORFs of Mycoplasma pneumoniae.
So you have your nice CGI producing drawings of your favourite genome sequence, and want more: you imagine, one could click on a gene and display, say, the description of this gene. The normal way to do it in WWW is to use an IMAP or USEMAP description embedded in the HTML file like that:
<IMG SRC="some.picture.png" WIDTH=200 HEIGHT=100 USEMAP="#map"> <MAP NAME="map"> <AREA SHAPE="RECT" HREF="001.html" COORDS="81,114,107,128"> <AREA SHAPE="RECT" HREF="002.html" COORDS="108,114,129,128"> <AREA SHAPE="RECT" HREF="003.html" COORDS="132,114,177,128"> </MAP>
In order to achieve this, you have (a) include "url" keywords in your map file (b) use the -i option. The "url something.html" keyword tells gp_map that it should describe this gene with the apriopriate <AREA...> statement, using the provided value as the referred link. The -i option tells the program that it should store the graphics into a file, and produce the HTML description on the stdout. Note that the HTML code appearing on the standard output is incomplete: it contains only the IMG, MAP and AREA statements. Otherwise it would be not suitable for automatic HTML generation, you see. It is enough to prepend the code with something like
<HTML><HEAD><TITLE>bla bla</TITLE></HEAD><BODY>
...and end it with </BODY></HTML>
. In most cases, you will want to include
it directly in a CGI case.
...is very simple. Each line containes four items: three values and a name. The three values denote the proportion of red, green and blue (from 0 to 255), the name will define the color. For example, line
255 0 0 red
...defines the color red. Look at /usr/lib/genpak/color. Lines starting with an '#' or empty are ignored. The file name is always "color" (sorry).
The PNG format is the simple graphic format recommended by the W3C for use in WWW presentations, and though it is not as popular as the proprietary and obsolate GIF format, it is supported by all browsers.
Use the file myco.map to produce a drawing which will be stored in the file myco.png:
gp_map myco.map myco.png
Use the file myco.map to produce a drawing stored in myco.png, and make a html file containing an USEMAP description of the drawing:
gp_map -i myco.map myco.png > myco.html
/usr/lib/genpak/color the standard color file.
All Genpak programs complain in situations you would also complain, like when they cannot find a sequence you gave them or the sequence is not valid.
The Genpak programs do not write over existing files. I have found this feature very useful :-)
I'm sure there are plenty left, so please mail me if you find them. I tried to clean up every bug I could find.
January Weiner III <january@bioinformatics.org>