Question: Errors in BED line using samtools bedcov
0
gravatar for karmacram
8 months ago by
karmacram0
karmacram0 wrote:

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 file samtools • 403 views
ADD COMMENTlink modified 7 weeks ago by lffu_003260 • written 8 months ago by karmacram0

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 REPLYlink written 8 months ago by ATpoint40k

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 REPLYlink written 8 months ago by karmacram0
0
gravatar for karmacram
8 months ago by
karmacram0
karmacram0 wrote:

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 COMMENTlink written 8 months ago by karmacram0

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 REPLYlink written 8 months ago by ATpoint40k
0
gravatar for lffu_0032
7 weeks ago by
lffu_003260
lffu_003260 wrote:

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 COMMENTlink written 7 weeks ago by lffu_003260
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 977 users visited in the last hour