code: def pairs(args):
      
      from jcvi.assembly.preprocess import run_FastbAndQualb2Fastq
  
      p = OptionParser(pairs.__doc__)
      p.add_option("--header", default=False, action="store_true",
              help="Print header only [default: %default]")
      p.add_option("--suffix", default=False, action="store_true",
                   help="Add suffix /1, /2 to read names")
      opts, args = p.parse_args(args)
  
      if len(args) != 2:
          sys.exit(not p.print_help())
  
      pairsfile, fastqfile = args
      pf = op.basename(fastqfile).split(".")[0]
      p = PairsFile(pairsfile)
      print(p.header, file=sys.stderr)
  
      if opts.header:
          return
  
      if fastqfile.endswith(".fastb"):
          fastbfile = fastqfile
          fastqfile = fastbfile.replace(".fastb", ".fastq")
          run_FastbAndQualb2Fastq(infile=fastbfile, outfile=fastqfile)
  
      p1file = "{0}.1.corr.fastq"
      p2file = "{0}.2.corr.fastq"
      fragsfile = "{0}.corr.fastq"
      p1fw = [open(p1file.format(x), "w") for x in p.libnames]
      p2fw = [open(p2file.format(x), "w") for x in p.libnames]
      fragsfw = open(fragsfile.format(pf), "w")
  
      extract_pairs(fastqfile, p1fw, p2fw, fragsfw, p, suffix=opts.suffix)
docs: %prog pairs pairsfile <fastbfile|fastqfile>
  
      Parse ALLPATHS pairs file, and write pairs IDs and single read IDs in
      respective ids files: e.g. `lib1.pairs.fastq`, `lib2.pairs.fastq`,
      and single `frags.fastq` (with single reads from lib1/2).