code: def simulate(args):
      
      p = OptionParser(simulate.__doc__)
      p.set_outfile()
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      idsfile, = args
      fp = open(idsfile)
      fw = must_open(opts.outfile, "w")
      for row in fp:
          name, size = row.split()
          size = int(size)
          simulate_one(fw, name, size)
      fp.close()
docs: %prog simulate idsfile
  
      Simulate random FASTA file based on idsfile, which is a two-column
      tab-separated file with sequence name and size.