1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-15 06:43:10 +00:00

Improve BAM.quality performance

Closes https://github.com/BioJulia/BioAlignments.jl/pull/33/files.
This commit is contained in:
Ciarán O'Mara 2020-07-01 17:48:39 +10:00 committed by Ciarán O'Mara
parent dce44b3f55
commit cf168acaa3

View file

@ -543,15 +543,15 @@ function hasseqlength(record::Record)
end 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) checkfilled(record)
seqlen = seqlength(record) seqlen = seqlength(record)
offset = seqname_length(record) + n_cigar_op(record, false) * 4 + cld(seqlen, 2) 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 end
function hasquality(record::Record) function hasquality(record::Record)