code: def cyntenator(args):
      
      p = OptionParser(cyntenator.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) < 2:
          sys.exit(not p.print_help())
  
      lastfile = args[0]
      fp = open(lastfile)
      filteredlastfile = lastfile + ".blast"
      fw = open(filteredlastfile, "w")
      for row in fp:
          b = BlastLine(row)
          if b.query == b.subject:
              continue
          print("\t".join((b.query, b.subject, str(b.score))), file=fw)
      fw.close()
  
      bedfiles = args[1:]
      fp = open(lastfile)
      b = BlastLine(next(fp))
      subject = b.subject
      txtfiles = []
      for bedfile in bedfiles:
          order = Bed(bedfile).order
          if subject in order:
              db = op.basename(bedfile).split(".")[0][:20]
              logging.debug("Found db: {0}".format(db))
          txtfile = write_txt(bedfile)
          txtfiles.append(txtfile)
  
      db += ".txt"
      mm = MakeManager()
      for txtfile in txtfiles:
          outfile = txtfile + ".alignment"
          cmd = 'cyntenator -t "({0} {1})" -h blast {2} > {3}'\
                  .format(txtfile, db, filteredlastfile, outfile)
          mm.add((txtfile, db, filteredlastfile), outfile, cmd)
      mm.write()
docs: %prog cyntenator athaliana.athaliana.last athaliana.bed
  
      Prepare input for Cyntenator.