25c1787f5c2fc9bf27c5da4e5d5a706e3c89e667 braney Tue Aug 18 14:53:47 2026 -0700 hgc: read chain query sequence from the two bit file whenever the track names one, refs #38146 be4f99627b0 gated the otherTwoBitUrl branch of htcChainAli on the query database not existing. That is the wrong test. hs1 keeps its sequence in a hub, so the MySQL database hs1 does exist but holds only trackDb and hgFindSpec tables. sqlDatabaseExists said yes, control fell through to loadGenomePart, and findNib aborted with "Table 'hs1.chromInfo' doesn't exist" when the source of a quickLift was hs1. Take the otherTwoBitUrl branch whenever the track supplies the file, and keep the "Org.chrom" label when hOrganism knows the organism, so the hg38 chainSelf track still reads Human.chrN. Verified against cgi-bin-braney with genome-test as the baseline: hs1 to hg38 quickLift now renders and its query bases match /gbdb/hs1/hs1.2bit; hg19 to hg38 quickLift, hg38 chainSelf and hg38 chainMm39 all produce byte-identical output. diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 718a3979520..bb86647bed5 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -8945,37 +8945,42 @@ return; } fatPsl = chainToPsl(chain); chainFree(&chain); psl = pslTrimToTargetRange(fatPsl, winStart, winEnd); pslFree(&fatPsl); struct twoBitFile *otherTbf = getOtherTwoBitUrl(tdb); if (sameWord(otherDb, "seq")) { qSeq = hExtSeqPart(database, psl->qName, psl->qStart, psl->qEnd); safef(name, sizeof name, "%s", psl->qName); } -else if (otherTbf != NULL && !sqlDatabaseExists(otherDb)) +else if (otherTbf != NULL) { - // the query assembly has no database of its own (an assembly hub or a GenArk - // accession, as when a quickLift chain comes from one), so read the sequence - // out of the two bit file the track points at. + // The track names the file that holds the query sequence, so read it from there + // rather than from the query database. There may be no such database (a GenArk + // accession, as when a quickLift chain comes from one), or it may hold only + // trackDb because the sequence lives in a hub (hs1 and the other curated + // assemblies built that way). qSeq = twoBitReadSeqFragLower(otherTbf, psl->qName, psl->qStart, psl->qEnd); + if (otherOrg == NULL) safef(name, sizeof name, "%s", psl->qName); + else + safef(name, sizeof name, "%s.%s", otherOrg, psl->qName); } else if (otherDb != NULL) { qSeq = loadGenomePart(otherDb, psl->qName, psl->qStart, psl->qEnd); safef(name, sizeof name, "%s.%s", otherOrg, psl->qName); } if (qSeq == NULL) { errAbort("Can't find query sequence in htcChainAli"); } char title[1024]; safef(title, sizeof title, "%s %s vs %s %s ", (otherOrg == NULL ? "" : otherOrg), psl->qName, org, psl->tName ); alnModernStart(title); showSomeAlignment(psl, qSeq, gftDnaX, psl->qStart, psl->qEnd, name, 0, 0);