9f9d1239c2d8e95152e9b637b52e7c77d88e4353 braney Tue Jul 2 09:16:40 2024 -0700 add fancy settings to custom bigPsl tracks if none of them are already set refs #31304 diff --git src/hg/lib/customFactory.c src/hg/lib/customFactory.c index 693439b..d6378ef 100644 --- src/hg/lib/customFactory.c +++ src/hg/lib/customFactory.c @@ -2836,37 +2836,52 @@ static boolean bigDbSnpRecognizer(struct customFactory *fac, struct customPp *cpp, char *type, struct customTrack *track) /* Return TRUE if looks like we're handling a bigDbSnp track */ { return (sameType(type, "bigDbSnp")); } static boolean bigBedRecognizer(struct customFactory *fac, struct customPp *cpp, char *type, struct customTrack *track) /* Return TRUE if looks like we're handling a bigBed track */ { return (sameType(type, "bigBed")); } +static void addSpecialSettings(struct hash *hash) +/* Add special settings to bigPsl custom track if none of them + * are already set. */ +{ +if (!(hashLookup(hash, "showDiffBasesAllScales") || + hashLookup(hash, "baseColorUseSequence") || + hashLookup(hash, "baseColorDefault"))) + { + hashAdd(hash, "showDiffBasesAllScales", "."); + hashAdd(hash, "baseColorUseSequence", "lfExtra"); + hashAdd(hash, "baseColorDefault", "diffBases"); + } +} + static struct customTrack *bigBedLoader(struct customFactory *fac, struct hash *chromHash, struct customPp *cpp, struct customTrack *track, boolean dbRequested) /* Load up big bed data until get next track line. */ { /* Not much to this. A bigBed has nothing here but a track line. */ struct hash *settings = track->tdb->settingsHash; +addSpecialSettings(settings); char *bigDataUrl = hashFindVal(settings, "bigDataUrl"); requireBigDataUrl(bigDataUrl, fac->name, track->tdb->shortLabel); checkAllowedBigDataUrlProtocols(bigDataUrl); /* protect against temporary network error */ struct errCatch *errCatch = errCatchNew(); if (errCatchStart(errCatch)) { track->bbiFile = bigBedFileOpenAlias(bigDataUrl, chromAliasFindAliases); } errCatchEnd(errCatch); if (errCatch->gotError) { track->networkErrMsg = cloneString(errCatch->message->string); return track;