diff --git a/bigWig.h b/bigWig.h index b761366..8c24127 100644 --- a/bigWig.h +++ b/bigWig.h @@ -41,7 +41,7 @@ /*! * The library version number */ -#define LIBBIGWIG_VERSION 0.1.3 +#define LIBBIGWIG_VERSION 0.1.4 /*! * The magic number of a bigWig file. diff --git a/bwWrite.c b/bwWrite.c index ab1068e..a444735 100644 --- a/bwWrite.c +++ b/bwWrite.c @@ -179,16 +179,16 @@ int bwWriteHdr(bigWigFile_t *bw) { } } - //Write the chromosome list as a stupid freaking tree (because let's TREE ALL THE THINGS!!!) - bw->hdr->ctOffset = ftell(fp); - if(writeChromList(fp, bw->cl)) return 7; - if(writeAtPos(&(bw->hdr->ctOffset), sizeof(uint64_t), 1, 0x8, fp)) return 8; - //Update summaryOffset and write an empty summary block bw->hdr->summaryOffset = ftell(fp); if(fwrite(p, sizeof(uint8_t), 40, fp) != 40) return 10; if(writeAtPos(&(bw->hdr->summaryOffset), sizeof(uint64_t), 1, 0x2c, fp)) return 11; + //Write the chromosome list as a stupid freaking tree (because let's TREE ALL THE THINGS!!!) + bw->hdr->ctOffset = ftell(fp); + if(writeChromList(fp, bw->cl)) return 7; + if(writeAtPos(&(bw->hdr->ctOffset), sizeof(uint64_t), 1, 0x8, fp)) return 8; + //Update the dataOffset bw->hdr->dataOffset = ftell(fp); if(writeAtPos(&bw->hdr->dataOffset, sizeof(uint64_t), 1, 0x10, fp)) return 12;