code: def catread(args):
      
      p = OptionParser(catread.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) != 2:
          sys.exit(not p.print_help())
  
      r1, r2 = args
      p1fp, p2fp = FastqPairedIterator(r1, r2)
      outfile = pairspf((r1, r2)) + ".cat.fastq"
      fw = must_open(outfile, "w")
      while True:
          a = list(islice(p1fp, 4))
          if not a:
              break
          atitle, aseq, _, aqual = a
          btitle, bseq, _, bqual = list(islice(p2fp, 4))
          print("\n".join((atitle.strip(), aseq.strip() + bseq.strip(), \
                                  "+", aqual.strip() + bqual.strip())), file=fw)
docs: %prog catread fastqfile1 fastqfile2
  
      Concatenate paired end reads into one. Useful for example to do single-end
      mapping and perform filtering on the whole read pair level.