code: def mcscanq(args):
      
      p = OptionParser(mcscanq.__doc__)
      p.add_option("--color", help="Add color highlight, used in plotting")
      p.add_option("--invert", default=False, action="store_true",
                   help="Invert query and subject [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) < 2:
          sys.exit(not p.print_help())
  
      qids, blocksfile = args
      b = BlockFile(blocksfile)
      fp = open(qids)
      for gene in fp:
          gene = gene.strip()
          for line in b.query_gene(gene, color=opts.color, invert=opts.invert):
              print(line)
docs: %prog mcscanq query.ids blocksfile
  
      Query multiple synteny blocks to get the closest alignment feature. Mostly
      used for 'highlighting' the lines in the synteny plot, drawn by
      graphics.karyotype and graphics.synteny.