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/makefile src/hg/utils/makefile
index f17d7e9c3f1..a6e51fbc786 100644
--- src/hg/utils/makefile
+++ src/hg/utils/makefile
@@ -40,30 +40,31 @@
 	genePredFilter \
 	genePredToBigGenePred \
 	genePredToProt \
 	gencodeVersionForGenes \
 	gff3ToGenePred \
 	gff3ToPsl \
 	gtfToGenePred \
 	hicInfo \
 	hgvsToVcf \
 	hubCheck \
 	hubClone \
 	hubPublicCheck \
 	mafToBigMaf \
 	mafToBigMafSummary \
 	makeTableList \
+	netToBigNet \
 	oligoMatch \
 	overlapSelect \
 	positionalTblCheck \
 	pslLiftSubrangeBlat \
 	pslToBigPsl \
 	raSqlQuery \
 	rmskAlignToPsl \
 	tdbQuery \
 	transMapPslToGenePred \
 	twoBitMask \
 	vcfToBed \
 	fixTrackDb
 
 USER_APP_SCRIPTS = \
 	vai.pl
@@ -102,30 +103,31 @@
 	vcfRenameAndPrune \
 	vcfToHgvs \
 	wigBedToStep
 
 TEST_DIRS = \
 	bedMergeAdjacent \
 	bedPartition \
 	genePredFilter \
 	genePredToProt \
 	gff3ToGenePred \
 	gff3ToPsl \
 	gtfToGenePred \
 	hgvsToVcf \
 	hubCheck \
 	mafToBigMafSummary \
+	netToBigNet \
 	overlapSelect \
 	pslToBigPsl \
 	refSeqGet \
 	transMapPslToGenePred \
 	vcfToHgvs
 
 APPS = $(DIRS) $(UTILS_APPLIST)
 
 all:: utils
 
 utils: $(APPS:%=%.utils) $(APP_SCRIPTS:%=%.appScript)
 # tolerate missing directories, as some were removed in kent-core
 %.utils:
 	if test -d $* ; then cd $* && echo $* && $(MAKE) ; fi
 %.appScript: