d08b94fcff0787dd853676e631364945c4986bfe
max
Sun Jun 14 09:21:03 2026 -0700
ading p. notation to mouseover, no redmine yet
diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index c2fc00ab771..3203fa63434 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -2996,38 +2996,38 @@
int w = ex - sx; // w could be negative, but we'll skip drawing if it is
int exonIntronNumber;
char *exonIntronText;
int numExonIntrons = numExons;
if (isExon)
{
exonIntronText = exonText;
}
else
{
exonIntronText = intronText;
--numExonIntrons; // introns are one fewer than exons
}
- char strandChar;
+ char* strandStr;
if (!revStrand) {
exonIntronNumber = exonIx;
- strandChar = '+';
+ strandStr = "Forw";
}
else {
exonIntronNumber = numExonIntrons-exonIx+1;
- strandChar = '-';
+ strandStr = "Rev";
}
// we still need to show the existing mouseover text
char* existingText = lf->mouseOver;
if (isEmpty(existingText))
existingText = lf->name;
// construct a string that tells the user about the codon frame situation of this exon
// char *frameText = "";
// for coding exons, determine the start and end phase of the exon and an English text describing both:
// if transcript is on + strand, the start phase is the exonFrame value, and the end phase is the next exonFrame (3' on DNA) value
// if transcript is on - strand, the start phase is the previous (=3' on DNA) exonFrame and the end phase is the exonFrame
int startPhase = -1;
int endPhase = -1;
char phaseText[EXONTEXTLEN];
@@ -3074,59 +3074,65 @@
codonex = (codonex > picEnd) ? picEnd : codonex;
int w = codonex - codonsx;
if (w > 0)
{
// temporarily remove the mouseOver from the lf, since linkedFeatureMapItem will always
// prefer a lf->mouseOver over the itemName
char *oldMouseOver = lf->mouseOver;
lf->mouseOver = NULL;
dyStringClear(codonDy);
// if you change this text, make sure you also change hgTracks.js:mouseOverToLabel
if (!isEmpty(existingText))
dyStringPrintf(codonDy, "Transcript: %s
", existingText);
int codonHgvsIx = (codon->codonIndex - 1) * 3;
if (codonHgvsIx >= 0)
- dyStringPrintf(codonDy, "Codons: c.%d-%d
", codonHgvsIx + 1, codonHgvsIx + 3);
+ {
+ int cStart = codonHgvsIx + 1;
+ int cEnd = codonHgvsIx + 3;
+ int pStart = codonHgvsIx / 3;
+ dyStringPrintf(codonDy, "Codons: c.%d-%d (p.%d-%d)
",
+ cStart, cEnd, pStart, pStart+1);
+ }
// if you change the text below, also change hgTracks:mouseOverToExon
- dyStringPrintf(codonDy, "Strand: %c Length: %dbp
Exon: %s %d of %d
%s",
- strandChar, e - s, exonIntronText, exonIntronNumber, numExonIntrons, phaseText);
+ dyStringPrintf(codonDy, "Strand: %s Length: %dbp
Exon: %s %d of %d
%s",
+ strandStr, e - s, exonIntronText, exonIntronNumber, numExonIntrons, phaseText);
tg->mapItem(tg, hvg, item, codonDy->string, tg->mapItemName(tg, item),
sItem, eItem, codonsx, y, w, heightPer);
// and restore the mouseOver
lf->mouseOver = oldMouseOver;
}
}
}
}
}
else // either an intron, or else an exon zoomed out too far for codons (or no codons)
{
// if you change this text, make sure you also change hgTracks.js:mouseOverToLabel
// if you change the text below, also change hgTracks:mouseOverToExon
char *posNote = "";
char *exonOrIntron = "Intron";
if (isExon)
{
posNote = "Codons: Zoom in to show cDNA position
";
exonOrIntron = "Exon";
}
safef(mouseOverText, sizeof(mouseOverText), "Transcript: %s
%s"
- "Strand: %c
%s: %s %d of %d Length: %d bp
%s",
- existingText, posNote, strandChar, exonOrIntron, exonIntronText,
+ "Strand: %s
%s: %s %d of %d Length: %d bp
%s",
+ existingText, posNote, strandStr, exonOrIntron, exonIntronText,
exonIntronNumber, numExonIntrons, e - s, phaseText);
// temporarily remove the mouseOver from the lf, since linkedFeatureMapItem will always
// prefer a lf->mouseOver over the itemName
char *oldMouseOver = lf->mouseOver;
lf->mouseOver = NULL;
tg->mapItem(tg, hvg, item, mouseOverText, tg->mapItemName(tg, item),
sItem, eItem, sx, y, w, heightPer);
// and restore the old mouseOver
lf->mouseOver = oldMouseOver;
picStart = ex; // prevent pileups. is this right? add 1? does it work?
// JC: Why do we care about pileups? First mapbox drawn wins.
}
}