|
|
|
@ -8,9 +8,9 @@ Create a data reader of the BAM file format.
|
|
|
|
|
|
|
|
|
|
# Arguments
|
|
|
|
|
* `input`: data source
|
|
|
|
|
* `index=nothing`: filepath to a random access index (currently *bai* is supported) or BAI object
|
|
|
|
|
* `index=nothing`: filepath to a random access index (currently *bai* is supported) or BAI object
|
|
|
|
|
"""
|
|
|
|
|
mutable struct Reader{T} <: BioGenerics.IO.AbstractReader
|
|
|
|
|
mutable struct Reader{T} <: XAMReader
|
|
|
|
|
stream::BGZFStreams.BGZFStream{T}
|
|
|
|
|
header::SAM.Header
|
|
|
|
|
start_offset::BGZFStreams.VirtualOffset
|
|
|
|
@ -124,7 +124,7 @@ init_bam_index(index::AbstractString) = BAI(index)
|
|
|
|
|
init_bam_index(index::BAI) = index
|
|
|
|
|
init_bam_index(index::Nothing) = nothing
|
|
|
|
|
init_bam_index(index) = error("unrecognizable index argument")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _read!(reader::Reader, record)
|
|
|
|
|
unsafe_read(
|
|
|
|
|
reader.stream,
|
|
|
|
|