      GenomeLocation genomeLocation,
      Direction direction,
      bool secondaryAlignment,
-@@ -1249,7 +1250,38 @@ SAMFormat::writeRead(
+@@ -1249,7 +1250,43 @@ SAMFormat::writeRead(
              readGroupString = read->getReadGroup();
          }
      }

         qnameLen, read->getId(),
         flags,
         contigName,
@@ -1263,7 +1295,10 @@ SAMFormat::writeRead(
         fullLength, quality,
         aux != NULL ? "\t" : "", auxLen, aux != NULL ? aux : "",
         readGroupSeparator, readGroupString,

         *spaceUsed = bamSize;
diff -rupN -x Xcode -x .git tmp/snap/SNAPLib/BaseAligner.cpp snap/SNAPLib/BaseAligner.cpp
--- tmp/snap/SNAPLib/BaseAligner.cpp	2015-07-28 15:15:02.000000000 -0400
+++ snap/SNAPLib/BaseAligner.cpp	2015-08-05 11:13:27.000000000 -0400
@@ -289,7 +289,7 @@ Return Value:
     primaryResult->score = UnusedScoreValue;
     primaryResult->status = NotFound;
 
-    unsigned lookupsThisRun = 0;
+    lookupsThisRun = hitsThisRun = 0;
 
     popularSeedsSkipped = 0;
 
@@ -471,6 +471,7 @@ Return Value:
 
         nHashTableLookups++;
         lookupsThisRun++;
+        hitsThisRun += (nHits[FORWARD] + nHits[RC]);
 
 
 #ifdef  _DEBUG
@@ -764,6 +765,17 @@ Return Value:
                 primaryResult->score = bestScore;
                 if (bestScore <= maxK) {
                     primaryResult->location = bestScoreGenomeLocation;
+					float hitsPerLookup = (float)hitsThisRun / lookupsThisRun;
+					primaryResult->features.init(bestScore,
+												 secondBestScore,
+												 probabilityOfAllCandidates,
+												 probabilityOfBestCandidate,
+												 popularSeedsSkipped,
+												 0,
+												 lookupsThisRun,
+												 0,
+												 hitsPerLookup,
+												 0);
                     primaryResult->mapq = computeMAPQ(probabilityOfAllCandidates, probabilityOfBestCandidate, bestScore, popularSeedsSkipped);
                     if (primaryResult->mapq >= MAPQ_LIMIT_FOR_SINGLE_HIT) {
                         primaryResult->status = SingleHit;
diff -rupN -x Xcode -x .git tmp/snap/SNAPLib/BaseAligner.h snap/SNAPLib/BaseAligner.h
--- tmp/snap/SNAPLib/BaseAligner.h	2015-07-28 15:15:02.000000000 -0400
+++ snap/SNAPLib/BaseAligner.h	2015-08-05 11:12:27.000000000 -0400
@@ -136,6 +136,9 @@ private:
     _int64 nReadsIgnoredBecauseOfTooManyNs;
     _int64 nIndelsMerged;
 
+	unsigned lookupsThisRun;
+	_int64 hitsThisRun;
+
     //
     // A bitvector indexed by offset in the read indicating whether this seed is used.
     // This is here to avoid doing a memory allocation in the aligner.
diff -rupN -x Xcode -x .git tmp/snap/SNAPLib/ChimericPairedEndAligner.cpp snap/SNAPLib/ChimericPairedEndAligner.cpp
--- tmp/snap/SNAPLib/ChimericPairedEndAligner.cpp	2015-07-28 15:15:02.000000000 -0400
+++ snap/SNAPLib/ChimericPairedEndAligner.cpp	2015-08-05 09:03:57.000000000 -0400
