mirror of
https://github.com/MillironX/XAM.jl.git
synced 2024-12-23 21:28:18 +00:00
improve BAM.quality performance
This commit is contained in:
parent
dce44b3f55
commit
dde235fbc8
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue