In the following snippet
with pyBigWig.open(file) as bw:
data = bw.values(chromosome, start, end, numpy=True)
If the chromosome value is not present in the bigWig chromosomes, the following error is raised:
RuntimeError: Invalid interval bounds!
However, this error suggests there is a problem with the coordinates, even if it is not the case.
It may be a useful change to separate the handling of both errors, by adding something like
RuntimeError: Invalid chromosome name!: {chromosome}.
Other improvement I can think of is printing the problematic coordinates, such as
RuntimeError: Invalid interval bounds! start: {start}, end: {end}, chromosome: {chromosome}, length: {length}
If useful, I could submit a PR.
This issue is related to #49 , #124 and #152