54406b80d5d435970989acff7b22dd6146c6b411
braney
  Sat Jan 22 15:24:59 2022 -0800
adding chrom alias support to big files

diff --git src/inc/bbiFile.h src/inc/bbiFile.h
index 587dcfe..9db13b1 100644
--- src/inc/bbiFile.h
+++ src/inc/bbiFile.h
@@ -95,55 +95,59 @@
     bits32 reserved;			/* Zero for now. */
     bits64 dataOffset;			/* Offset of data for this level in file. */
     bits64 indexOffset;			/* Offset of index for this level in file. */
     };
 
 struct bbiZoomLevel *bbiBestZoom(struct bbiZoomLevel *levelList, int desiredReduction);
 /* Return zoom level that is the closest one that is less than or equal to 
  * desiredReduction. */
 
 struct bbiFile 
 /* An open bbiFile */
     {
     struct bbiFile *next;	/* Next in list. */
     char *fileName;		/* Name of file - for better error reporting. */
     struct udcFile *udc;	/* Open UDC file handle. */
+    struct hash *aliasHash;     /* If non-NULL, constains chrom alias hash. */
     bits32 typeSig;		/* bigBedSig or bigWigSig for now. */
     boolean isSwapped;		/* If TRUE need to byte swap everything. */
     struct bptFile *chromBpt;	/* Index of chromosomes. */
     bits16 version;		/* Version number - initially 1. */
     bits16 zoomLevels;		/* Number of zoom levels. */
     bits64 chromTreeOffset;	/* Offset to chromosome index. */
     bits64 unzoomedDataOffset;	/* Start of unzoomed data. */
     bits64 unzoomedIndexOffset;	/* Start of unzoomed index. */
     bits16 fieldCount;		/* Number of columns in bed version. */
     bits16 definedFieldCount;   /* Number of columns using bed standard definitions. */
     bits64 asOffset;		/* Offset to embedded null-terminated AutoSQL file. */
     bits64 totalSummaryOffset;	/* Offset to total summary information if any.  
 				   (On older files have to calculate) */
     bits32 uncompressBufSize;	/* Size of uncompression buffer, 0 if uncompressed */
     bits64 extensionOffset;	/* Start of header extension block or 0 if none. */
     struct cirTreeFile *unzoomedCir;	/* Unzoomed data index in memory - may be NULL. */
     struct bbiZoomLevel *levelList;	/* List of zoom levels. */
 
     /* Fields based on extension block. */
     bits16 extensionSize;   /* Size of extension block */
     bits16 extraIndexCount; /* Number of extra indexes (on fields other than chrom,start,end */ 
     bits64 extraIndexListOffset;    /* Offset to list of extra indexes */
     };
 
 
+struct bbiFile *bbiFileOpenAlias(char *fileName, bits32 sig, char *typeName, struct hash *aliasHash);
+/* Open up big wig or big bed file with chrom alias hash. */
+
 struct bbiFile *bbiFileOpen(char *fileName, bits32 sig, char *typeName);
 /* Open up big wig or big bed file. */
 
 void bbiFileClose(struct bbiFile **pBwf);
 /* Close down a big wig/big bed file. */
 
 struct fileOffsetSize *bbiOverlappingBlocks(struct bbiFile *bbi, struct cirTreeFile *ctf,
 	char *chrom, bits32 start, bits32 end, bits32 *retChromId);
 /* Fetch list of file blocks that contain items overlapping chromosome range. */
  
 struct bbiChromIdSize
 /* We store an id/size pair in chromBpt bPlusTree */
     {
     bits32 chromId;	/* Chromosome ID */
     bits32 chromSize;	/* Chromosome Size */