Tabix on bed file can't parse
1
0
Entering edit mode
5.4 years ago
Nibua ▴ 70

Hello,

I'm trying to use tabix on a bed file and it seems that tabix is unable to parse my file. Here is my file :

chr7    1000    5000    name1   1   +
chr7    15000   25000   name3   4   +
chr7    35000   75000   name4   8   +
chr7    57373   987412  name5   16  -

my commands are :

$ bgzip example_sort.bed

$ tabix -p bed example_sort.bed.gz

and the outputs are : Code:

[E::get_intv] failed to parse TBX_GENERIC, was wrong -p [type] used?
The offending line was: "chr7    1000    5000    name1   1   +"
[E::get_intv] failed to parse TBX_GENERIC, was wrong -p [type] used?
The offending line was: "chr7    15000   25000   name3   4   +"
[E::hts_idx_push] Unsorted positions on sequence #4653157: 1 followed by 0
tbx_index_build failed: example_sort.bed.gz

Any ideas would be appreciated! Thanks

Aubin

software error • 4.8k views
ADD COMMENT
2
Entering edit mode

OK it works now, the problem was the automatic change of tabulations with 4 spaces with my f** text editor

Thanks for the help!

nibua

ADD REPLY
1
Entering edit mode

what are the outputs of

gunzip -c example_sort.bed .gz |  tr "\t" "#"  | head

and

gunzip -c example_sort.bed .gz | sort -t $'\t' -k1,1 -k2,2n --check
ADD REPLY
1
Entering edit mode

That last error seems to suggest an unsorted file (although the name would suggest its sorted). What command did you use to sort the file?

It's unclear what is wrong with the first two errors, they look like perfectly good bed lines, but I can think of two possiblities:

  1. The column delimiters are spaces rather than tabs
  2. There are hidden characters in there

Can you post the output of

zcat example_sort.bed | cat -A | head
ADD REPLY
5
Entering edit mode
5.4 years ago

Make sure that the columns are separated by a tab and not by whitespaces. (This is what Pierre is trying to check ;) )

ADD COMMENT
0
Entering edit mode

Thanks that was the error

ADD REPLY

Login before adding your answer.

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