4702585f8f9e47c84018f5d7d5ff904ed8972358 jcasper Wed Sep 11 16:01:21 2019 -0700 Adding hic to the list of allowed track types for hubs, refs #22316 diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c index f9dae0d..a417636 100644 --- src/hg/lib/trackHub.c +++ src/hg/lib/trackHub.c @@ -38,30 +38,31 @@ #include "grp.h" #include "twoBit.h" #include "dbDb.h" #include "net.h" #include "bbiFile.h" #include "bPlusTree.h" #include "hgFind.h" #include "hubConnect.h" #include "trix.h" #include "vcf.h" #include "htmshell.h" #include "bigBedFind.h" #include "customComposite.h" #include "interactUi.h" #include "bedTabix.h" +#include "hic.h" #ifdef USE_HAL #include "halBlockViz.h" #endif static struct hash *hubCladeHash; // mapping of clade name to hub pointer static struct hash *hubAssemblyHash; // mapping of assembly name to genome struct static struct hash *hubOrgHash; // mapping from organism name to hub pointer static struct trackHub *globalAssemblyHubList; // list of trackHubs in the user's cart static struct hash *trackHubHash; char *trackHubRelativeUrl(char *hubUrl, char *path) /* Return full path (in URL form if it's a remote hub) given * path possibly relative to hubUrl. Do a freeMem of result * when done. */ @@ -831,30 +832,31 @@ startsWithWord("bigBed", type) || #ifdef USE_HAL startsWithWord("pslSnake", type) || startsWithWord("halSnake", type) || #endif startsWithWord("vcfTabix", type) || startsWithWord("bigPsl", type) || startsWithWord("bigMaf", type) || startsWithWord("longTabix", type) || startsWithWord("bigGenePred", type) || startsWithWord("bigNarrowPeak", type) || startsWithWord("bigChain", type) || startsWithWord("bigLolly", type) || startsWithWord("bigBarChart", type) || startsWithWord("bigInteract", type) || + startsWithWord("hic", type) || startsWithWord("bam", type))) { errAbort("Unsupported type '%s' in hub %s genome %s track %s", type, hub->url, genome->name, tdb->track); } requiredSetting(hub, genome, tdb, "bigDataUrl"); } } if (sameString("barChart", type) || sameString("bigBarChart", type)) requireBarChartBars(hub, genome, tdb); } } } @@ -1240,20 +1242,27 @@ if (btf == NULL) errAbort("Couldn't open %s and/or its tabix index (.tbi) file.", bigDataUrl); bedTabixFileClose(&btf); } #ifdef USE_HAL else if (startsWithWord("halSnake", type)) { char *errString; int handle = halOpenLOD(bigDataUrl, &errString); if (handle < 0) errAbort("HAL open error: %s", errString); if (halClose(handle, &errString) < 0) errAbort("HAL close error: %s", errString); } #endif + else if (startsWithWord("hic", type)) + { + struct hicMeta *header; + char *errString = hicLoadHeader(bigDataUrl, &header, NULL); + if (errString != NULL) + errAbort("hic file error: %s", errString); + } else errAbort("unrecognized type %s in genome %s track %s", type, genome->name, tdb->track); freez(&bigDataUrl); } }