e4b95e1845f752954f388a0c61b7d4a107baa80a braney Wed May 27 18:02:07 2020 -0700 don't count frameshifts as small introns diff --git src/hg/lib/variantProjector.c src/hg/lib/variantProjector.c index 760c347..24b367f 100644 --- src/hg/lib/variantProjector.c +++ src/hg/lib/variantProjector.c @@ -75,31 +75,31 @@ } // Google search on "minimal intron size" turned up a study of shortest known introns, ~48-50 in // most species surveyed at the time. #define MIN_INTRON 45 static boolean pslIntronTooShort(struct psl *psl, int blkIx, int minIntronSize) /* Return TRUE if the target gap between blkIx and blkIx+1 is too short to be a plausible intron. */ { if (blkIx >= psl->blockCount - 1 || blkIx < 0) errAbort("pslIntronTooShort: %s blkIx %d is out of range [0, %d]", psl->qName, blkIx, psl->blockCount - 1); int tGapLen = psl->tStarts[blkIx+1] - psl->tStarts[blkIx] - psl->blockSizes[blkIx]; int qGapLen = psl->qStarts[blkIx+1] - psl->qStarts[blkIx] - psl->blockSizes[blkIx]; int intronLen = tGapLen - qGapLen; -return (intronLen < minIntronSize); +return (intronLen > 0) && (intronLen < minIntronSize); } void vpPosGenoToTx(uint gOffset, struct psl *txAli, struct vpTxPosition *txPos, boolean isTxEnd) /* Use txAli to project gOffset onto transcript-relative coords in txPos. * Set isTxEnd to TRUE if we are projecting to the end coordinate in transcript space: * higher genomic coord if transcript on '+' strand, lower genomic coord if tx on '-' strand. */ { ZeroVar(txPos); txPos->gOffset = gOffset; boolean isRc = (pslQStrand(txAli) == '-'); // Coordinate transforms of start and end coordinates can be done the same way, but // when determining which region of the transcript the variant falls in, we need to // treat the open end differently (looking backward) from the closed start (looking forward). int endCmp = (isTxEnd != isRc) ? 1 : 0; int gOffsetCmp = gOffset - endCmp;