679b48855a32f8ea1e1ea8ca3c095a0c2c7f6c7a max Tue Sep 8 10:08:41 2026 -0700 detailsScript: add a scatterPlot plot type, and use it for pcLAI Clicking a pcLAI window now shows where that window sits in the ancestry space it was placed in: a scatterplot of the 1000 Genomes reference haplotypes with the window's own PCA coordinate and its segment's coordinate marked on it. The numbers were already on the details page and told a reader almost nothing. New plot type scatterPlot (hg/js/hgc.scatterPlot.js), driven the same way as histogram. Background points come from a JSON or TSV file named by dataUrl and may carry a category, which colors them and builds a legend, and a label, which is shown on mouseover. The cloud is drawn on a canvas, since these files hold thousands of points and that many elements make the page crawl; axes and the highlighted points stay SVG on top. Point lookup for the mouseover goes through a cell index so a large file stays smooth. Two additions serve every plot type, not just this one: - exportFields, a config key listing further bigBed fields whose values are passed to the module as a fieldValues object. Without it a plot needing two coordinates would need them packed into one field, and pcLAI keeps them in pca and pcaSegment. Only fields that exist in the bigBed are exported, at most 32, and the JSON types are checked rather than asserted because jsonListVal and jsonStringVal errAbort and this JSON is written by a hub. - a config key ending in Url is treated as a file, by the convention trackSettingIsFile() already uses, and a relative one is resolved against the track's own bigDataUrl. The module does not fetch it directly; it asks hgTrackUi for it, the route facetedComposite uses for its metadata. That checks the canonicalized path against the hubs on the cart and reads it with udc, so a hub-relative path works even for a hub loaded from a local path (the GenArk /gbdb hubs), no CORS header is needed, and a file outside a connected hub cannot be read. Verified that /etc/passwd, file://, a dot-dot escape, an unattached hub and an unrelated host are all refused with 400. When the session has file caching off, hgc now exports udcTimeout the way hgTrackUi does and the module POSTs, so the browser cannot answer from cache. Fixes a crash reachable from any hub: "detailsScript.. null" segfaulted hgc, because jsonObjectVal returns NULL for a JSON null and the hash routines dereference it. This hit the shipped histogram type too. trackDbSettingsGen.py stopped reading a setting's description at the first "Example:" paragraph and never read
    at all, so it dropped everything after the first example and every list item. That silently truncated 226 of the 264 descriptions, including spectrum's minGrayLevel/scoreMin/scoreMax bullets, and would have dropped this whole scatterPlot section. It now skips the Example label instead of stopping, and folds list items in. No setting loses a word and none gains or loses an example. pcLAI wiring: the background file is the authors' published reference panel (github.com/AI-sandbox/hprc-pclai reference_pca_metadata.tsv), converted by hprc2annotMakePclaiRefPanel.py -- 3122 haplotypes, 21 populations, 94 KB, one file for the collection since it is the reference space rather than per-assembly data. The four values pcaSegment takes across all 460 assemblies turn out to be the four continental cluster centres, so the highlighted segment dot always lands on one of them. genark: addContrib now rewrites a "...Url" inside a detailsScript value the same way it rewrites bigDataUrl, and symlinks the collection's shared root-level data files next to the docs, so contrib// resolves in the deeper GenArk layout. It writes the alpha tier only, leaving the assembly's default hub alone, and clears any unmarked copy of the collection's stanzas that the assembly build baked in, which would otherwise leave the hub declaring each track twice. refs #35415 diff --git src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.json src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.json index 735541ca44e..9f485db3245 100644 --- src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.json +++ src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.json @@ -1,4036 +1,4036 @@ { "version": "v3", "categories": [ "Common Settings", "Common Settings - less frequent", "bam - Compressed Alignment Track Settings", "bigBarChart", "bigBed - Item or Region Track Settings", "Item or Region Track Settings - less frequent", "bigChain - Pairwise Alignments", "bigNet - Alignment Nets", "bigGenePred - Gene Annotations", "bigInteract", "bigMaf - Multiple Alignments", "bigNarrowPeak - Peaks", "bigPsl - Pairwise Alignments", "bigWig - Signal Graphing Track Settings", "bigLolly - Lollipop charts", "hic - Hi-C contact matrices", "halSnake - Multiple Alignments", "vcfTabix - Variant Call Format Track Settings", "vcfPhasedTrio - Variant Call Format Track Settings", "superTrack - Folder Track Settings", "Composite Track Settings", "Composite - Subgroups Settings", "Composite - Views Settings", "Faceted Composite Settings", "Aggregate or Overlay Track Settings", "general hub file settings", "genomes file settings", "Miscellaneous Deprecated Settings" ], "settings": [ { "key": "track", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "required", "fmt": "track", "ex": "track myFirstTrack", "desc": "This is the name of the dataset and must be unique within the Genome Browser or dataHub." }, { "key": "type", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "required", "fmt": "type", "ex": "type bigBed 6 +", "desc": "Declares the format of the data and is used to determine display methods and options." }, { "key": "shortLabel", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "required", "fmt": "shortLabel", "ex": "shortLabel Human mRNAs", "desc": "Specifies the track's \"short label\", which is used in a number of places in the Browser to identify the track." }, { "key": "longLabel", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "required", "fmt": "longLabel", "ex": "longLabel Human mRNAs from GenBank", "desc": "Specifies the track's \"long label\", which is also used in numerous places in the Browser to identify a track." }, { "key": "bigDataUrl", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": [ "bigBarChart", "bigBed", "bigChain", "bigInteract", "bigLolly", "bigMaf", "bigNet", "bigPsl", "bigWig", "bam", "hic", "vcfTabix", "vcfPhasedTrio" ], "level": "required", "fmt": "bigDataUrl ", "ex": "bigDataUrl http://vizhub.wustl.edu/VizHub/hg19/biBrainH3K4me1.bb", "desc": "The location of a remote data file containing the bulk of the data for the track." }, { "key": "html", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "base", "fmt": "html", "ex": "html docs/myFirstTrack.html", "desc": "Use the html path/to/explain.html to specify the file that contains the complete description of a track in HTML format." }, { "key": "visibility", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "required", "fmt": "visibility", "ex": "visibility dense", "desc": "Visibility (i.e." }, { "key": "meta", "category": "Common Settings", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "meta", "ex": "", "desc": "Meta specifies the metadata tag for this track." }, { "key": "color", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "base", "fmt": "color ", "ex": "color 255,0,0", "desc": "Many track types allow the color of the data displayed in the image to be specified with this setting." }, { "key": "priority", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "base", "fmt": "priority ", "ex": "priority 50", "desc": "The priority is used to define the order of a track within its track group or data hub, as well as its default order within the Browser image." }, { "key": "canPack", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "deprecated", "fmt": "canPack ", "ex": "canPack on", "desc": "Deprecated." }, { "key": "configureByPopup", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "configureByPopup ", "ex": "configureByPopup off", "desc": "Most track displays that can be configured by a user can also be configured from directly within the Browser image through a right-click option that pops up..." }, { "key": "origAssembly", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "origAssembly ", "ex": "origAssembly hg18", "desc": "The original assembly version for which the dataset was generated." }, { "key": "altColor", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "altColor ", "ex": "altColor 0,0,255", "desc": "Many track types allow setting a color range that varies from color to altColor ." }, { "key": "boxedCfg", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "boxedCfg ", "ex": "boxedCfg on", "desc": "Configuration controls can be placed inside a box on the configuration page." }, { "key": "chromosomes", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "chromosomes ", "ex": "chromosomes chr1,chr7,chr18,chr19,chr22,chrX,chrM", "desc": "Some datasets do not contain data for all chromosomes of a genome." }, { "key": "darkerLabels", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "darkerLabels on", "ex": "", "desc": "If this setting is \"on\", the color of the left labels on the track display will have a somewhat darker color than the track display itself." }, { "key": "dataVersion", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "dataVersion ", "ex": "dataVersion May 2011 beta", "desc": "Many tracks undergo multiple revisions over time." }, { "key": "directUrl_for_hubs", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "directUrl ", "ex": "directUrl http://mygenes.org/cgi-bin/geneView/%s", "desc": "By default, items shown in the Browser image can be linked to a details page giving information about that item." }, { "key": "downloadUrl", "category": "Common Settings - less frequent", "roles": [ "super", "composite", "view", "leaf" ], "types": "all", "level": "full", "fmt": "downloadUrl