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/hgTables.c src/hg/hgTables/hgTables.c
index fe041085a13..8654e4a8e53 100644
--- src/hg/hgTables/hgTables.c
+++ src/hg/hgTables/hgTables.c
@@ -30,30 +30,31 @@
 #include "joiner.h"
 #include "bedCart.h"
 #include "hgMaf.h"
 #include "gvUi.h"
 #include "wikiTrack.h"
 #include "trackHub.h"
 #include "hubConnect.h"
 #include "hgConfig.h"
 #include "udc.h"
 #include "chromInfo.h"
 #include "knetUdc.h"
 #include "trashDir.h"
 #include "genbank.h"
 #include "windowsToAscii.h"
 #include "chromAlias.h"
+#include "myVariants.h"
 
 void usage()
 /* Explain usage and exit. */
 {
 errAbort(
   "hgTables - Get table data associated with tracks and intersect tracks\n"
   "usage:\n"
   "   hgTables XXX\n"
   "options:\n"
   "   -xxx=XXX\n"
   );
 }
 
 /* Global variables. */
 struct cart *cart;	/* This holds cgi and other variables between clicks. */
@@ -655,31 +656,31 @@
 else if (isBigBed(database, table, curTrack, ctLookupName))
     hti = bigBedToHti(table, conn);
 else if (isBigWigTable(table))
     hti = bigWigToHti(table);
 else if (isLongTabixTable(table))
     hti = longTabixToHti(table);
 else if (isBamTable(table))
     hti = bamToHti(table);
 else if (isVcfTable(table, &isTabix))
     {
     boolean isTabix = trackIsType(database, table, curTrack, "vcfTabix", ctLookupName);
     hti = vcfToHti(table, isTabix);
     }
 else if (isHicTable(table))
     hti = hicToHti(table);
-else if (isCustomTrack(table))
+else if (isCustomTrack(table) || startsWith("myVariants_", table))
     {
     struct customTrack *ct = ctLookupName(table);
     hti = ctToHti(ct);
     }
 else if (sameWord(table, WIKI_TRACK_TABLE))
     {
     hti = wikiHti();
     }
 else
     {
     char *track;
     if (startsWith("chrN_", table))
 	track = table + strlen("chrN_");
     else
 	track = table;
@@ -1200,76 +1201,82 @@
 
 void doTabOutTable( char *db, char *table, FILE *f, struct sqlConnection *conn, char *fields, char outSep)
 /* Do tab-separated output on fields of a single table. */
 {
 boolean isTabix = FALSE;
 if (isBigBed(database, table, curTrack, ctLookupName))
     bigBedTabOut(db, table, conn, fields, f, outSep);
 else if (isLongTabixTable(table))
     longTabixTabOut(db, table, conn, fields, f, outSep);
 else if (isBamTable(table))
     bamTabOut(db, table, conn, fields, f, outSep);
 else if (isVcfTable(table, &isTabix))
     vcfTabOut(db, table, conn, fields, f, isTabix);
 else if (isHicTable(table))
     hicTabOut(db, table, conn, fields, f, outSep);
-else if (isCustomTrack(table))
+else if (isCustomTrack(table) || startsWith("myVariants_", table))
     {
     doTabOutCustomTracks(db, table, conn, fields, f, outSep);
     }
 else
     doTabOutDb(db, db, table, table, f, conn, fields, outSep);
 }
 
 struct slName *fullTableFields(char *db, char *table)
 /* Return list of fields in db.table.field format. */
 {
 char dtBuf[256];
 struct sqlConnection *conn=NULL;
 struct slName *fieldList = NULL, *dtfList = NULL, *field, *dtf;
 if (isBigBed(database, table, curTrack, ctLookupName))
     {
     if (!trackHubDatabase(database))
 	conn = hAllocConn(db);
     fieldList = bigBedGetFields(table, conn);
     hFreeConn(&conn);
     }
 else if (isLongTabixTable(table))
     fieldList = getLongTabixFields(6);
 else if (isHalTable(table))
     fieldList = getBedFields(6);
 else if (isBamTable(table))
     fieldList = bamGetFields(table);
 else if (isVcfTable(table, NULL))
     fieldList = vcfGetFields(table);
 else if (isHicTable(table))
     fieldList = hicGetFields(table);
-else if (isCustomTrack(table))
+else if (isCustomTrack(table) || startsWith("myVariants_", table))
     {
     struct customTrack *ct = ctLookupName(table);
     char *type = ct->dbTrackType;
     if (type != NULL)
         {
         conn = hAllocConn(CUSTOM_TRASH);
         if (startsWithWord("maf", type) ||
-            startsWithWord("makeItems", type) || 
+                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);
+                }
             fieldList = sqlListFields(conn, ct->dbTableName);
+            }
         hFreeConn(&conn);
         }
     if (fieldList == NULL)
 	fieldList = getBedFields(ct->fieldCount);
     }
 else
     {
     char *splitTable;
     dbOverrideFromTable(dtBuf, &db, &table);
     conn = hAllocConn(db);
     splitTable = chromTable(conn, table);
     fieldList = sqlListFields(conn, splitTable);
     freez(&splitTable);
     hFreeConn(&conn);
     }