deeptools / pyBigWig

A python extension for quick access to bigWig and bigBed files
MIT License
212 stars 48 forks source link

'zsh: segmentation fault ' #147

Closed violacimatti closed 2 months ago

violacimatti commented 5 months ago

this is my code: import pyBigWig

bigwig_file = "MB12_H3K27me3copy.bw"

bw = pyBigWig.open(bigwig_file, 'w')

bw.addEntries(['chr3'], [103385937],ends=[103385938], values=[0.])

bw.close()

When I run it I don't know why but I get this error: zsh: segmentation fault The file should be accessible and correct and I get this error only when I run pyBigwig

dpryan79 commented 2 months ago

If memory serves you need to add the bigWig header with bw.addHeader([("chr3", 103385938)]) first. Remember that bigWig files are kind of like BAM files, they have a header that lists the contigs, their order and size.