code: def fromaligns(args):
      
      p = OptionParser(fromaligns.__doc__)
      p.set_outfile()
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      alignsfile, = args
      fp = must_open(alignsfile)
      fw = must_open(opts.outfile, "w")
      for row in fp:
          if row.startswith("## Alignment"):
              print("###", file=fw)
              continue
          if row[0] == '#' or not row.strip():
              continue
          atoms = row.split(':')[-1].split()
          print("\t".join(atoms[:2]), file=fw)
      fw.close()
docs: %prog fromaligns out.aligns
  
      Convert aligns file (old MCscan output) to anchors file.