code: def ispcr(args):
      
      from jcvi.utils.iter import grouper
  
      p = OptionParser(ispcr.__doc__)
      p.add_option("-r", dest="rclip", default=1, type="int",
              help="pair ID is derived from rstrip N chars [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      fastafile, = args
      ispcrfile = fastafile + ".isPcr"
      fw = open(ispcrfile, "w")
  
      N = opts.rclip
      strip_name = lambda x: x[:-N] if N else str
  
      npairs = 0
      fastaiter = SeqIO.parse(fastafile, "fasta")
      for a, b in grouper(fastaiter, 2):
  
          aid, bid = [strip_name(x) for x in (a.id, b.id)]
          assert aid == bid, "Name mismatch {0}".format((aid, bid))
  
          print("\t".join((aid, str(a.seq), str(b.seq))), file=fw)
          npairs += 1
  
      fw.close()
      logging.debug("A total of {0} pairs written to `{1}`.".\
                    format(npairs, ispcrfile))
docs: %prog ispcr fastafile
  
      Reformat paired primers into isPcr query format, which is three column
      format: name, forward, reverse