cfa3310ec7d0c3ef45a3f647c7e7164453d9d4e0 kent Tue Mar 5 01:01:42 2013 -0800 A little more progress on multiple extra index change. First time reader and writer have both worked in any small way together. diff --git src/inc/bbiFile.h src/inc/bbiFile.h index fbbc150..3eb1c31 100644 --- src/inc/bbiFile.h +++ src/inc/bbiFile.h @@ -29,31 +29,32 @@ * autoSql string (zero terminated - only present if autoSqlOffset non-zero) * totalSummary - summary of all data in file - only present if totalSummaryOffset non-zero * basesCovered 8 bytes * minVal 8 bytes float (for bigBed minimum depth of coverage) * maxVal 8 bytes float (for bigBed maximum depth of coverage) * sumData 8 bytes float (for bigBed sum of coverage) * sumSquared 8 bytes float (for bigBed sum of coverage squared) * extendedHeader * extensionSize 2 size of extended header in bytes - currently 64 * extraIndexCount 2 number of extra fields we will be indexing * extraIndexListOffset 8 Offset to list of non-chrom/start/end indexes * reserved 48 All zeroes for now * extraIndexList - one of these for each extraIndex * type 2 Type of index. Always 0 for bPlusTree now * fieldCount 2 Number of fields used in this index. Always 1 for now - * reserved 12 All zeroes for now + * indexOffset 8 offset for this index in file + * reserved 4 All zeroes for now * fieldList - one of these for each field being used in _this_ index * fieldId 2 index of field within record * reserved 2 All zeroes for now * chromosome b+ tree bPlusTree index * full data * sectionCount 8 bytes (item count for bigBeds) * section data section count sections, of three types (bed data for bigBeds) * full index cirTree index * zoom info one of these for each zoom level * zoom data * zoomCount 4 bytes * zoom data there are zoomCount of these items * chromId 4 bytes * chromStart 4 bytes * chromEnd 4 bytes @@ -117,31 +118,34 @@ 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 bptFile *nameBpt; /* Index of names, may be NULL */ // uglyf - remove + struct bptFile *uglyOldNameBpt; /* Index of names, may be NULL */ // uglyf - remove + + /* Some fields that should not be accessed directly as they may not have good values. */ + struct asObject *cachedAs; /* Cached parsed version. Use bigBedAsOrDefault() to get this. */ }; 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 */