code: def fromsoap(args):
      
      p = OptionParser(fromsoap.__doc__)
      p.add_option("--type", default="nucleotide_match",
                   help="GFF feature type [default: %default]")
      p.add_option("--source", default="soap",
                  help="GFF source qualifier [default: %default]")
      p.set_fixchrnames(orgn="maize")
      p.set_outfile()
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      soapfile, = args
      pad0 = len(str(sum(1 for line in open(soapfile))))
  
      fw = must_open(opts.outfile, "w")
      fp = must_open(soapfile)
      for idx, line in enumerate(fp):
          if opts.fix_chr_name:
              from jcvi.utils.cbook import fixChromName
              line = fixChromName(line, orgn=opts.fix_chr_name)
  
          atoms = line.strip().split("\t")
          attributes = "ID=match{0};Name={1}".format(str(idx).zfill(pad0), atoms[0])
          start, end = int(atoms[8]), int(atoms[5]) + int(atoms[8]) - 1
          seqid = atoms[7]
  
          print("\t".join(str(x) for x in (seqid, opts.source, opts.type, \
              start, end, ".", atoms[6], ".", attributes)), file=fw)
docs: %prog fromsoap soapfile > gff_file