code: def qual(args):
      
      from jcvi.formats.sizes import Sizes
  
      p = OptionParser(qual.__doc__)
      p.add_option("--qv", default=31, type="int",
                   help="Dummy qv score for extended bases")
      p.set_outfile()
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      fastafile, = args
      sizes = Sizes(fastafile)
      qvchar = str(opts.qv)
      fw = must_open(opts.outfile, "w")
      total = 0
      for s, slen in sizes.iter_sizes():
          print(">" + s, file=fw)
          print(" ".join([qvchar] * slen), file=fw)
          total += 1
      fw.close()
      logging.debug("Written {0} records in `{1}`.".format(total, opts.outfile))
docs: %prog qual fastafile
  
      Generate dummy .qual file based on FASTA file.