efba7e00a3e2c79d5714f693eda1a81f23eb479b angie Fri Aug 3 09:11:21 2012 -0700 Code Review #8673 - thanks Tim! diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index c6d5da4..bf1a9c2 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -16591,31 +16591,32 @@ int cdsStart = gene->cdsStart, cdsEnd = gene->cdsEnd; boolean geneIsRc = sameString(gene->strand, "-"); char *geneName = getSymbolForGeneName(geneTable, gene->name); int i, iStart = 0, iEnd = gene->exonCount, iIncr = 1; if (geneIsRc) { iStart = gene->exonCount - 1; iEnd = -1; iIncr = -1; } for (i = iStart; i != iEnd; i += iIncr) { int exonStart = gene->exonStarts[i], exonEnd = gene->exonEnds[i]; if (snpEnd > exonStart && snpStart < exonEnd) { if (snpEnd > cdsStart && snpStart < cdsEnd) printSnp125FunctionInCDS(snp, geneTable, geneTrack, gene, i, geneName); else if (cdsEnd > cdsStart) { - boolean is5Prime = geneIsRc ^ (snpEnd < cdsStart); + boolean is5Prime = ((geneIsRc && (snpStart >= cdsEnd)) || + (!geneIsRc && (snpEnd < cdsStart))); printf(firstTwoColumnsPctS "%s\n", geneTrack, geneName, snpMisoLinkFromFunc((is5Prime) ? "untranslated-5" : "untranslated-3")); } else printf(firstTwoColumnsPctS "%s\n", geneTrack, geneName, snpMisoLinkFromFunc("ncRNA")); } // SO term splice_region_variant applies to first/last 3 bases of exon // and first/last 3-8 bases of intron if ((i > 0 && snpStart < exonStart+3 && snpEnd > exonStart) || (i < gene->exonCount-1 && snpStart < exonEnd && snpEnd > exonEnd-3)) printf(", %s", snpMisoLinkFromFunc("splice_region_variant")); puts("</TD></TR>"); if (i > 0) {