code: def cigarWrite(fileHandle, pairwiseAlignment, withProbs=True):
      
      if len(pairwiseAlignment.operationList) == 0:
          logger.info("Writing zero length pairwiseAlignment to file!")
  
      strand1 = "+"
      if not pairwiseAlignment.strand1:
          strand1 = "-"
  
      strand2 = "+"
      if not pairwiseAlignment.strand2:
          strand2 = "-"
  
      fileHandle.write("cigar: %s %i %i %s %s %i %i %s %f" % (pairwiseAlignment.contig2, pairwiseAlignment.start2, pairwiseAlignment.end2, strand2,\
                                                              pairwiseAlignment.contig1, pairwiseAlignment.start1, pairwiseAlignment.end1, strand1,\
                                                              pairwiseAlignment.score))
      if withProbs == True:
          hashMap = { PairwiseAlignment.PAIRWISE_INDEL_Y:'Z',PairwiseAlignment.PAIRWISE_INDEL_X:'Y', PairwiseAlignment.PAIRWISE_MATCH:'X' }
          for op in pairwiseAlignment.operationList:
              fileHandle.write(' %s %i %f' % (hashMap[op.type], op.length, op.score))
      else:
          hashMap = { PairwiseAlignment.PAIRWISE_INDEL_Y:'I',PairwiseAlignment.PAIRWISE_INDEL_X:'D', PairwiseAlignment.PAIRWISE_MATCH:'M' }
          for op in pairwiseAlignment.operationList:
              fileHandle.write(' %s %i' % (hashMap[op.type], op.length))
      fileHandle.write("\n")
docs: Writes out the pairwiseAlignment to the file stream.
  
      Query and target are reversed from normal order.