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

eachoverlap running past end of stream #47

Open
rulixxx opened this issue Oct 23, 2020 · 0 comments
Open

eachoverlap running past end of stream #47

rulixxx opened this issue Oct 23, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@rulixxx
Copy link

rulixxx commented Oct 23, 2020

When looping trough a BAM file with eachoverlap I get an error if the selected interval intersects past the last read of the BAM file.

Expected Behavior

samtools view -b chr1:1-10000 bigBAM.bam > small.bam
samtools index small.bam

reader = open(BAM.Reader, "small.bam", index="small.bam.bai")
for record in eachoverlap(reader, "chr1", 1:1000000)
    # ...
    # ...
end
close(reader)

Loops correctly trough all the reads of the small bam file.

Current Behavior

The loop manages to read the last BAM record but then fails with a:

Stacktrace:
 [1] getindex at ./array.jl:728 [inlined]
 [2] virtualoffset(::BGZFStreams.BGZFStream{IOStream}) at /nfs/users/nfs_r/ra11/.julia/packages/BGZFStreams/qApsr/src/bgzfstream.jl:156
 [3] iterate(::BioAlignments.BAM.OverlapIterator{IOStream}, ::BioAlignments.BAM.OverlapIteratorState) at /nfs/users/nfs_r/ra11/.julia/packages/BioAlignments/FOisL/src/bam/overlap.jl:65
 [4] top-level scope at ./REPL[4]:2

Possible Solution / Implementation

Steps to Reproduce (for bugs)

Same as stated above. Take a section of a BAM and run

Context

Your Environment

  • Package Version used: 1.0.1 & 2.0.0
  • Julia Version used: 1.2.0
  • Operating System and version (desktop or mobile): Linux
  • Link to your project:
@kescobo kescobo added the bug Something isn't working label Oct 23, 2020
@CiaranOMara CiaranOMara transferred this issue from BioJulia/BioAlignments.jl Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants