BedTools intersect - Segmentation fault
2
0
Entering edit mode
9.3 years ago
Maria333 ▴ 20

Hi,

Has anyone experienced the "segmentation fault" error while trying to use bedtools intersect option? I am trying to see overlap exons between 2 bed files but I'm getting this error all the time. Any help will be much appreciated.

Thank you

bedtools exons • 5.4k views
ADD COMMENT
0
Entering edit mode

Output of three commands: ẁhich bedtools, bedtools --version and uname -a could be helpful to know about your setup

ADD REPLY
4
Entering edit mode
9.3 years ago

If you are working with very large files, sort the bed files based on Chr and then Pos. sort -k1,1 -k2,2n and then use -sorted option.

From the manual:

-sorted For very large B files, invoke a "sweeping" algorithm that requires position-sorted (e.g., sort -k1,1 -k2,2n for BED files) input. When using -sorted, memory usage remains low even for very large files

If you still face the problem, split the files by Chr and then try to run the program at chromosome level. Otherwise provide more details about your data and post the exact error

ADD COMMENT
0
Entering edit mode

Thank you very much for that, it helped a lot. I sorted the bed file and then used sort -k1,1V to reverse the order so it is in ascending order.. Now I get the error:

Error: The genome file sorted.bed.ascending has no valid entries. Exiting.

Do you know why is this? The files seem fine now..

Thank you once again!

ADD REPLY
1
Entering edit mode

can you post few lines from your files ?

ADD REPLY
0
Entering edit mode
9.3 years ago

Another option:

$ sort-bed exons1.bed > sorted_exons1.bed
$ sort-bed exons2.bed > sorted_exons2.bed
$ bedops --element-of 1 sorted_exons1.bed sorted_exons2.bed > exons1_that_overlap_exons2.bed
$ bedops --element-of 1 sorted_exons2.bed sorted_exons1.bed > exons2_that_overlap_exons1.bed
ADD COMMENT

Login before adding your answer.

Traffic: 2276 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6