mirror of
https://github.com/MillironX/XAM.jl.git
synced 2024-12-23 13:28:16 +00:00
Improve BAM.quality performance
Closes https://github.com/BioJulia/BioAlignments.jl/pull/33/files.
This commit is contained in:
parent
dce44b3f55
commit
cf168acaa3
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