dpryan79 / libBigWig

A C library for handling bigWig files
MIT License
73 stars 25 forks source link

Feature request: BigBed reader #12

Closed dzerbino closed 7 years ago

dzerbino commented 7 years ago

Hello,

Tied in to ticket #11, would it be possible for libBigWig to read BigBeds?

Hopefully, it should not be too painful: the search tree / compression block structure is identical, only the content of the compressed blocks is different.

Thanks in advance for considering my request,

Daniel

dpryan79 commented 7 years ago

I had a chance to start playing around a bit with bigBed support. Have a look at the "bigBed" branch and this example file. In essence, I added a bbOpen() function similar to bwOpen() and a bbGetOverlappingEntries() that can access all entries overlapping an interval. I don't know if you need the string associated with each entry or just to know where each entry is, so both are possible with that function.

I also added a function to get the SQL string and to test for whether the file is in bigBed or bigWig format. Presumably those will be useful for you as well.

dzerbino commented 7 years ago

Thanks! I had a quick read through your test code, and the interface covers all the use cases I could think of.

dpryan79 commented 7 years ago

Cool, I'll get the documentation finished and merge it into the master branch.

dpryan79 commented 7 years ago

This is now implemented in the master branch. I'll make a new release once the iterator stuff is complete.