6172ee24c819e779de63549b5a0db2f0742465f5 chinhli Tue Jan 29 16:12:24 2013 -0800 Track #8533 NumtS tracks: Add logic to numtsClick.c to handle the shortened name in 'numtSMitochondrion' table. For example, old NumtS data for or hg18, hg19 and mm9 have name like Mms_NumtS_096_b1, and all new species like dog and cow now have a shorten name like 'SS_NumtS_246') diff --git src/hg/hgc/numtsClick.c src/hg/hgc/numtsClick.c index 24a12c4..b4fa72a 100644 --- src/hg/hgc/numtsClick.c +++ src/hg/hgc/numtsClick.c @@ -68,40 +68,47 @@ clickMsg = openMsg1; } else if (sameString("numtSMitochondrionChrPlacement", table)) { safef(query, sizeof(query), "select chrom, chromStart, chromEnd, name, score, strand " "from numtS where ( " "(name = '%s') OR (((name REGEXP '^%s') OR (name='%s')) AND " " (ABS((chromEnd - chromStart)-%d) <= %d ))) ", itemName, itemNameDash, itemNameTrimmed, sSize, sDiff); clickMsg = openMsg1; } } else { if (sameString("numtS", table) || sameString("numtSAssembled", table)) { + if (sameString("hg19", database) || sameString("mm9", database)) + { safef(query, sizeof(query), "select chrom, chromStart, chromEnd, name, score, strand " "from numtSMitochondrion where name = '%s' ", itemName); + } else { + safef(query, sizeof(query), + "select chrom, chromStart, chromEnd, name, score, strand " + "from numtSMitochondrion where name = '%s' ", itemNameTrimmed); + } clickMsg = openMsgM; } else if (sameString("numtSMitochondrion", table)) { safef(query, sizeof(query), "select chrom, chromStart, chromEnd, name, score, strand " - "from numtS where name = '%s'", itemName); + "from numtS where name like '%s%%'", itemName); clickMsg = openMsg1; } } sr = sqlGetResult(conn, query); firstTime = TRUE; while ((row = sqlNextRow(sr)) != NULL) { printf("<PRE><TT>"); if (firstTime) { firstTime = FALSE; printf("<BR><H3>%s item '%s' %s</H3><BR>", clickMsg, itemName, openMsg2);