samtools/htslib — pull request #102 by gabeiscoding (2014-06-03 18:23:19+00:00)
Title: Changes for compiling on MSVC C and being a library of a GUI app

Hey samtools team,

I don't expect this pull request to be accepted full hog, but I wanted to check on your interest on merging in some of the changes I'm making on my fork.

The fork is being used currently in GenomeBrowse to do:
- VCF/BED bgzip compression and tabix indexing in-process with progress and cancel and informative error messages
- Reading VCF/BED with genomic queries for visualization in the browser and table
- Reading VCF/BED by individual feature offsets to "lookup" a feature (record) to get it's details
- Creating the BAI index for unindexed BAM files with progress and cancel
- Powering through mpileup the computation of coverage for creating zoomed-out binned coverage histograms
- (Note I'm currently using bamtools to do the reading of BAM, and use to use it for BAI generation until I found a very disconcerting bug)

As such the following major changes were made:
- Made to compile on MSVC C (we are cross platform and deploy on Mac,Windows and Linux)
(I had to swap off_t and long based file offsets for int64_t to support 32-bit systems)
- Added progress callback to the index generation routine as well as passing in a error string buffer so we can display informative error messages to the user instead of being dumped to stderr
- Added ability to get the virtual file offset of each record read through the hts iterator so you could optionally get back to that record at a later time (we hold minimal data in memory but allow introspection of the full record on demand).

Let me know if you are interested in merging any of these things upstream and if there is anything I can do to assist.

Thanks, Gabe