SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a tool that converts TXT, BED, GFF format to VCF? LauraSmith Bioinformatics 4 03-22-2017 02:41 AM
Updated How to convert .txt file to .bed .GFF or .BAR file format, forevermark4 Bioinformatics 2 06-30-2014 06:02 AM
htseq--SAM line does not contain at least 11 tab-delimited fields FLYINGDOLPHIN Bioinformatics 0 06-03-2013 12:04 PM
creating tab-delimited output from unix tonybert Bioinformatics 2 01-27-2013 07:37 AM
Tab Delimited File Editors? (GFF to GTF) DrD2009 Bioinformatics 16 11-30-2012 05:52 AM

Reply
 
Thread Tools
Old 08-19-2013, 07:45 AM   #1
id0
Senior Member
 
Location: USA

Join Date: Sep 2012
Posts: 130
Default BEDTools: Unexpected file format. Please use tab-delimited BED, GFF, or VCF.

I am using BEDTools and getting the following error:
Code:
Unexpected file format.  Please use tab-delimited BED, GFF, or VCF. Perhaps you have non-integer starts or ends at line 1?
I had a GFF file and figured maybe there is indeed a problem, so I converted it to a 3-column BED file just to be safe. The BED file did not work either.

I searched around for this error and it's usually caused by non-unix newlines or non-tab separators. My file does not have either of those issues.

Here are the first few lines of the BED file:
Code:
chr1	3214482	3216968
chr1	3421702	3421901
chr1	3670552	3671498
chr1	4290846	4293012
chr1	4343507	4350091
Any idea what may be causing this error?
id0 is offline   Reply With Quote
Old 08-19-2013, 07:49 AM   #2
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,079
Default

Check the bed file using the following command to make sure there are no unexpected characters.

Code:
$ cat -e filename.bed | more
or

Code:
$ cat -A filename.bed | more
The tab characters are displayed as "^I" (at least on CentOS).

Last edited by GenoMax; 08-19-2013 at 07:52 AM.
GenoMax is offline   Reply With Quote
Old 08-19-2013, 07:51 AM   #3
id0
Senior Member
 
Location: USA

Join Date: Sep 2012
Posts: 130
Default

Quote:
Originally Posted by GenoMax View Post
Check the bed file using the following command to make sure there are no unexpected characters and the file is indeeded tab limited.

Code:
$ cat -e filename.bed | more
I already did that. No unexpected characters.
id0 is offline   Reply With Quote
Old 08-19-2013, 07:57 AM   #4
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,079
Default

Are you getting the error even with a small subset like the one you pasted above?
GenoMax is offline   Reply With Quote
Old 08-19-2013, 08:05 AM   #5
id0
Senior Member
 
Location: USA

Join Date: Sep 2012
Posts: 130
Default

Used different files and small subsets and still getting the same problem.

Supposedly, the problem is at line 1, but there is really nothing wrong with it as far as I can tell.
id0 is offline   Reply With Quote
Old 08-19-2013, 08:11 AM   #6
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,079
Default

Not sure which exact bedtools program you need but perhaps bedops (http://code.google.com/p/bedops/) could provide an alternative.
GenoMax is offline   Reply With Quote
Old 08-19-2013, 08:27 AM   #7
id0
Senior Member
 
Location: USA

Join Date: Sep 2012
Posts: 130
Default

I am using coverageBed. I just wanted to quickly get coverage at specific regions.

I have a valid BED file. Why is BEDTools disagreeing?
id0 is offline   Reply With Quote
Old 08-19-2013, 08:29 AM   #8
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,079
Default

Have you used this copy of bedtools successfully before?
GenoMax is offline   Reply With Quote
Old 08-19-2013, 08:33 AM   #9
id0
Senior Member
 
Location: USA

Join Date: Sep 2012
Posts: 130
Default

No. Unfortunately I just got BEDTools.

It compiled and it seems to be running okay for the most part. I assume if there was a problem with BEDTools, it wouldn't launch in the first place or produce some other lower-level error first.
id0 is offline   Reply With Quote
Old 08-19-2013, 09:42 AM   #10
Heisman
Senior Member
 
Location: St. Louis

Join Date: Dec 2010
Posts: 535
Default

Create a file with vim and then type the following (with tabs):

chr1 500 1000
chr1 700 1200

and try to use "mergeBed" on it and see if that works.
Heisman is offline   Reply With Quote
Old 08-19-2013, 10:41 AM   #11
id0
Senior Member
 
Location: USA

Join Date: Sep 2012
Posts: 130
Default

Quote:
Originally Posted by Heisman View Post
Create a file with vim and then type the following (with tabs):

chr1 500 1000
chr1 700 1200

and try to use "mergeBed" on it and see if that works.
mergeBed works on that example. It also works on other BED files.

coverageBed does not work on any of the files.

This is very confusing.
id0 is offline   Reply With Quote
Old 01-15-2014, 12:53 AM   #12
wadachi
Junior Member
 
Location: japan

Join Date: Jan 2014
Posts: 1
Default

How about checking "new line characters"?

if you make your .bed files on Windows, new line characters should be set \r\n.
whereas Unix/Linux uses only \r, so the excess \n may make BEDTools confused.

to justify this, choose line end character of Unix/Linux in the selection pulldown in your text editor's "save as ..." dialogue. (in my case, gedit in Ubuntu).

hope this works!
wadachi is offline   Reply With Quote
Old 06-30-2014, 06:03 AM   #13
inesdesantiago
Member
 
Location: LONDON, UNITED KINGDOM

Join Date: Jan 2009
Posts: 44
Default

You could also use GenomeIntervals2BED.py script available within the SeqGI framework.
Have a look: http://seqgi.sourceforge.net/Genomeintervals2bed.html
inesdesantiago is offline   Reply With Quote
Old 04-07-2015, 02:54 PM   #14
jshaik
Junior Member
 
Location: st. louis

Join Date: Jun 2011
Posts: 6
Default

use dos2unix command in linux to convert your bed file to a file that is acceptable by bedtools. This happens as the windows and linux have different new line characters
jshaik is offline   Reply With Quote
Old 06-22-2015, 05:15 AM   #15
Armin_P
Junior Member
 
Location: Austria

Join Date: Sep 2014
Posts: 4
Default

I was facing the same problem. One of my files was a bam file and the other gff3/bed (I do not know if you have a bam file). Anyways, I used 'bedtools coverage' with the -abam option instead of -a and provided my bam file there. -b was then the gff3 or .bed (I tried both) and it worked!
Armin_P is offline   Reply With Quote
Old 06-22-2015, 03:16 PM   #16
swbarnes2
Senior Member
 
Location: San Diego

Join Date: May 2008
Posts: 912
Default

In the future, you really need to include the exact command line you are using.

I'm pretty sure the problem is this: BED format is valid with only three columns of data, but I think coverageBed needs four columns of data; I think it wants a column for direction.

Try adding a fourth column of all pluses.
swbarnes2 is offline   Reply With Quote
Old 02-22-2016, 06:43 AM   #17
aditisk
Member
 
Location: Ann Arbor

Join Date: Aug 2015
Posts: 12
Default

@swbarnes2, does the 4th column need to be the direction or can it be gene names as well ? I have a .BED file that has some annotation information in the 4th column. Would that still be okay ?
aditisk is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 11:18 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO