d63b7e753345e199748030d83e1d3aa497b350f9
braney
  Tue Aug 2 22:24:07 2016 -0700
fix problem in bigPsl with '-' as strand for target sequence #17829

diff --git src/hg/lib/bigPsl.c src/hg/lib/bigPsl.c
index af55dbe..21df363 100644
--- src/hg/lib/bigPsl.c
+++ src/hg/lib/bigPsl.c
@@ -320,18 +320,26 @@
 assert(sizeOne == psl->blockCount);
 sqlUnsignedDynamicArray(row[8], &psl->tStarts, &sizeOne);
 assert(sizeOne == psl->blockCount);
 psl->qStart = sqlSigned(row[9]); 
 psl->qEnd = sqlSigned(row[10]); 
 psl->strand[1] = *row[11];
 psl->strand[2] = 0;
 psl->qSize = sqlSigned(row[12]); 
 sqlUnsignedDynamicArray(row[13], &psl->qStarts, &sizeOne);
 assert(sizeOne == psl->blockCount);
 for(ii=0; ii < psl->blockCount; ii++)
     {
     psl->tStarts[ii] += psl->tStart;
     }
 
+// because reference blocks  are always on the positive strand in beds, we need to revComp them
+// if the alignment is meant to be on the reference's negative strand
+if (psl->strand[1] == '-')
+    {
+    psl->strand[1] = '+';
+    pslRc(psl);
+    }
+
 pslComputeInsertCounts(psl);
 return psl;
 }