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

issue with concatenated bgzip #21

Open
rulixxx opened this issue Mar 1, 2021 · 0 comments
Open

issue with concatenated bgzip #21

rulixxx opened this issue Mar 1, 2021 · 0 comments

Comments

@rulixxx
Copy link

rulixxx commented Mar 1, 2021

Hitting error when analysing a bgzip BED that has been concatenated.

test_390_JI.bed.gz
test_389_JI.bed.gz

In bash:
cat test_389_JI.bed.gz test_390_JI.bed.gz > test_JI.bed.gz
tabix -p bed test_JI.bed.gz

In Julia:

using GenomicFeatures
using BGZFStreams

JI_bed_reader = BED.Reader(BGZFStream("./test_JI.bed.gz"),
           index = "./test_JI.bed.gz.tbi")

for i in eachoverlap(JI_bed_reader, Interval("chr6", 61374400, 61374500))
           println(i)
       end

ERROR: ArgumentError: too large in-block offset
Stacktrace:
 [1] seek(::BGZFStream{IOStream}, ::VirtualOffset) at /nfs/users/nfs_r/ra11/.julia/packages/BGZFStreams/qApsr/src/bgzfstream.jl:225
 [2] done(::GenomicFeatures.Indexes.TabixOverlapIterator{GenomicFeatures.BED.Reader}, ::GenomicFeatures.Indexes.TabixOverlapIteratorState{GenomicFeatures.BED.Record}) at /nfs/users/nfs_r/ra11/.julia/packages/GenomicFeatures/VNoux/src/indexes/overlap.jl:46
 [3] iterate at /nfs/users/nfs_r/ra11/.julia/packages/GenomicFeatures/VNoux/src/indexes/overlap.jl:72 [inlined]
 [4] iterate(::GenomicFeatures.Indexes.TabixOverlapIterator{GenomicFeatures.BED.Reader}) at /nfs/users/nfs_r/ra11/.julia/packages/GenomicFeatures/VNoux/src/indexes/overlap.jl:35
 [5] top-level scope at ./REPL[5]:1

Expected Behavior

It shouldn't bring up that error. It should output intersected intervals just like tabix does.

tabix test_JI.bed.gz chr6:61374400-61374500

chr6	61374417	61374418	0,0,0,0,0,0,0,0,8,6,6,2,0,...
chr6	61374448	61374449	0,0,0,0,0,0,0,0,5,5,6,3,0,...

Current Behavior

produces the too large in-block offset error

Possible Solution / Implementation

Exclude the condition block.size = 0 & inblock_offset = 0 from the error check.

if inblock_offset ≥ block.size & inblock_offset > 0
   throw(ArgumentError("too large in-block offset"))
end
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

No branches or pull requests

1 participant