0919ab12c7fff4d83613273cad9d7a13b1af668c markd Mon Jun 12 19:29:34 2023 -0700 allow pslMapPostChain handle protein/NA alignments diff --git src/inc/psl.h src/inc/psl.h index aaf2934..3774681 100644 --- src/inc/psl.h +++ src/inc/psl.h @@ -350,27 +350,63 @@ INLINE unsigned pslQEnd(struct psl *psl, int blkIdx) /* return query end for the given block */ { return psl->qStarts[blkIdx] + psl->blockSizes[blkIdx]; } INLINE unsigned pslTEnd(struct psl *psl, int blkIdx) /* return target end for the given block */ { if (pslIsProtein(psl)) return psl->tStarts[blkIdx] + 3 * psl->blockSizes[blkIdx]; else return psl->tStarts[blkIdx] + psl->blockSizes[blkIdx]; } +INLINE unsigned pslQStartForStrand(struct psl *psl, int blkIdx, char strand) +/* return query start for the given block, mapped to specified strand, */ +{ +if (pslQStrand(psl) == strand) + return psl->qStarts[blkIdx]; +else + return psl->qSize - pslQEnd(psl, blkIdx); +} + +INLINE unsigned pslQEndForStrand(struct psl *psl, int blkIdx, char strand) +/* return query end for the given block, mapped to specified strand */ +{ +if (pslQStrand(psl) == strand) + return pslQEnd(psl, blkIdx); +else + return psl->qSize - pslQStart(psl, blkIdx); +} + +INLINE unsigned pslTStartForStrand(struct psl *psl, int blkIdx, char strand) +/* return target start for the given block, mapped to specified strand */ +{ +if (pslTStrand(psl) == strand) + return psl->tStarts[blkIdx]; +else + return psl->tSize - pslTEnd(psl, blkIdx); +} + +INLINE unsigned pslTEndForStrand(struct psl *psl, int blkIdx, char strand) +/* return target end for the given block, mapped to specified strand */ +{ +if (pslTStrand(psl) == strand) + return pslTEnd(psl, blkIdx); +else + return psl->tSize - pslTStart(psl, blkIdx); +} + struct psl* pslClone(struct psl *psl); /* clone a psl */ extern char *pslSortList[5]; void pslSortListByVar(struct psl **pslList, char *sort); /* Sort a list of psls using the method definied in the sort string. */ void pslRemoveFrameShifts(struct psl *psl); /* Remove any frameshits if present. Changes in place, doesn't update statistics in first nine fields. */ #endif /* PSL_H */