4bb9e8caea515342ba98d3871da76cd4ec69916f chmalee Fri May 1 14:10:00 2026 -0700 Initial myVariants implementation: a form on hgTracks where users can enter item details in one of three ways: hgvs/item search, simple bed form, advanced bed form where additional non-bed fields can dynamically created. Allows changing the color of items, writing descriptions, and editing the items after creation. Show overlaps with hardcoded tracks when hgc page is open (not in the hgc dialog). Next commit has implementation of sharing these tracks with other users diff --git src/hg/hgTables/custom.c src/hg/hgTables/custom.c index 068ed7cd015..d5ba39d413b 100644 --- src/hg/hgTables/custom.c +++ src/hg/hgTables/custom.c @@ -3,31 +3,31 @@ /* Copyright (C) 2013 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "obscure.h" #include "cheapcgi.h" #include "cart.h" #include "jksql.h" #include "hdb.h" #include "trackDb.h" #include "grp.h" #include "customTrack.h" #include "hgTables.h" - +#include "myVariants.h" struct customTrack *theCtList = NULL; /* List of custom tracks. */ struct slName *browserLines = NULL; /* Browser lines in custom tracks. */ struct customTrack *getCustomTracks() /* Get custom track list. */ { //fprintf(stdout,"database %s in cart %s", database, cartString(cart, "db")); cartSetString(cart, "db", database); if (theCtList == NULL) theCtList = customTracksParseCart(database, cart, &browserLines, NULL); return(theCtList); } struct customTrack *ctLookupName(char *name) @@ -483,31 +483,31 @@ /* Get list of beds from custom track of given name that are * in current regions and that pass filters. You can bedFree * this when done. */ { struct customTrack *ct = ctLookupName(name); struct bedFilter *bf = NULL; struct bed *bedList = NULL; struct hash *idHash = NULL; struct region *region; int fieldCount; if (ct == NULL) errAbort("Can't find custom track %s", name); char *type = ct->dbTrackType; -if (type != NULL && (startsWithWord("makeItems", type) || +if (type != NULL && (startsWithWord("myVariants", type) || sameWord("bedDetail", type) || sameWord("barChart", type) || sameWord("interact", type) || sameWord("bedMethyl", type) || sameWord("pgSnp", type))) { struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH); bedList = dbGetFilteredBedsOnRegions(conn, CUSTOM_TRASH, db, ct->dbTableName, name, regionList, lm, retFieldCount); hFreeConn(&conn); fieldCount = 9; if (sameWord("bedDetail", type)) fieldCount = *retFieldCount; else if (sameWord("pgSnp", type)) fieldCount = 4; @@ -593,37 +593,41 @@ ++count; } lmCleanup(&lm); } if (count == 0) explainWhyNoResults(f); } void doTabOutCustomTracks(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f, char outSep) /* Print out selected fields from custom track. If fields * is NULL, then print out all fields. */ { struct customTrack *ct = ctLookupName(table); char *type = ct->tdb->type; -if (startsWithWord("makeItems", type) || +if (startsWithWord("myVariants", type) || sameWord("bedDetail", type) || sameWord("barChart", type) || sameWord("interact", type) || sameWord("bedMethyl", type) || sameWord("pgSnp", type)) { + if (sameWord("myVariants", type)) + { + ct->dbTableName = myVariantsResolveDbTableForCustomTrack(ct->tdb->table, cart); + } struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH); doTabOutDb(CUSTOM_TRASH, db, ct->dbTableName, table, f, conn, fields, outSep); hFreeConn(&conn); } else doTabOutBedLike(ct, table, conn, fields, f, outSep); } void removeNamedCustom(struct customTrack **pList, char *name) /* Remove named custom track from list if it's on there. */ { struct customTrack *newList = NULL, *ct, *next; for (ct = *pList; ct != NULL; ct = next) {