'Error: Unable to open file test1.bed. Exiting' , Bedtools help
1
0
Entering edit mode
5.4 years ago
reece • 0

Hi everyone,

I am very new to all of this so I apologise for any simple mistakes. Today I have been trying to merge 2 files at 500bp using Bedtools. I have both files in the format of:

chr1    812283  812293
chr1    812566  812576
chr1    811236  811246

As far as I'm aware each column is separated by tabs, and I have tried using test .bed files with only a few rows. When using: bedtools merge -i test1.bed test2.bed -d 500 < sorted.bed or even just trying to access the bed files using a different command (bedtools merge -i test1.bed), I am receiving 'Error: Unable to open the test1.bed. exiting.'

Does anyone know why this could be happening? Any help is greatly appreciated.

bed mergeBed bedtools • 6.1k views
ADD COMMENT
1
Entering edit mode
Bedtools merge -i test1.bed test2.bed -d 500 < sorted.bed

This cannot work as bedtools merge expect exact one bed file as input. You have three (test1.bed, test2.bed and as a stream from sorted.bed

'Error: Unable to open the test1.bed. exiting

This message appears also if bedtools cannot find the files. So check if you are in the correct folder from where you start bedtools merge. The correct syntax should be $ bedtools merge -i test1.bed -d 500.

fin swimmer

ADD REPLY
0
Entering edit mode

I didn't realise this, I will give it a go. Thank you!

Edit - Unfortunately still no joy, grateful for the help though

ADD REPLY
0
Entering edit mode

Most likely either there's a typo in the command (you mistyped the file name) or the user you're running bedtools with doesn't have read permission.

ADD REPLY
0
Entering edit mode

Hi, I've just checked and I believe the input to be correct and I am running as administrator. Do I need to store the .bed file anywhere specifically for it to work? Thank you for the feedback!

ADD REPLY
0
Entering edit mode

Either you specify the full path to the bed file, or you make sure it's in your current working directory.

ADD REPLY
1
Entering edit mode
5.4 years ago
ATpoint 82k

Bedtools complaining about files is 99.9% the case when the delimiter is not tab but something else like tab-whitespace, whitespace-tab or anything which is not exactly tab. Given your files were truely tab-delimited:

cat test1.bed test2.bed (...) testn.bed | sort k1,1 -k2,2n | bedtools merge -i - -d 500 > merged.bed
ADD COMMENT

Login before adding your answer.

Traffic: 2698 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