Errors in BED line using samtools bedcov
2
0
Entering edit mode
4.2 years ago
karmacram • 0

I am trying to run the following command:

samtools bedcov test.bed /data/A.realigned.recalibrated.bam

test.bed looks like this:

track name="test bed file" 
chr1    20915535        20915536 
chr1    20915701        20915704

The bam file has a bam.bai file in the same folder.

However I am getting this error:

Errors in BED line 'chr1    20915535    20915536'
Errors in BED line 'chr1    20915701    20915704'

I am not sure what this error is. I made this bed file using tabs between columns. Appreciate your help or direction!

bed samtools • 2.9k views
ADD COMMENT
0
Entering edit mode

That happens when there are other delimiters expect tab present in the file, e.g. a whitespace somewhere. Make sure you only have tab and nothing else.

ADD REPLY
0
Entering edit mode

Hmm, interesting, I thought it might be that, but I am not seeing any extra chars. using ":set list" in vim shows:

track name="test bed file"$
chr1^I20915535^I20915536$
chr1^I20915701^I20915704$
ADD REPLY
0
Entering edit mode
4.2 years ago
karmacram • 0

Aha! The issue here was that bedcov would not accept the "chr" in the input bed file. I fixed with this:

cat input.bed | sed 's/chr//g' > input_for_bedcov.bed
ADD COMMENT
0
Entering edit mode

That is not the issue. I used this command before and I always have chr[*]-like chromosome names. This must have been some hidden character that you seem to have removed.

ADD REPLY
0
Entering edit mode
3.6 years ago
lffu_0032 ▴ 90

the problem is that the naming of Chr in BED and BAM is not same. for example, if the first chr column in your BED is chr1/chr2/chr3..., and the chr column in your bam file is 1/2/3..., then you will meet this "Error in BED line" error.

ADD COMMENT

Login before adding your answer.

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