02710f0107a6b154d9e5689165941ce724cb4c6a braney Fri Sep 4 13:38:54 2026 -0700 quickLift: fix the seams a second review pass found quickLiftPslBackToProtein left two things wrong. pslTransMap can hand back strand[0] == '-', because it reverse complements the input when the two alignments disagree about the strand of the sequence they share, and forcing strand[1] to '+' on top of that produced "-+". A protein psl is only ever "++" or "+-", and pslShow reads strand[0] == '-' as "reverse complement the query", so it would have reverse complemented a protein as though it were DNA. It now turns the alignment over so the minus lands on the target side. qBaseInsert is in nucleotides like everything else being divided, so it comes down too, and it joins the divisibility guard: without it the result failed pslCheck and the number was printed verbatim on the details page. Adding that back-conversion made a comment in pslTrack.c false. The lift no longer always returns an untranslated alignment, so the drawing code has to ask rather than assume, the way bigBedTrack.c already did. A quickLifted protein psl track was drawing every block at a third of its length. No such track exists on hg19 or hg38 today, so this was latent. The normalized score on the chain details page was read from the assembly on screen. Where that assembly has no such table the page died; where it has a table of the same name, which is the common case for a self or a well known chain track, it silently returned some other assembly's chain and printed a blank score. It now reads the assembly the chain came from, on a connection to it. Two smaller things: htcBigPslAli guarded its connection with trackHubDatabase alone, but a GenArk accession does not start with hub_, so it matches the guard genericClickHandlerPlus already uses; and the table name tests in cds.c now skip the hub prefix the way the ones in hgc.c were changed to, so a lifted refSeqAli reaches its special case. The chain item label took its start from the source chain and its strand character from the lifted one. Both now come from the source chain. refs #38249 diff --git src/hg/hgTracks/chainTrack.c src/hg/hgTracks/chainTrack.c index 456493972fa..5da706078b1 100644 --- src/hg/hgTracks/chainTrack.c +++ src/hg/hgTracks/chainTrack.c @@ -373,31 +373,32 @@ char buf[16]; AllocVar(lf); lf->start = lf->tallStart = lifted->tStart; lf->end = lf->tallEnd = lifted->tEnd; lf->qSize = lifted->qSize; lf->grayIx = maxShade; lf->score = chain->score; lf->filterColor = -1; lf->orientation = (lifted->qStrand == '-') ? -1 : 1; int len = strlen(chain->qName) + 32; lf->name = needMem(len); if (!doSnake) - safef(lf->name, len, "%s %c %dk", chain->qName, lifted->qStrand, qs/1000); + // qs was worked out from the source chain, so print its strand, not the lifted one + safef(lf->name, len, "%s %c %dk", chain->qName, chain->qStrand, qs/1000); else safef(lf->name, len, "%s", chain->qName); safef(buf, sizeof(buf), "%d", chain->id); lf->extra = cloneString(buf); struct simpleFeature *sfList = NULL, *sf; struct cBlock *b; for (b = lifted->blockList; b != NULL; b = b->next) { AllocVar(sf); sf->start = b->tStart; sf->end = b->tEnd; sf->grayIx = lf->grayIx; // A minus strand chain keeps its query coordinates reverse complemented, and the // drawing code wants them forward, which is the same turn loadLinks makes at the end.