b20d369b166f18509c1fd18682ffc4fc5a5aac09 braney Thu Aug 21 17:38:37 2025 -0700 working on detail page for quickLift Chain. diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 96d8f5a1dbf..a0cfef9551d 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -3916,30 +3916,59 @@ atoi(words[0])); } } if (subChain->qStrand == '-') reverseIntRange(&qStart, &qEnd, subChain->qSize); qSeq = otherChromSeq(otherTbf, otherDb, subChain->qName, qStart, qEnd); if (subChain->qStrand == '-') reverseComplement(qSeq->dna, qSeq->size); subChain->score = chainCalcScoreSubChain(subChain, scoreScheme, gapCalc, qSeq, tSeq); subSetScore = subChain->score; } chainFree(&toFree); +char *liftDb = cloneString(trackDbSetting(tdb, "quickLiftDb")); + +if (liftDb != NULL) + { + int seqStart = cartInt(cart, "l"); + int seqEnd = cartInt(cart, "r"); + char *chromName = cartString(cart, "c"); + char *quickLiftFile = cloneString(trackDbSetting(tdb, "quickLiftUrl")); + struct quickLiftRegions *hr, *regions = quickLiftGetRegions(database, liftDb, quickLiftFile, chromName, seqStart, seqEnd); + + printf("<TABLE> <TR>\n"); + for(hr = regions; hr; hr = hr->next) + { + if (hr->type == QUICKTYPE_NOTHING) + continue; + + char position[128]; + char *newPos; + snprintf(position, 128, "%s:%ld-%ld", chromName, hr->chromStart, hr->chromEnd); + newPos = addCommasToPos(database, position); + printf("<TR><TD>%s</TD><TD>%s</TD>", quickTypeStrings[hr->type], newPos); + + printf("<TD>"); + hgcAnchorSomewhereExt("htcChainAli", item, tdb->track, chain->tName, hr->chromStart - 10, hr->chromEnd + 10, tdb->track); + printf("DNA alignment</A>"); + } + printf("</TABLE>"); + } + printf("<B>%s position:</B> <A HREF=\"%s?%s&db=%s&position=%s:%d-%d\">%s:%d-%d</A>" " size: %d <BR>\n", trackHubSkipHubName(thisOrg), hgTracksName(), cartSidUrlString(cart), database, chain->tName, chain->tStart+1, chain->tEnd, chain->tName, chain->tStart+1, chain->tEnd, chain->tEnd-chain->tStart); printf("<B>Strand:</B> %c<BR>\n", chain->qStrand); qChainRangePlusStrand(chain, &qs, &qe); if (sameWord(otherDb, "seq")) { printf("<B>%s position:</B> %s:%d-%d size: %d<BR>\n", otherOrg, chain->qName, qs, qe, chain->qEnd - chain->qStart); } else { /* prints link to other db browser only if db exists and is active */ @@ -28048,34 +28077,30 @@ } else if (tdb != NULL && (startsWithWord("barChart", tdb->type) || startsWithWord("bigBarChart", tdb->type))) { doBarChartDetails(tdb, item); printTrackHtml(tdb); } else if (startsWith("hprcDeletions", table) || startsWith("hprcInserts", table) || startsWith("hprcArr", table)|| startsWith("hprcDouble", table)) { doHPRCTable(tdb, item); } else if (tdb && sameString(tdb->type, "lorax")) { doLorax(tdb, item); } -else if (sameString(trackHubSkipHubName(table), "quickLiftChain")) - { - doQuickLiftChain(tdb, item); - } else return FALSE; return TRUE; } struct hash *orgDbHash = NULL; void initOrgDbHash() /* Function to initialize a hash of organism names that hash to a database ID. * This is used to show alignments by hashing the organism associated with the * track to the database name where the chromInfo is stored. For example, the * mousBlat track in the human browser would hash to the mm2 database. */ { orgDbHash = hashNew(8);