bed file indexing problem
Hello
I have a bed file that looks like this:
I would like to be able to retrieve data from it using samtools with tabix.
the actions I do:
bgzip sample.bed
tabix -s 1 -b 2 -e 3 sample.bed.gz
tabix sample.bed.gz chr1:19922842-19924305
but I have a problem after trying the second action, it returns this error:
Unsorted positions on sequence #1: 244318174 followed by 1179391
what can I do?
• 9,989 views
•
link
1 answer
A BED has no header, so get rid of it, then sort it with sort -k1,1 -k2,2n, compress with bgzip and then retry to index.
• 0 views
•
link
In addition to the first row (header), you also need to drop the first column as BED format is defined with chr, start, end in the first three columns.
• 0 views
•
link
Log in to answer this question.
