code: def make_matepairs(fastafile):
      
      assert op.exists(fastafile)
  
      matefile = fastafile.rsplit(".", 1)[0] + ".mates"
      if op.exists(matefile):
          logging.debug("matepairs file `{0}` found".format(matefile))
      else:
          logging.debug("parsing matepairs from `{0}`".format(fastafile))
          matefw = open(matefile, "w")
          it = SeqIO.parse(fastafile, "fasta")
          for fwd, rev in zip(it, it):
              print("{0}\t{1}".format(fwd.id, rev.id), file=matefw)
  
          matefw.close()
  
      return matefile
docs: Assumes the mates are adjacent sequence records