1d5248e54214efc78f88eca4aa110bf0cc7e1a33 braney Wed Feb 1 15:45:06 2023 -0800 don't require a twoBit in order to show snakes diff --git src/hg/hgTracks/chainSnakeTrack.c src/hg/hgTracks/chainSnakeTrack.c index 3d30b92..cff200e 100644 --- src/hg/hgTracks/chainSnakeTrack.c +++ src/hg/hgTracks/chainSnakeTrack.c @@ -948,43 +948,40 @@ if (sx < insideX) { int olap = insideX - sx; sx = insideX; w -= olap; } char qAddress[4096]; if ((vis == tvFull) || (vis == tvPack) ) { safef(qAddress, sizeof qAddress, "qName=%s&qs=%d&qe=%d&qWidth=%d",sf->qName, qs, qe, winEnd - winStart); boundMapBox(hvg, s, e, sx+1, y, w-2, heightPer, tg->track, buffer, buffer, NULL, TRUE, qAddress); } hvGfxBox(hvg, sx, y, w, heightPer, color); - // now draw the mismatches if we're at high enough resolution - if ( (winBaseCount < showSnpWidth) && ((vis == tvFull) || (vis == tvPack))) - { + // now draw the mismatches if we're at high enough resolution and have the sequence char *twoBitString = trackDbSetting(tg->tdb, "twoBit"); + if (twoBitString && ((winBaseCount < showSnpWidth) && ((vis == tvFull) || (vis == tvPack)))) + { static struct twoBitFile *tbf = NULL; static char *lastTwoBitString = NULL; static struct dnaSeq *seq = NULL; static char *lastQName = NULL; // sequence for chain snakes is in 2bit files which we cache - if (twoBitString == NULL) - twoBitString = "/gbdb/hg19/hg19.2bit"; - if ((lastTwoBitString == NULL) || differentString(lastTwoBitString, twoBitString)) { if (tbf != NULL) { lastQName = NULL; twoBitClose(&tbf); } tbf = twoBitOpen(twoBitString); } // we're reading in the whole chrom if ((lastQName == NULL) || differentString(sf->qName, lastQName)) seq = twoBitReadSeqFrag(tbf, sf->qName, 0, 0); lastQName = sf->qName;