code: def swap(args):
      
      p = OptionParser(swap.__doc__)
  
      opts, args = p.parse_args(args)
  
      if len(args) < 1:
          sys.exit(not p.print_help())
  
      blastfile, = args
      swappedblastfile = blastfile + ".swapped"
      fp = must_open(blastfile)
      fw = must_open(swappedblastfile, "w")
      for row in fp:
          b = BlastLine(row)
          print(b.swapped, file=fw)
  
      fw.close()
      sort([swappedblastfile])
docs: %prog swap blastfile
  
      Print out a new blast file with query and subject swapped.