39209bcbf0111b14b2b8aca1bb8fc245079a7226 max Mon Jun 30 06:22:32 2025 -0700 show locus name on blat results table, refs #35993 diff --git src/hg/hgBlat/hgBlat.c src/hg/hgBlat/hgBlat.c index 120b1b9bbb7..bfdeb159b6e 100644 --- src/hg/hgBlat/hgBlat.c +++ src/hg/hgBlat/hgBlat.c @@ -22,30 +22,31 @@ #include "blatServers.h" #include "web.h" #include "hash.h" #include "botDelay.h" #include "trashDir.h" #include "trackHub.h" #include "hgConfig.h" #include "errCatch.h" #include "portable.h" #include "portable.h" #include "dystring.h" #include "chromInfo.h" #include "net.h" #include "fuzzyFind.h" #include "chromAlias.h" +#include "subText.h" struct cart *cart; /* The user's ui state. */ struct hash *oldVars = NULL; boolean orgChange = FALSE; boolean dbChange = FALSE; boolean allGenomes = FALSE; boolean allResults = FALSE; static long enteredMainTime = 0; boolean autoBigPsl = FALSE; // DEFAULT VALUE change to TRUE in future /* for earlyBotCheck() function at the beginning of main() */ #define delayFraction 0.5 /* standard penalty is 1.0 for most CGIs */ /* this one is 0.5 */ @@ -827,56 +828,80 @@ printf("
We have never cleaned up the data under stable session links so far. " "To reduce track clutter in your own sessions, you can delete BLAT custom tracks from the main Genome Browser " "view using the little trash icon next to each custom track.
"); puts(""); // find maximum query name size for padding calculations and // find maximum target chrom name size for padding calculations int maxQChromNameSize = 0; int maxTChromNameSize = 0; for (psl = pslList; psl != NULL; psl = psl->next) { int qLen = strlen(psl->qName); maxQChromNameSize = max(maxQChromNameSize,qLen); int tLen = strlen(psl->tName); maxTChromNameSize = max(maxTChromNameSize,tLen); } maxQChromNameSize = max(maxQChromNameSize,5); maxTChromNameSize = max(maxTChromNameSize,5); - printf(" ACTIONS QUERY "); + printf(" ACTIONS "); + if (locusConn) + // 25 characters wide + printf(" LOCUS "); + + printf(" QUERY "); spaceOut(stdout, maxQChromNameSize - 5); printf("SCORE START END QSIZE IDENTITY CHROM "); spaceOut(stdout, maxTChromNameSize - 5); printf(" STRAND START END SPAN\n"); printf("----------------------------------------------------------------------------------------------------------"); + if (locusConn) + repeatCharOut(stdout, '-', 25); repeatCharOut(stdout, '-', maxQChromNameSize - 5); repeatCharOut(stdout, '-', maxTChromNameSize - 5); printf("\n"); for (psl = pslList; psl != NULL; psl = psl->next) { char *browserHelp = "Open a Genome Browser showing this match"; char *helpText = "Open a Genome Browser with the BLAT results, but in a new internet browser tab"; // XX putting SVG into C code like this is ugly. define somewhere? maybe have globals for these? char *icon = ""; if (customText) { @@ -903,30 +928,46 @@ { printf("browser ", browserHelp, browserUrl, psl->tName, psl->tStart + 1, psl->tEnd, database, pslName, faName, uiState, unhideTrack); printf("new tab%s ", helpText, browserUrl, psl->tName, psl->tStart + 1, psl->tEnd, database, pslName, faName, unhideTrack, icon); } } printf("", hgcUrl, psl->tStart, pslName, cgiEncode(faName), psl->qName, psl->tName, psl->tStart, psl->tEnd, database, uiState); printf("details "); + // print name of this locus + if (locusConn) + { + struct sqlResult *sr = hRangeQuery(locusConn, "locusName", psl->tName, psl->tStart, psl->tEnd, NULL, 0); + char **row; + row = sqlNextRow(sr); + if (row != NULL) + { + char *desc = row[4]; + char *descLong = subTextString(subList, desc); + printf("%-25s", descLong); + freeMem(descLong); + } + sqlFreeResult(&sr); + } + printf("%s",psl->qName); spaceOut(stdout, maxQChromNameSize - strlen(psl->qName)); printf(" %5d %5d %5d %5d %5.1f%% ", pslScore(psl), psl->qStart+1, psl->qEnd, psl->qSize, 100.0 - pslCalcMilliBad(psl, TRUE) * 0.1); char *displayChromName = chromAliasGetDisplayChrom(database, cart, psl->tName); printf("%s",displayChromName); spaceOut(stdout, maxTChromNameSize - strlen(displayChromName)); printf(" %-2s %9d %9d %6d", psl->strand, psl->tStart+1, psl->tEnd, psl->tEnd - psl->tStart); // if you modify this, also modify hgPcr.c:doQuery, which implements a similar feature char *seq = psl->tName; if (endsWith(seq, "_fix"))