85f081b107ba60cdb14fb72d2dc439f4e29815df
angie
  Fri Oct 28 14:30:48 2011 -0700
MLQ #5795 (question mark in repeats table): user asked about the ?'s thatappear at the end of some repClass and repFamily names in rmsk.  I asked
Robert Hubley and he said they are just an indication that a new repeat is
suspected to be in some class but hasn't been confirmed yet.  He suggested
ignoring the ?.  I looked at rmskTrack.c and found that the ? at end was
causing such items to default to the Other category.  This change strips
a trailing ? from the class name that we look up in the hash (but leaves
it in the ro.repClass field because that's used for the mouseover title).
Now if repClass is "DNA?" the item will still be drawn in the DNA row.

diff --git src/hg/hgTracks/rmskTrack.c src/hg/hgTracks/rmskTrack.c
index 0835b44..661b3c8 100644
--- src/hg/hgTracks/rmskTrack.c
+++ src/hg/hgTracks/rmskTrack.c
@@ -85,34 +85,39 @@
     int percId;
     int grayLevel;
     char statusLine[128];
 
     for (ri = tg->items; ri != NULL; ri = ri->next)
         {
 	ri->yOffset = y;
 	y += lineHeight;
 	hashAdd(hash, ri->class, ri);
 	}
     sr = hRangeQuery(conn, tg->table, chromName, winStart, winEnd, NULL,
 		     &rowOffset);
     while ((row = sqlNextRow(sr)) != NULL)
         {
 	rmskOutStaticLoad(row+rowOffset, &ro);
-	if (endsWith(ro.repClass, "RNA"))
-	    ri = hashFindVal(hash, "RNA");
-	else
-	    ri = hashFindVal(hash, ro.repClass);
+	char class[256];
+	// Simplify repClass for lookup: strip trailing '?', simplify *RNA to RNA:
+	safecpy(class, sizeof(class), ro.repClass);
+	char *p = &(class[strlen(class)-1]);
+	if (*p == '?')
+	    *p = '\0';
+	if (endsWith(class, "RNA"))
+	    safecpy(class, sizeof(class), "RNA");
+	ri = hashFindVal(hash, class);
 	if (ri == NULL)
 	   ri = otherRepeatItem;
 	percId = 1000 - ro.milliDiv - ro.milliDel - ro.milliIns;
 	grayLevel = grayInRange(percId, 500, 1000);
 	col = shadesOfGray[grayLevel];
 	x1 = roundingScale(ro.genoStart-winStart, width, baseWidth)+xOff;
 	x2 = roundingScale(ro.genoEnd-winStart, width, baseWidth)+xOff;
 	w = x2-x1;
 	if (w <= 0)
 	    w = 1;
 	hvGfxBox(hvg, x1, ri->yOffset, w, heightPer, col);
 	if (baseWidth <= 100000)
 	    {
 	    if (ri == otherRepeatItem)
 		{