195a08fae15bd2ca55f2f2ed11d0c359521efcc4 markd Wed May 17 09:13:21 2023 -0700 added program to convert protein/protein or protein NA PSLs to NA/NA PSLs. The multiplies coordinates by three; trimming any overlapping blocks that might be creates. This is intended to use with pslMap diff --git src/lib/pslTransMap.c src/lib/pslTransMap.c index 7d87231..76f8cbb 100644 --- src/lib/pslTransMap.c +++ src/lib/pslTransMap.c @@ -220,31 +220,31 @@ } static void trimOverlapping(struct psl *mappedPsl, struct block *mappedBlk) /* if this block overlaps the previous block, trim accordingly. Overlaps * can be created with protein to DNA PSLs */ { assertBlockAligned(mappedBlk); assert(mappedPsl->blockCount > 0); // use int so we can go negative int prevQEnd = pslQEnd(mappedPsl, mappedPsl->blockCount - 1); int prevTEnd = pslTEnd(mappedPsl, mappedPsl->blockCount - 1); // trim, possibly setting to zero-length -int overAmt = max((prevQEnd - mappedBlk->qStart), (prevTEnd - mappedBlk->tStart)); +int overAmt = max((prevQEnd - (int)mappedBlk->qStart), (prevTEnd - (int)mappedBlk->tStart)); if (overAmt < 0) overAmt = 0; else if (overAmt > blockLength(mappedBlk)) overAmt = blockLength(mappedBlk); mappedBlk->qStart += overAmt; mappedBlk->tStart += overAmt; } static boolean mapBlock(struct psl *inPsl, struct psl *mapPsl, int *iMapBlkPtr, struct block *align1Blk, struct psl* mappedPsl, int* mappedPslMax) /* Add a PSL block from a ungapped portion of an alignment, mapping it to the * genome. If the started of the inPsl block maps to a part of the mapPsl * that is aligned, it is added as a PSL block, otherwise the gap is skipped.