Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

SAM parser #373

Closed
bdeonovic opened this issue Jan 12, 2017 · 4 comments · Fixed by #377
Closed

SAM parser #373

bdeonovic opened this issue Jan 12, 2017 · 4 comments · Fixed by #377

Comments

@bdeonovic
Copy link

I tried reading a sam file:

julia> reader = open(SAMReader, "1to2k.sam")
ERROR: AssertionError: upanchor! called with no anchor set
 in upanchor! at /Users/bdeonovic/.julia/v0.5/Bio/src/Ragel.jl:33 [inlined]
 in macro expansion at /Users/bdeonovic/.julia/v0.5/Bio/src/Ragel.jl:104 [inlined]
 in macro expansion at /Users/bdeonovic/.julia/v0.5/Bio/src/align/hts/sam/parser.jl:1299 [inlined]
 in _read!(::Bio.Align.SAMReader, ::Bio.Ragel.State{BufferedStreams.BufferedInputStream{IOStream}}, ::Bio.Align.SAMRecord) at /Users/bdeonovic/.julia/v0.5/Bio/src/Ragel.jl:182
 in read(::Bio.Align.SAMReader) at /Users/bdeonovic/.julia/v0.5/Bio/src/Ragel.jl:228
 in Bio.Align.SAMReader(::BufferedStreams.BufferedInputStream{IOStream}) at /Users/bdeonovic/.julia/v0.5/Bio/src/align/hts/sam/reader.jl:20
 in #open#2(::Array{Any,1}, ::Function, ::Type{Bio.Align.SAMReader}, ::String) at /Users/bdeonovic/.julia/v0.5/Bio/src/IO.jl:58
 in open(::Type{Bio.Align.SAMReader}, ::String) at /Users/bdeonovic/.julia/v0.5/Bio/src/IO.jl:58

However, after converting the SAM to BAM and using the BAMReader I had no problem reading the file.

@TransGirlCodes
Copy link
Member

With any luck this will go away when we don't use Ragel anymore?

@bicycle1885
Copy link
Member

@bdeonovic Can you paste the file or upload a part of it somewhere?

@bdeonovic
Copy link
Author

Here is a small version of that sam file (same header + first few entries):

https://www.dropbox.com/s/gac7ni5yrmojoic/small.sam?dl=0

bicycle1885 added a commit to bicycle1885/Bio.jl that referenced this issue Jan 21, 2017
@bicycle1885
Copy link
Member

@bdeonovic Thank you! I've fixed the bug in #377. This happens when reading a SAM file with large header section. The cause is in interactions between Ragel and BufferedStreams.jl.

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

Successfully merging a pull request may close this issue.

3 participants