Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabix does not return the correct regions #1622

Closed
hiruna72 opened this issue May 24, 2023 · 2 comments · Fixed by #1626
Closed

Tabix does not return the correct regions #1622

hiruna72 opened this issue May 24, 2023 · 2 comments · Fixed by #1626
Assignees

Comments

@hiruna72
Copy link

Hi developers,

Let's say I have the following file

S1	5	1	R1
S1	15	5	R2

I create a tabix index like follows

bgzip table.txt --keep -f
tabix -0 -b 3 -e 2 -s 1 table.txt.gz -f

Then I query the file

$ tabix table.txt.gz S1
S1	5	1	R1
S1	15	5	R2

$ tabix table.txt.gz S1:1-5
S1	5	1	R1

$ tabix table.txt.gz S1:2-5
S1	5	1	R1

$ tabix table.txt.gz S1:3-5
no records were printed. should have printed (S1	5	1	R1)

Similarly

$ tabix table.txt.gz S1:5-15
S1	15	5	R2

$ tabix table.txt.gz S1:6-15
S1	15	5	R2

$ tabix table.txt.gz S1:7-15
no records were printed. should have printed (S1	15	5	R2)

As shown above in both cases tabix did not print the valid records in the given region.

Thank you.

@kisarur
Copy link

kisarur commented May 24, 2023

I could reproduce the same issue. However, if columns 2 and 3 are swapped as below (table2.txt), I could get the expected the results. I used the latest commit in develop branch. I assume the problem is in the indexing part (tabix).

S1	1	5	R1
S1	5	15	R2

Then you create a tabix index

$ bgzip table2.txt --keep -f
$ tabix -0 -b 2 -e 3 -s 1 table2.txt.gz -f

Then query

$ tabix table2.txt.gz S1:3-5
S1	1	5	R1
$ tabix table2.txt.gz S1:7-15
S1	5	15	R2

@whitwham
Copy link
Contributor

whitwham commented Jun 1, 2023

It looks like that bug has been there since the beginning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants