09208616b0f709b570f16ac1ed337a7b0c4353ef braney Sun Nov 1 15:33:40 2015 -0800 add bigChain support in hgTracks (no redmine) diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 7ed2472..b238216 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -416,30 +416,31 @@ /* returns TRUE is this track has a remote datasource */ { if (!IS_KNOWN(track->remoteDataSource)) { SET_TO_NO(track->remoteDataSource); //if (track->bbiFile != NULL) // FIXME: Chicken or the egg. bigWig/bigBed "bbiFile" filled // // in by loadItems, but we don't want to load items. // { // if (!startsWith("/gbdb/",track->bbiFile->fileName)) // SET_TO_YES(track->remoteDataSource); // } if (startsWithWord("bigWig",track->tdb->type) || startsWithWord("bigBed",track->tdb->type) || startsWithWord("halSnake",track->tdb->type) || startsWithWord("bigPsl",track->tdb->type) || startsWithWord("bigGenePred",track->tdb->type) || + startsWithWord("bigChain",track->tdb->type) || startsWithWord("bigMaf",track->tdb->type) || startsWithWord("bam",track->tdb->type) || startsWithWord("vcfTabix", track->tdb->type)) { SET_TO_YES(track->remoteDataSource); } } return IS_YES(track->remoteDataSource); } boolean trackShouldUseAjaxRetrieval(struct track *track) /* Tracks with remote data sources should berendered via an ajax callback */ { return (theImgBox && !trackImgOnly && trackUsesRemoteData(track)); } #endif///def REMOTE_TRACK_AJAX_CALLBACK @@ -3265,39 +3266,41 @@ if (ct->dbTrack) tg->loadItems = wigLoadItems; else tg->loadItems = ctWigLoadItems; tg->customPt = ct; tg->nextItemButtonable = FALSE; } else if (sameString(type, "bigWig")) { tg = trackFromTrackDb(tdb); tg->bbiFile = ct->bbiFile; tg->nextItemButtonable = FALSE; if (trackShouldUseAjaxRetrieval(tg)) tg->loadItems = dontLoadItems; } -else if (sameString(type, "bigBed")|| sameString(type, "bigGenePred") || sameString(type, "bigPsl") || sameString(type, "bigMaf")) +else if (sameString(type, "bigBed")|| sameString(type, "bigGenePred") || sameString(type, "bigPsl") || sameString(type, "bigMaf")|| sameString(type, "bigChain")) { struct bbiFile *bbi = ct->bbiFile; /* Find field counts, and from that revise the tdb->type to be more complete. */ char extra = (bbi->fieldCount > bbi->definedFieldCount ? '+' : '.'); char typeBuf[64]; if (sameString(type, "bigGenePred")) safef(typeBuf, sizeof(typeBuf), "bigGenePred"); + else if (sameString(type, "bigChain")) + safef(typeBuf, sizeof(typeBuf), "bigChain"); else if (sameString(type, "bigMaf")) safef(typeBuf, sizeof(typeBuf), "bigMaf"); else if (sameString(type, "bigPsl")) safef(typeBuf, sizeof(typeBuf), "bigPsl"); else safef(typeBuf, sizeof(typeBuf), "bigBed %d %c", bbi->definedFieldCount, extra); tdb->type = cloneString(typeBuf); /* Finish wrapping track around tdb. */ tg = trackFromTrackDb(tdb); tg->bbiFile = bbi; tg->nextItemButtonable = TRUE; if (trackShouldUseAjaxRetrieval(tg)) tg->loadItems = dontLoadItems; } @@ -4203,30 +4206,31 @@ struct paraFetchData { struct paraFetchData *next; struct track *track; boolean done; }; static boolean isTrackForParallelLoad(struct track *track) /* Is this a track that should be loaded in parallel ? */ { char *bdu = trackDbSetting(track->tdb, "bigDataUrl"); return (startsWithWord("bigWig" , track->tdb->type) || startsWithWord("bigBed" , track->tdb->type) || startsWithWord("bigPsl" , track->tdb->type) || startsWithWord("bigGenePred" , track->tdb->type) + || startsWithWord("bigChain" , track->tdb->type) || startsWithWord("bigMaf" , track->tdb->type) || startsWithWord("bam" , track->tdb->type) || startsWithWord("halSnake", track->tdb->type) || startsWithWord("vcfTabix", track->tdb->type)) // XX code-review: shouldn't we error abort if the URL is not valid? && (bdu && isValidBigDataUrl(bdu, FALSE)) && !(containsStringNoCase(bdu, "dl.dropboxusercontent.com")) && (track->subtracks == NULL); } static void findLeavesForParallelLoad(struct track *trackList, struct paraFetchData **ppfdList) /* Find leaves of track tree that are remote network resources for parallel-fetch loading */ { struct track *track; if (!trackList)