TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It is very common in biology to draw diagrams like the one below to show regulatory interactions between genes:

enter image description here

You can see that this is essentially a graph, with 3 key elements:

  • Nodes, which can be gene names (eg. lin-1) or events (vulval fates).
  • Positive (activating) edges, shown by arrows (often green), which indicate that a gene induces the other.
  • Negative (inhibitory) edges, shown by stubbly lines (often red), which indicate that a gene represses the other.

Sometimes, it may be necessary to make the edges very long or curved (when the two genes are far away). Occasionally, dotted or dashed edges can be used to show putative or proposed relationships.

Arrows may sometimes point to other arrows, eg. when a gene A enhances the ability of gene B to activate gene C. A slightly less trivial example:

enter image description here

The above is the bare minimum of what I want to do. Obviously, the layout of the graph is a whole different can of worms, but let's ignore that for now and assume that the user will manually layout the nodes.

Extra credit

It is possible to make such diagrams much more complicated, to emphasize nuances in manner of regulation (transcriptional, post-translational, localization, direct vs. indirect, etc). Here is a showcase of a proposed symbolic vocabulary from Kohn 2006. Here is another proposed vocabulary from Pirson 2000 and an example usage

share|improve this question
The first is a good question as far as TikZ questions go :) A good example of using styles and simple placement options. The others just simply take time. – Sean Allred May 20 '14 at 2:23
@SeanAllred I think the basic thing I'd like to know is how can I just draw 2-3 gene symbols and a few arrows and stubbly arrows between them (basically, like the first lin/let/vulval fate picture, except even simpler). This is already helpful. – Superbest May 20 '14 at 2:25
Would you be opposed to an edit accordingly? – Sean Allred May 20 '14 at 2:26
@SeanAllred Sure, please go ahead! – Superbest May 20 '14 at 2:27
I would like to see an answer to this using tikz – becko Mar 16 at 11:59
up vote 3 down vote accepted

Here's a Metapost approach to the first diagram. Given how general MP is, you could devise ways to extend it easily.

Gene map

prologues := 3;
outputtemplate := "%j%c.eps";

input boxes;

vardef draw_inhibition(suffix $, $$) = 
  interim ahangle := 180; % to get T-shaped arrows
  interim linecap := butt; % squared ends
  interim linejoin := mitered;
  drawarrow $.c -- $$.c cutbefore bpath $ cutafter bpath $$ 
                        withpen pencircle scaled 2bp 
                        withcolor .67 red;

vardef draw_activation(suffix $, $$) = 
  interim linecap := butt;
  interim linejoin := mitered;
  drawarrow $.c -- $$.c cutbefore bpath $ cutafter bpath $$
                        withpen pencircle  scaled 2bp 
                        withcolor .59 green;


defaultdx := 5; % add some extra space around the names
defaultfont := "phvbo8r"; % bold oblique
defaultfont := "phvb8r"; % bold
boxit.event("vulval fates");

u = 6mm;
ln03.c = ln15.c + (0,2u);
lt23.c = ln15.c + (3u,u);
lt60.c = lt23.c + (3u,0);
ln45.c = lt60.c + (3u,0);
ln01.c = ln45.c + (3u,0);
event.c = ln01.c + (4u,0);

draw pic event withcolor .49 blue; % draw this one in blue

draw_inhibition(ln15, lt23);
draw_activation(ln03, lt23);
draw_activation(lt23, lt60);
draw_activation(lt60, ln45);
draw_inhibition(ln45, ln01);
draw_inhibition(ln01, event);


Update: this version has a slightly saner treatment of the thick arrows, and uses an oblique font as in the OP diagram.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.