353a34ac7e7638457db3f55e57452069113d860b
braney
  Sun Sep 6 13:34:28 2026 -0700
Add a bigNet track type, a net of alignments in a bigBed, refs #20824

Track hubs have had no way to show a real net.  The usual stand-in is a
net rendered as a maf, which loses the level structure that makes a net
useful for establishing orthologous sequence.  bigNet holds the netAlign
columns in a bigBed, so a hub can carry the net itself.

The format is bed6+20: the target in chrom/chromStart/chromEnd, the query
sequence in name, the query strand in strand, then level and the rest of
the netAlign fields.  The trackDb line is

type bigNet <targetDb> <chainTrack>

mirroring type netAlign.  chainTrack is the plain trackDb name of the
bigChain track in the same hub; hgc adds the hub prefix itself.

chainNetLoadRangeHub() builds a chainNet from a bigBed range query and
hands it to the same helpToNet() the SQL path uses, so the nesting is
rebuilt the same way.  netDraw picks its loader off tg->isBigBed and the
drawing code below that is untouched.  genericNetClick does the same for
the details page and follows the named chain track for the alignment.

Also bounds the level walk in helpToNet() by help->maxDepth.  It could
read one past the end of the levels array.

netToBigNet converts a net file to bedToBigBed input.  It writes the tab
line itself rather than calling bigNetTabOut, because autoSql prints a
double with %g and that drops digits off a chain score.

diff --git src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.yaml src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.yaml
index 8e7f1b36c9a..ed148214e8d 100644
--- src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.yaml
+++ src/hg/htdocs/goldenPath/help/trackDb/trackDbSettings.yaml
@@ -25,32 +25,32 @@
 - name: type_for_hubs
   types:
   - all
   roles:
   - super
   - composite
   - view
   - leaf
   category: Common Settings
   context: trackDb
   level: required
   required: true
   summary: Declares the format of the data and is used to determine display methods and options.
   description: 'Declares the format of the data and is used to determine display methods and options.
     Valid settings for a hub: bam/cram , bigBarChart , bigBed , bigChain , bigGenePred , bigInteract ,
-    bigLolly , bigMaf , bigNarrowPeak , bigPsl , bigWig , halSnake , hic , vcfTabix , vcfPhasedTrio .
-    Detailed descriptions of each type can be found below. In many cases the type setting includes additional
+    bigLolly , bigMaf , bigNarrowPeak , bigNet , bigPsl , bigWig , halSnake , hic , vcfTabix , vcfPhasedTrio
+    . Detailed descriptions of each type can be found below. In many cases the type setting includes additional
     parameters to further specify the data format. Some track types have additional setting requirements,
     to be discussed below.'
   format: type
   examples:
   - type bigBed 6 +
 - name: shortLabel
   types:
   - all
   roles:
   - super
   - composite
   - view
   - leaf
   category: Common Settings
   context: trackDb
@@ -83,56 +83,57 @@
     to identify a track. For instance, the long label is displayed above the track's data in the Browser
     image. This label should be descriptive enough to allow users to uniquely identify the track within
     the Browser. It is limited to 76 printable characters. Some special characters are allowed in the
     longLabel.
   format: longLabel
   examples:
   - longLabel Human mRNAs from GenBank
 - name: bigDataUrl
   types:
   - bigBarChart
   - bigBed
   - bigChain
   - bigInteract
   - bigLolly
   - bigMaf
+  - bigNet
   - bigPsl
   - bigWig
   - bam
   - hic
   - vcfTabix
   - vcfPhasedTrio
   roles:
   - super
   - composite
   - view
   - leaf
   category: Common Settings
   context: trackDb
   level: required
   required: true
   summary: The location of a remote data file containing the bulk of the data for the track.
   description: 'The location of a remote data file containing the bulk of the data for the track. This
     setting is required for all data tracks in a track hub. The setting is either the full URL (including
     http: or another protocol) or it is relative to the directory in which the trackDb file containing
     this setting is located. The file must be in one of the supported remote data file formats: bam/cram,
-    bigBarChart, bigBed, bigChain, bigLolly, bigInteract, bigMaf, bigPsl, bigGenePred, bigMethyl, bigNarrowPeak,
-    bigWig, vcfTabix, or hic. Note that bam/cram and vcfTabix/vcfPhasedTrio types require a separate index
-    file that must have the same name as the data file plus a standard suffix (".bai" and ".tbi" respectively),
-    unless bigDataIndex is used. All occurrences of the string $D in the URL will be substituted with
-    the genome assembly database name. This allows a trackDb entry to be used with for multiple assemblies.
-    $D substitution is not implemented for track hubs.'
+    bigBarChart, bigBed, bigChain, bigLolly, bigInteract, bigMaf, bigNet, bigPsl, bigGenePred, bigMethyl,
+    bigNarrowPeak, bigWig, vcfTabix, or hic. Note that bam/cram and vcfTabix/vcfPhasedTrio types require
+    a separate index file that must have the same name as the data file plus a standard suffix (".bai"
+    and ".tbi" respectively), unless bigDataIndex is used. All occurrences of the string $D in the URL
+    will be substituted with the genome assembly database name. This allows a trackDb entry to be used
+    with for multiple assemblies. $D substitution is not implemented for track hubs.'
   format: bigDataUrl <url/relativePath>
   examples:
   - bigDataUrl http://vizhub.wustl.edu/VizHub/hg19/biBrainH3K4me1.bb
   - bigDataUrl biBrainH3K4me1.bb
 - name: html
   types:
   - all
   roles:
   - super
   - composite
   - view
   - leaf
   category: Common Settings
   context: trackDb
   level: base
@@ -2674,30 +2675,43 @@
   - bigChain
   - bam
   roles:
   - leaf
   category: bigChain - Pairwise Alignments
   context: trackDb
   level: full
   required: false
   summary: Specifies the default drawing mode.
   description: Specifies the default drawing mode. The itemBases , itemCodons , diffBases and diffCodons
     options are applicable only if the track has sequence, as specified by the baseColorUseSequence setting.
     The genomicCodons , itemCodons and diffCodons are applicable only if the track has CDS info, as specified
     by the baseColorUseCds setting.
   format: "baseColorDefault\n                    <diffBases/diffCodons/itemBases/itemCodons/genomicCodons>"
   examples: []
+- name: bigNet
+  types:
+  - bigNet
+  roles:
+  - leaf
+  category: bigNet - Alignment Nets
+  context: trackDb
+  level: new
+  required: false
+  summary: ''
+  description: ''
+  format: type bigNet targetDb chainTrack
+  examples: []
 - name: bigGenePred
   types:
   - bigGenePred
   roles:
   - leaf
   category: bigGenePred - Gene Annotations
   context: trackDb
   level: null
   required: false
   summary: ''
   description: ''
   format: type bigGenePred
   examples: []
 - name: intronGap
   types: