a3df9f62a5995302b5a07ce5e3dd0eadda3a7768 braney Sat Sep 12 09:59:01 2026 -0700 cartTrackVarCatalog: describe hgTables' own cart variables, refs #37979 With peel() fixed, 2,331 hgta_ names in the saved sessions were left honestly uncatalogued rather than absorbed by a catch-all. They fall into four groups, each read at its call site before a row was written for it. The two linked-table checkboxes, hgta_fs.linked.. and hgta_fil.linked..
, which offer a joinable table's fields on the Select Fields and filter pages. extraTableList finds the checked tables by scanning the cart for the prefix, so the set is whatever the cart holds. The filter ops. The catalog covered .pat alone; hgTables.h defines six, and all six are in live sessions. pat, dd and cmp belong to one field, while rawLogic, rawQuery and maxOutput apply to the whole table and still carry a field slot in the name, filled with an empty string or a bare _. Fifty-one session-scoped variables: intersection, correlation, subtrack merge, identifiers, user regions, output naming, MAF output, and which table the Select Fields, filter and histogram pages are about. The header itself documents the convention that shapes half of them - the pages with a Cancel button hold their state twice, hgta_ in force and hgta_next proposed, copied one way on open and the other on Submit - so that is in the group's description rather than in every note. Renaming the .pat row to . also removed an accidental cover: a row registers its trailing component, and that "pat" had been standing in for gvfTrack.c's %s_pat, which is an item label rather than a cart variable. Its seven siblings were already in the baseline, so pat joins them there. hgta_ names matched only by a catch-all go from 4,299 to 3. The three left are hgta_identifierFile and hgta_userRegionsFile, described in the #37623 file-variable registry that this audit does not read, and hgta_userRegionsTable, which nothing in the tree reads at all. diff --git src/hg/utils/cartTrackVarCatalog/cartTrackVarCatalog.py src/hg/utils/cartTrackVarCatalog/cartTrackVarCatalog.py index b4f3cb4763d..4071d09d491 100755 --- src/hg/utils/cartTrackVarCatalog/cartTrackVarCatalog.py +++ src/hg/utils/cartTrackVarCatalog/cartTrackVarCatalog.py @@ -1448,50 +1448,158 @@ "vars": [ v("_case", "bool", "hg/hgc/hgc.c:5746", sep="_", note="Upper case this track's bases."), v("_u", "bool", "hg/hgc/hgc.c:5748", sep="_", note="Underline."), v("_b", "bool", "hg/hgc/hgc.c:5750", sep="_", note="Bold."), v("_i", "bool", "hg/hgc/hgc.c:5752", sep="_", note="Italic."), v("_red", "int", "hg/hgc/hgc.c:5754", sep="_", note="0-255."), v("_green", "int", "hg/hgc/hgc.c:5756", sep="_", note="0-255."), v("_blue", "int", "hg/hgc/hgc.c:5758", sep="_", note="0-255."), ], }, "hgTables": { "what": "hgTables addresses the SAME data by db and table rather than " "by track, so its per-dataset state does not live under the " "track name at all. This is the biggest structural mismatch " - "in the cart: two CGIs, two namespaces, one dataset.", - "vars": [ - v("hgta_fil.v..
..pat", "string", + "in the cart: two CGIs, two namespaces, one dataset.\n" + "Two conventions run through the names below. First, the " + "pages that offer a Cancel button hold their state twice: " + "hgta_ is what is in force and hgta_next is what the " + "open form is proposing. Opening the page copies current to " + "next, Submit copies next back, Cancel simply does not copy, " + "and Clear deletes the current set " + "(hg/hgTables/intersect.c:321 copyCartVars, called at :341 " + "and :355). Second, a filter that belongs to a whole table " + "rather than to one of its fields still carries a field slot " + "in its name, filled with an empty string for the raw-SQL " + "pair and with a bare _ for maxOutput " + "(hg/hgTables/filterFields.c:1087-1107).", + "vars": [ + v("hgta_fil.v..
..", "string", "hg/hgTables/filterFields.c:646", sep="", - note="Filter text box. Sibling types are .dd (dropdown), " - ".cmp (comparison), .rawQuery, .maxOutput."), + values=["pat", "dd", "cmp"], + valuesSrc="hg/hgTables/hgTables.h:326, filterDdVar and its " + "siblings", + note="One field's filter, assembled by filterFieldVarName: pat " + "is the text box, dd the dropdown, cmp the comparison " + "operator."), + v("hgta_fil.v..
..rawLogic, " + "hgta_fil.v..
..rawQuery", "string", + "hg/hgTables/filterFields.c:1087", sep="", + note="The free-SQL filter, which applies to the whole table, so " + "the field slot between the last two dots is empty."), + v("hgta_fil.v..
._.maxOutput", "int", + "hg/hgTables/filterFields.c:1107", sep="", + note="Row limit for this table's output. It is not a filter " + "and is skipped as one at filterFields.c:1594, but it is " + "spelled like one, with a bare _ in the field slot."), v("hgta_fs.check..
.", "bool", "hg/hgTables/filterFields.c:251", sep="", note="Output field selection."), - v("hgta_subtrackMerge*", "string", - "hg/hgTables/hgTables.h:534", sep="", - note="Primary, Op, MoreThreshold, LessThreshold, WigOp, " - "RequireAll, UseMinScore, MinScore."), + v("hgta_fs.linked..
", "bool", + "hg/hgTables/filterFields.c:571", sep="", + note="\"Allow selection from checked tables\": this joinable " + "table's fields are offered on the Select Fields page too. " + " extraTableList (filterFields.c:105) finds the checked " + "tables by scanning the cart for the prefix, so the set of " + "tables is whatever the cart happens to hold."), + v("hgta_fil.linked..
", "bool", + "hg/hgTables/filterFields.c:1401", sep="", + note="The same checkbox on the filter page: this table's fields " + "may be filtered on as well as the primary table's."), v("_sel", "bool", "hg/hgTables/compositeTrack.c:67", sep="_", note="The one place hgTables does use the track-scoped form: " "it reads subtrack selection the same way hgTracks does."), v("hgta_track, hgta_table, hgta_database", "string", "hg/hgTables/hgTables.h:467", sep="", note="Current selection, session-scoped rather than " "per-track."), + v("hgta_fieldSelectTable, hgta_filterTable, hgta_histoTable", + "string", "hg/hgTables/filterFields.c:525", sep="", + note="Which db.table the Select Fields, filter and histogram " + "pages are about. Separate from hgta_table because those " + "pages can be opened on a linked table."), + v("hgta_intersectGroup, hgta_intersectTrack, hgta_intersectTable, " + "hgta_intersectOp, hgta_moreThreshold, hgta_lessThreshold, " + "hgta_invertTable, hgta_invertTable2", "string", + "hg/hgTables/intersect.c:28", sep="", + note="The intersection in force. anyIntersection() keys on " + "hgta_intersectTrack, so removing that one turns the whole " + "intersection off."), + v("hgta_nextIntersectGroup, hgta_nextIntersectTrack, " + "hgta_nextIntersectTable, hgta_nextIntersectOp, " + "hgta_nextMoreThreshold, hgta_nextLessThreshold, " + "hgta_nextInvertTable, hgta_nextInvertTable2", "string", + "hg/hgTables/intersect.c:34", sep="", + note="The pending copy of the eight above, one for one. A " + "session saved with the intersect page open holds both " + "sets, and they need not agree."), + v("hgta_correlateGroup, hgta_correlateTrack, hgta_correlateTable, " + "hgta_correlateOp", "string", "hg/hgTables/correlate.c:127", + sep="", + note="The correlation in force, same pairing as the " + "intersection above."), + v("hgta_nextCorrelateGroup, hgta_nextCorrelateTrack, " + "hgta_nextCorrelateTable, hgta_nextCorrelateOp", "string", + "hg/hgTables/correlate.c:130", sep="", + note="The pending copy of the four above."), + v("hgta_corrWinSize, hgta_corrMaxLimitCount", "int", + "hg/hgTables/hgTables.h:361", sep="", + note="Correlation window size and row cap. These two have no " + "next twin; hg/lib/web.c:1148 removes them along with the " + "eight correlate variables when the assembly changes."), + v("hgta_subtrackMerge*, hgta_nextSubtrackMerge*", "string", + "hg/hgTables/compositeTrack.c:31", sep="", + note="Primary, Op, MoreThreshold, LessThreshold, WigOp, " + "RequireAll, UseMinScore, MinScore, in the current and " + "pending pair."), + v("hgta_identifierDb, hgta_identifierTable, " + "hgta_pastedIdentifiers, hgta_pastedIdentifiers__filename", + "string", "hg/hgTables/identifiers.c:26", sep="", + note="The identifier list the query is restricted to, and the " + "db.table it was entered against. __filename is " + "cheapcgi's companion for an uploaded file " + "(lib/cheapcgi.c:770), holding the name of the file the " + "user picked. The uploaded list itself is " + "hgta_identifierFile, a server path, described in the " + "#37623 file-variable registry rather than here."), + v("hgta_userRegionsDb, hgta_enteredUserRegions", "string", + "hg/hgTables/userRegions.c:29", sep="", + note="The user's own region list as typed, and the assembly it " + "was typed against. As with the identifiers above, the " + "uploaded form is a server path, hgta_userRegionsFile, and " + "belongs to the #37623 registry."), + v("hgta_outFileName, hgta_outSep, hgta_printCustomTrackHeaders", + "string", "hg/hgTables/hgTables.c:1334", sep="", + values=["tab", "csv"], + valuesSrc="hg/hgTables/hgTables.h:580, for hgta_outSep only", + note="Where the output goes and how it is punctuated. " + "hgta_printCustomTrackHeaders is a boolean read with " + "cartCgiUsualBoolean at bedList.c:372."), + v("hgta_ctName, hgta_ctDesc", "string", + "hg/hgTables/bedList.c:379", sep="", + note="Name and description for the custom track the output is " + "turned into. Read with cgiUsualString rather than from " + "the cart, but they are ordinary form fields, so they are " + "saved like any other and sit in 493 saved sessions."), + v("hgta_mafGeneMafTable, hgta_mafGeneExons, hgta_mafGeneNoTrans, " + "hgta_mafGeneOutBlank, hgta_mafOutTable, hgta_mafNumColumns, " + "hgta_mafTruncHeader", "string", "hg/cgilib/pal.c:18", sep="", + note="Options for the protein-alignment output (hgta_palOut). " + "Each has a JavaScript twin named without the hgta_ " + "prefix, defined beside it in pal.c, which is what the " + "page's script reads."), ], }, } # --------------------------------------------------------------------------- # Track-scoped state that does NOT start with the track name. These are the # cases a " at the top" hierarchy has to special-case. # --------------------------------------------------------------------------- EXCEPTIONS = [ {"pattern": "cgs__", "what": "chromGraph settings", "src": "hg/lib/chromGraph.c:chromGraphVarName", "why": "Prefix comes first, so a prefix scan for '.' misses it."}, {"pattern": "hgtgroup__close",