a7cdd40a9c37d4d90c7aa9766c5248c0cb3f259a braney Wed May 21 17:22:17 2025 -0700 add bedMethyl type for custom and native tracks diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 35db5935b93..efab493511d 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -1543,30 +1543,33 @@ struct udcFile *udcF = udcFileOpen(fileOrUrl, NULL); udcSeek(udcF, offset); line = udcReadLine(udcF); if (line == NULL) errAbort("error reading line from '%s'", fileOrUrl); udcFileClose(&udcF); } return line; } int extraFieldsStart(struct trackDb *tdb, int fieldCount, struct asObject *as) /* return the index of the first extra field */ { int start = 0; char *type = cloneString(tdb->type); + +if (sameString(type, "bedMethyl")) + return 9; char *word = nextWord(&type); if (word && (sameWord(word,"bed") || startsWith("big", word))) { if (NULL != (word = nextWord(&type))) start = sqlUnsigned(word); else // custom beds and bigBeds may not have full type "begBed 9 +" start = max(0,slCount(as->columnList) - fieldCount); } return start; } struct slPair *getExtraFields(struct trackDb *tdb, char **fields, int fieldCount) /* return the extra field names and their values as a list of slPairs. */ { struct asObject *as = asForDb(tdb, database); @@ -4793,30 +4796,34 @@ if (container != NULL) { genericContainerClick(conn, container, tdb, item, itemForUrl); } else if (wordCount > 0) { type = words[0]; if (sameString(type, "bed")) { int num = 0; if (wordCount > 1) num = atoi(words[1]); if (num < 3) num = 3; genericBedClick(conn, tdb, item, start, num); } + else if (sameString(type, "bedMethyl")) + { + genericBedClick(conn, tdb, item, start, 9); + } else if (sameString(type, "bigGenePred")) { int num = 12; genericBigBedClick(conn, tdb, item, start, end, num); } else if (sameString(type, "bigBed")) { int num = 0; if (wordCount > 1) num = atoi(words[1]); if (num < 3) num = 3; genericBigBedClick(conn, tdb, item, start, end, num); } else if (sameString(type, "sample")) { @@ -22480,30 +22487,34 @@ int end = cartInt(cart, "t"); char *item = cartString(cart, "i"); char *type; fileName = nextWord(&fileItem); for (ct = ctList; ct != NULL; ct = ct->next) if (sameString(trackId, ct->tdb->track)) break; if (ct == NULL) errAbort("Couldn't find '%s' in '%s'", trackId, fileName); type = ct->tdb->type; cartWebStart(cart, database, "Custom Track: %s", ct->tdb->shortLabel); itemName = skipLeadingSpaces(fileItem); printf("<H2>%s</H2>\n", ct->tdb->longLabel); if (sameWord(type, "array")) doExpRatio(ct->tdb, fileItem, ct); +#ifdef NOTNOW +else if ( startsWith( "bedMethyl", type)) + genericBedClick(conn, tdb, item, start, 9); +#endif else if ( startsWith( "longTabix", type)) doLongTabix(ct->tdb, item); else if (sameWord(type, "encodePeak")) doEncodePeak(ct->tdb, ct, fileName); else if (sameWord(type, "bigNarrowPeak")) doBigEncodePeak(ct->tdb, NULL, item); else if (sameWord(type, "bigWig")) bigWigCustomClick(ct->tdb); else if (sameWord(type, "bigChain")) genericChainClick(NULL, ct->tdb, item, start, "seq"); else if (sameWord(type, "bigPsl")) bigPslHandlingCtAndGeneric(NULL, ct->tdb, item, start, end); else if (sameWord(type, "bigMaf")) genericMafClick(NULL, ct->tdb, item, start); else if (sameWord(type, "bigDbSnp"))