Entering edit mode
3.9 years ago
camelest
▴
50
I'm wondering someone could help about the error on bigWigAverageOverBed. My system is Ubuntu 18.04.4 LTS and bigWigAverageOverbed is v357.
I'm encountering an error with a simple code as below,
bigWigAverageOverBed input.bw INPUT.bed output.tab
which gives me back as
processing chromosomes Segmentation fault (core dumped)
I have three files as INPUT.bed, which I modified by awk command according to their ovelaps with another reference BEDfile. Somehow only one of the three INPUT.bed gives the error as above. Since the size of the one was relatively large (36M), so I tried splitting it but the error doesn't change.
Any help would be really appreciated.
I had a similar error (
Segmentation fault
) inbigWigAverageOverBed
due to a small number of entries in the bed file which had an end position beyond the length of their respective chromosome. Once these were removed the file processed fine regardless of size (up to 16M at least). I suggest rather than just splitting the file, trying to slice it to from the top (e.g. usinghead
, each time with a bigger-n
) to see if the problem only starts at a certain point in the bed file.I'm sorry for the late reply. I thought I replied but just realized it wasn't successfully posted. In conclusion, chatul's point was correct. When I removed regions beyond the chromosomes, the error went away. Thank you so much for the help.
what is the output of
Thank you for your input. These are the results.
That looks like a pretty unusual bed file, where the chromosomes do not look formatted correctly, and it isn't sorted in a typical way. What do the chromosome names in the bigWig file look like?
Thank you for your help. So it seems that there is something wrong in Chr column with my BED file. I used bigWigtobedGraph and the result is something like this.
Chromosome names have to match up to do operations. In other words,
1,chr1
will not match up withchr1
, for example. Adjust yourawk
statement accordingly, so that you're not adding commas, numbers or other extraneous stuff to the chromosome field ofINPUT.bed
.Thank you for your comment. I think something like "1,Chr1" is output of the code Pierre Lindenbaum suggested. 1 is the result of int($3)-int($2) in printf, if I understand correctly (sorry I'm pretty new to this area).
The below code gives me the usual Chr orders.
Do you have any other ideas why this doesn't work? Thank you so much for the help.
you're not the only one with this problem: it looks like a problem with the memory management/ with the OS: https://www.google.com/search?client=q=bigWigAverageOverBed+segmentation+fault
Thank you for your input. I also encountered some posts stating that. But if its memory problem, shouldn't splitting the file solve the problem?
You could try splitting the BED file by chromosome:
Then run your
bigWigAverageOverBed
step on each per-chromosome file.If you want to track memory usage, you can run
top
while running your per-chromosome process and press Shift-M to sort processes by memory.Presumably,
chr1
would be your largest file and so use the most memory.