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

Rehaul BAM and SAM accessor functions #28

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Next Next commit
Improve BAM.quality performance
  • Loading branch information
CiaranOMara committed Jul 8, 2020
commit cf168acaa372308451e729708b0670a9e3f0ff3f
8 changes: 4 additions & 4 deletions src/bam/record.jl
Original file line number Diff line number Diff line change
Expand Up @@ -543,15 +543,15 @@ function hasseqlength(record::Record)
end

"""
quality(record::Record)::Vector{UInt8}
quality(record::Record)

Get the base quality of `record`.
Get the base quality of `record`.
"""
function quality(record::Record)::Vector{UInt8}
function quality(record::Record)
checkfilled(record)
seqlen = seqlength(record)
offset = seqname_length(record) + n_cigar_op(record, false) * 4 + cld(seqlen, 2)
return [reinterpret(Int8, record.data[i+offset]) for i in 1:seqlen]
return record.data[(1+offset):(seqlen+offset)]
end

function hasquality(record::Record)
Expand Down