# gp_map

## GP

## 2000

## NAME

gp_map - descriptions

## SYNOPSIS

[options] [inputfile] [outputfile]

## OPTIONS

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

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

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

-H
  Output in HTML mode

-v
  Prints the version information.

-q
  Do not display error messages

-d
  Prints lots of debugging information.

-h
  Shows usage information.

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

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

## DESCRIPTION

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

## MAP FILE FORMAT

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

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.

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

region
  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 "myco.map" provided with this distribution -- it contains the description of all ORFs of Mycoplasma pneumoniae.

  ## USEMAP FILE

  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.

  ## COLOR FILE FORMAT

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

  ## NOTES

  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.

  ## EXAMPLES

  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`

  ## FILES

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

  ## SEE ALSO

  Genpak(1) gp_acc(1) gp_adjust(1) gp_cdndev(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)

  ## DIAGNOSTICS

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

  ## BUGS

  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.

  ## AUTHOR

  January Weiner III <january@bioinformatics.org>