Open jrandall opened 8 years ago
Hi,
I have been trying to index a file using Tabix. I have zipped it using bzip. and the format is : CHRNum start end feature (feature is a CSV list) and I get the error :
[E::get_intv] failed to parse TBX_GENERIC, was wrong -p [type] used?
This is how a line looks like in the file :
chr1 9849735 9849748 1,1,1,1,1,1,1,1
Any help would be much appreciated. Thank you.
You need to provide either the -p
or -s,-b,-e
options to tabix. For example tabix -s1 -b2 -e3 file.txt.gz
Thanks @pd3 but I am running command as :
tabix -s 1 -b 2 -e 3 intropolis_test_bz.tsv.gz
it also says :
[E::hts_idx_push] unsorted positions on sequence #243912249: 1 followed by 0
while we sorted the file using sort -k 1,1 -k 2,2n
Try sort -k1,1d -k2,2n -k3,3n
Thanks Petr, I tried that and got the following output of one line only :
tbx_index_build failed: intropolis_chrGRC38.sorted.NA.tsv.gz
The error message printed when tabix fails to parse the input when there is no preset
-p
option given is of the form:While specifying an incorrect
-p [type]
entry could be one reason for this, in the case ofTBX_GENERIC
there was not even a-p
option given - so really it comes down to the values of-e
and-b
being wrong, but those are not mentioned here.It would be helpful when TBX_GENERIC is set to say something that mentions
-e
and-b
in addition to-p
.Relevant code: https://github.com/samtools/htslib/blob/1e2ed48935a58845cecb64880e8cf7553c7db852/tbx.c#L151