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 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/inc/chainNetDbLoad.h src/hg/inc/chainNetDbLoad.h index a34f1347bcb..2550b2fcd02 100644 --- src/hg/inc/chainNetDbLoad.h +++ src/hg/inc/chainNetDbLoad.h @@ -1,59 +1,63 @@ /* chainNetDbLoad - This will load a database representation of * a net into a chainNet representation. Also helps database * representation of chain into chain. */ /* Copyright (C) 2002 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #ifndef CHAINNETDBLOAD_H #define CHAINNETDBLOAD_H #ifndef JKSQL_H #include "jksql.h" #endif #ifndef NETALIGN_H #include "netAlign.h" #endif #ifndef CHAINNET_H #include "chainNet.h" #endif struct cnFill *cnFillFromNetAlign(struct netAlign *na, struct hash *nameHash); /* Convert netAlign to cnFill. Name hash is a place to store * the strings. */ struct chainNet *chainNetLoadResult(struct sqlResult *sr, int rowOffset); /* Given a query result that returns a bunch netAligns, make up * a list of chainNets that has the equivalent information. * Note the net->size field is not filled in. */ struct chainNet *chainNetLoadRange(char *database, char *track, char *chrom, int start, int end, char *extraWhere); /* Load parts of a net track that intersect range. */ +struct chainNet *chainNetLoadRangeHub(char *fileName, char *chrom, int start, int end); +/* Load the parts of a bigNet file that intersect range into a chainNet. + * Note the net->size field is not filled in. */ + struct chainNet *chainNetLoadChrom(char *database, char *track, char *chrom, char *extraWhere); /* Load net on whole chromosome. */ struct chain *chainLoadIdRangeHub(char *database, char *fileName, char *track, char *chrom, int start, int end, int id); /* Load parts of chain of given ID from bigChain file. Note the chain header * including score, tStart, tEnd, will still reflect the whole chain, * not just the part in range. However only the blocks of the chain * overlapping the range will be loaded. */ struct chain *chainLoadIdRange(char *database, char *track, char *chrom, int start, int end, int id); /* Load parts of chain of given ID from database. Note the chain header * including score, tStart, tEnd, will still reflect the whole chain, * not just the part in range. However only the blocks of the chain * overlapping the range will be loaded. */ struct chain *chainLoadId(char *database, char *track, char *chrom, int id); /* Load chain of given ID from database. */ #endif /* CHAINNETDBLOAD_H */