deeptools / pyBigWig

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

Create a BedGraph file using addEntries() throws segmentation fault #129

Closed priesgo closed 2 years ago

priesgo commented 2 years ago

Create a BedGraph file as shown below throws a Segmentation fault to me. Can someone else reproduce this error or may this be something with my local environment?

I am running pyBigWig 0.3.18 and Python 3.8.10

import pyBigWig

bw = pyBigWig.open("vafator/tests/resources/best.seg.minimal.bed", "w")
bw.addEntries(['1', '1', '1'], [100, 200, 300], ends=[200, 300, 400], values=[1.2, 1.3, 1.4])
dpryan79 commented 2 years ago

@priesgo You need to add the bigWig header first: https://github.com/deeptools/pyBigWig#add-a-header-to-a-bigwig-file

priesgo commented 2 years ago

I see now! Thanks!