5bf51515b69bd518b2154df5476bc7ed319e33bd markd Sun Mar 22 21:05:42 2026 -0700 Add bigMethyl to the list of valid tracktyopes to check. Generate a warning rather than error for halSnake tracks when when HAL support is not compiled in. Added danger comments about duplicated track name checking diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c index 39154c1d327..6543ad306e8 100644 --- src/hg/lib/trackHub.c +++ src/hg/lib/trackHub.c @@ -990,39 +990,39 @@ } } else { /* Check type field. */ char *type = requiredSetting(hub, genome, tdb, "type"); char *quickLifted = trackDbSetting(tdb, "quickLifted"); if (! ( isCustomComposite(tdb) || (quickLifted != NULL))) { if (startsWithWord("mathWig", type) ) { requiredSetting(hub, genome, tdb, "mathDataUrl"); } else { - /* RMH: Added bigRmsk to support RepeatMasker data in bigBed track hub format */ + // **** DANGER, WILL ROBINSON! **** + // There is also code in hubCheck.c that checks track names. + // both places must be changed or common code created. if (!(startsWithWord("wig", type)|| startsWithWord("bedGraph", type))) { if (!(startsWithWord("bigWig", type) || startsWithWord("bigBed", type) || -#ifdef USE_HAL startsWithWord("pslSnake", type) || startsWithWord("halSnake", type) || -#endif startsWithWord("vcfTabix", type) || startsWithWord("vcfPhasedTrio", type) || startsWithWord("bigPsl", type) || startsWithWord("bigMaf", type) || startsWithWord("longTabix", type) || startsWithWord("bigGenePred", type) || startsWithWord("bigNarrowPeak", type) || startsWithWord("bigChain", type) || startsWithWord("bigLolly", type) || startsWithWord("bigBaseView", type) || startsWithWord("bigRmsk", type) || startsWithWord("bigBarChart", type) || startsWithWord("bigInteract", type) || startsWithWord("bigMethyl", type) || startsWithWord("hic", type) || @@ -1423,36 +1423,36 @@ char *type = trackDbRequiredSetting(tdb, "type"); char *bigDataUrl = trackHubRelativeUrl(genome->trackDbFile, relativeUrl); char *bigDataIndex = NULL; char *relIdxUrl = trackDbSetting(tdb, "bigDataIndex"); if (relIdxUrl != NULL) bigDataIndex = trackHubRelativeUrl(genome->trackDbFile, relIdxUrl); verbose(2, "checking %s.%s type %s at %s\n", genome->name, tdb->track, type, bigDataUrl); if (startsWithWord("bigWig", type)) { /* Just open and close to verify file exists and is correct type. */ struct bbiFile *bbi = bigWigFileOpen(bigDataUrl); bbiFileClose(&bbi); } - /* RMH: Added support for bigRmsk track hub data type */ else if (startsWithWord("bigNarrowPeak", type) || startsWithWord("bigBed", type) || startsWithWord("bigGenePred", type) || startsWithWord("bigPsl", type)|| startsWithWord("bigChain", type)|| startsWithWord("bigMaf", type) || startsWithWord("bigBarChart", type) || startsWithWord("bigInteract", type) || - startsWithWord("bigLolly", type) || startsWithWord("bigRmsk",type)) + startsWithWord("bigLolly", type) || startsWithWord("bigRmsk",type) || + startsWithWord("bigMethyl", type)) { /* Just open and close to verify file exists and is correct type. */ struct bbiFile *bbi = bigBedFileOpen(bigDataUrl); char *typeString = cloneString(type); nextWord(&typeString); if (startsWithWord("bigBed", type) && (typeString != NULL)) { unsigned numFields = sqlUnsigned(nextWord(&typeString)); if (numFields > bbi->fieldCount) errAbort("bigBed file '%s' has %d fields, but track \"%s\" declares 'type bigBed %d'. Either regenerate the bigBed with the correct number of fields, or change the type line to match the file's field count.", bigDataUrl, bbi->fieldCount, trackHubSkipHubName(tdb->track), numFields); } bbiFileClose(&bbi); } else if (startsWithWord("vcfTabix", type) || startsWithWord("vcfPhasedTrio", type)) { @@ -1468,41 +1468,43 @@ vcfFileFree(&vcf); } else if (startsWithWord("bam", type)) { bamFileAndIndexMustExist(bigDataUrl, bigDataIndex); } else if (startsWithWord("longTabix", type)) { struct bedTabixFile *btf = bedTabixFileMayOpen(bigDataUrl, NULL, 0, 0); if (btf == NULL) errAbort("Couldn't open %s and/or its tabix index (.tbi) file for track %s. " "Both the file and a matching .tbi index must be publicly accessible " "at the same URL path.", bigDataUrl, trackHubSkipHubName(tdb->track)); bedTabixFileClose(&btf); } -#ifdef USE_HAL else if (startsWithWord("halSnake", type)) { +#ifdef USE_HAL 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); - } +#else + warn("Note: can not check track %s, validation of halSnake tracks not compiled into this copy of hubCheck", trackHubSkipHubName(tdb->track)); #endif + } else if (startsWithWord("hic", type)) { struct hicMeta *header; char *errString = hicLoadHeader(bigDataUrl, &header, genome->name); 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); } } static void outHubHeader(FILE *f, char *db) // output a track hub header