code: def agp(args):
      
      from jcvi.formats.agp import OO
  
      p = OptionParser(agp.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      sizesfile, = args
      sizes = Sizes(sizesfile)
      agpfile = sizes.filename.rsplit(".", 1)[0] + ".agp"
      fw = open(agpfile, "w")
      o = OO()  # Without a filename
      for ctg, size in sizes.iter_sizes():
          o.add(ctg, ctg, size)
  
      o.write_AGP(fw)
      fw.close()
      logging.debug("AGP file written to `{0}`.".format(agpfile))
  
      return agpfile
docs: %prog agp <fastafile|sizesfile>
  
      Convert the sizes file to a trivial AGP file.