I want to create bigwigs in Python. Is there a library that can do this?
Two ways of doing it that I'd rather avoid:
Currently I use rpy2 with rtracklayer and genomicranges through bioconda. This works, but is a bit heavy on the dependencies. Example code: https://github.com/endrebak/epic/blob/256ce4974a4ca6a10a0a5cca041c12a4e7ee9eb9/epic/bigwig/create_bigwigs.py
Another option is to use the UCSC binary tools: create a bedGraph and then convert it to bigwig by bedgraphtobigwig, but this is rather slow due to IO as you need to write files twice.
Wonderful, thanks for your effort! Python3 even <3
It seems like bw.addEntries would take four enormous lists if I know all the entries upfront. I guess I should chunk the data and add a 1000 entries at a time...
You can add one at a time, that works just as well.