From 46164058fcc92a9e10c5557a0c67a8b284c4bf82 Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Mon, 1 Feb 2016 23:28:53 +0100 Subject: [PATCH] Change the order of the sections, putting the summary info before the chromosome list. This fixes Jbrowse functionality. --- bigWig.h | 2 +- bwWrite.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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;