b5a4ddd8543a87f46988a60069148b0f2e1a8031
max
Mon Aug 10 08:37:29 2026 -0700
hgBlat/hgPcr: show the chrUn info note (fix swapped startsWith args), refs #37893
The chrUn branch of the sequence-type note used startsWith(name, "chrUn"),
but startsWith(start, string) tests whether string begins with start, so it
asked whether "chrUn" begins with the sequence name and never matched. As a
result chrUn (unplaced) sequences got no info icon on the new BLAT results
page, and no note on the classic results page or in hgPcr, while _alt/_fix/
_random (which use endsWith) worked. Fix the argument order in all three.
Also, on the new results page, check the sequence's aliases and not just its
single display name, so a hit whose displayed label is an accession but which
has a chrUn/alt/fix alias (e.g. a GenArk hub) still gets the note.
diff --git src/hg/hgPcr/hgPcr.c src/hg/hgPcr/hgPcr.c
index cabcf8a8241..9a3caa06a8b 100644
--- src/hg/hgPcr/hgPcr.c
+++ src/hg/hgPcr/hgPcr.c
@@ -611,31 +611,31 @@
boolean isRandom = FALSE;
boolean isChrUn = FALSE;
if (gpoList != NULL)
{
struct gfPcrOutput *gpo;
for (gpo = gpoList; gpo != NULL; gpo = gpo->next)
{
char *seq = gpo->seqName;
if (endsWith(seq, "_fix"))
isFix = TRUE;
else if (endsWith(seq, "_alt"))
isAlt = TRUE;
else if (endsWith(seq, "_random"))
isRandom = TRUE;
- else if (startsWith(seq, "chrUn"))
+ else if (startsWith("chrUn", seq))
isChrUn = TRUE;
}
}
if (isFix || isRandom || isAlt || isChrUn)
webNewSection("Notes on the results above");
if (isFix)
printf("What is chrom_fix?
");
if (isAlt)
printf("What is chrom_alt?
");
if (isRandom)
printf("What is chrom_random?
");
if (isChrUn)
printf("What is a chrUn sequence?
");