1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-12-23 13:28:16 +00:00

improve BAM.quality performance

This commit is contained in:
Jonathan Bieler 2019-07-26 10:43:36 +02:00 committed by Ciarán O'Mara
parent dce44b3f55
commit dde235fbc8

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)