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/utils/hubCheck/hubCheck.c src/hg/utils/hubCheck/hubCheck.c
index c160916441b..cd25ad6fca8 100644
--- src/hg/utils/hubCheck/hubCheck.c
+++ src/hg/utils/hubCheck/hubCheck.c
@@ -781,31 +781,31 @@
         {
         errAbort("Track \"%s\" is a parent track (compositeTrack/superTrack/view/container) but also has "
             "a 'bigDataUrl'. Parent tracks organize subtracks and should not have data files. "
             "Remove 'bigDataUrl' from this stanza, or remove the parent declaration if this is "
             "a data track.", tdb->track);
         }
     }
 else if (tdb->subtracks != NULL)
     {
     errAbort("Track \"%s\" has children tracks (e.g: \"%s\"), but is not a "
         "compositeTrack, container, view or superTrack", tdb->track, tdb->subtracks->track);
     }
 }
 
 static char *VALID_TRACK_TYPES[] = {
-    "bam", "bigBarChart", "bigBed", "bigChain", "bigGenePred", "bigInteract",
+    "bam", "bigBarChart", "bigBed", "bigChain", "bigGenePred", "bigInteract", "bigNet",
     "bigLolly", "bigMaf", "bigMethyl", "bigNarrowPeak", "bigPsl", "bigRmsk",
     "bigWig", "halSnake", "hic", "longTabix", "vcfPhasedTrio", "vcfTabix", NULL};
 
 static bool isValidTrackType(char *trackType)
 /* check that a track type is valid */
 {
 // **** DANGER, WILL ROBINSON! ****
 // There is also code in trackHub.c that checks track names.
 // both places must be changed or common code created.
 for (int i = 0; VALID_TRACK_TYPES[i] != NULL; i++)
     if (sameString(trackType, VALID_TRACK_TYPES[i]))
         return TRUE;
 return FALSE;
 }