code: def gff(args):
      
      align_choices = ("left", "center", "right")
      p = OptionParser(gff.__doc__)
      p.add_option("--align", default="left", choices=align_choices,
                   help="Horizontal alignment [default: %default]")
      p.add_option("--noUTR", default=False, action="store_true",
                   help="Do not plot UTRs [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) < 1:
          sys.exit(not p.print_help())
  
      fig = plt.figure(1, (8, 5))
      root = fig.add_axes([0, 0, 1, 1])
  
      gffiles = args
      ngenes = len(gffiles)
  
      canvas = .6
      setups, ratio = get_setups(gffiles, canvas=canvas, noUTR=opts.noUTR)
      align = opts.align
      xs = .2 if align == "left" else .8
      yinterval = canvas / ngenes
      ys = .8
      tip = .01
      for genename, mrnabed, cdsbeds in setups:
          ExonGlyph(root, xs, ys, mrnabed, cdsbeds, ratio=ratio, align=align)
          if align == "left":
              root.text(xs - tip, ys, genename, ha="right", va="center")
          elif align == "right":
              root.text(xs + tip, ys, genename, ha="left", va="center")
          ys -= yinterval
  
      root.set_xlim(0, 1)
      root.set_ylim(0, 1)
      root.set_axis_off()
  
      figname = "exons.pdf"
      savefig(figname, dpi=300)
docs: %prog gff *.gff
  
      Draw exons for genes based on gff files. Each gff file should contain only
      one gene, and only the "mRNA" and "CDS" feature will be drawn on the canvas.