dccdf29485000ddce07f65a431d52a51ffd158cf
braney
  Wed Nov 16 18:41:22 2016 -0800
add support for protein psls in bigPsl

diff --git src/lib/psl.c src/lib/psl.c
index d30be8a..3be0a3f 100644
--- src/lib/psl.c
+++ src/lib/psl.c
@@ -1074,39 +1074,40 @@
 next = buf;
 
 for (i = 0; i < blockCount; i++)
     {
     seqs[i] = next;
     next += blockSizes[i]+1;
     }
 }
 
 void pslRc(struct psl *psl)
 /* Reverse-complement a PSL alignment.  This makes the target strand explicit. */
 {
 unsigned tSize = psl->tSize, qSize = psl->qSize;
 unsigned blockCount = psl->blockCount, i;
 unsigned *tStarts = psl->tStarts, *qStarts = psl->qStarts, *blockSizes = psl->blockSizes;
+int mult = pslIsProtein(psl) ? 3 : 1;
 
 /* swap strand, forcing target to have an explict strand */
 psl->strand[0] = (psl->strand[0] != '-') ? '-' : '+';
 psl->strand[1] = (psl->strand[1] != '-') ? '-' : '+';
 psl->strand[2] = 0;
 
 for (i=0; i<blockCount; ++i)
     {
-    tStarts[i] = tSize - (tStarts[i] + blockSizes[i]);
+    tStarts[i] = tSize - (tStarts[i] + mult * blockSizes[i]);
     qStarts[i] = qSize - (qStarts[i] + blockSizes[i]);
     }
 reverseUnsigned(tStarts, blockCount);
 reverseUnsigned(qStarts, blockCount);
 reverseUnsigned(blockSizes, blockCount);
 if (psl->qSequence != NULL)
     {
     rcSeqs(psl->qSequence, blockCount, blockSizes);
     rcSeqs(psl->tSequence, blockCount, blockSizes);
     }
 }
 
 
 /* macro to swap to variables */
 #define swapVars(a, b, tmp) ((tmp) = (a), (a) = (b), (b) = (tmp))