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.
Errors in BED line using samtools bedcov
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!
• 4,445 views
•
link
2 answers
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
• 0 views
•
link
• 0 views
•
link
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.
• 0 views
•
link
Log in to answer this question.
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.
Hmm, interesting, I thought it might be that, but I am not seeing any extra chars. using ":set list" in vim shows: