gp_map - descriptions


[options] [inputfile] [outputfile]


-f font
use font. Allowed values are t (tiny), s (small), m (medium) and g (giant).

do not print sequence names

-r <width>x<height>
set the image size (resolution). Default is "600x400", that 600 pixels wide and 400 pixels high.

-b value
block length in base pairs; that is, how many nucleotides should be drawn on one line.

-m value
start drawing from position value.

-M value
stop drawing after position value.

produce an USEMAP HTML file on standard output; note that in this case you must provide the program with an input and an output file.

Output in HTML mode

Prints the version information.

Do not display error messages

Prints lots of debugging information.

Shows usage information.

file to proces; if not given, will use standard input

file to write the data to; if not given, will use standard output


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:


color value
gene will have color <value>. Note that the color must be defined in the "color" file, located in the current directory, any of the directories found in $GPPATH, or the standard /usr/lib/genpak directory.

the gene will not be an arrow, which means, it will appear as a rectangle on the drawing.

the gene will be drawn on the gene scale, denoting a special region of the sequence (e.g. repetitive sequence)

layer value
sometimes you would like to compare two sequences containing different genes. Using layer, you tell gp_map to draw the given gene below other genes, in another "layer". If it is no specified, the layer is "0".

Lines starting with an '#' or empty are ignored. There should be a file called "" 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">

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


...and end it with </BODY></HTML>. In most cases, you will want to include it directly in a CGI case.

COLOR FILE FORMAT 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 to produce a drawing which will be stored in the file myco.png:

gp_map myco.png

Use the file to produce a drawing stored in myco.png, and make a html file containing an USEMAP description of the drawing:

gp_map -i myco.png > myco.html


/usr/lib/genpak/color the standard color file.


Genpak(1) gp_acc(1) gp_cusage(1) gp_digest(1) gp_dimer(1) gp_findorf(1) gp_gc(1) gp_getseq(1) gp_matrix(1) gp_mkmtx(1) gp_pattern(1) gp_primer(1) gp_qs(1) gp_randseq(1) gp_seq2prot(1) gp_slen(1) gp_tm(1) gp_trimer(1)


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 <>