From cf168acaa372308451e729708b0670a9e3f0ff3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20O=27Mara?= Date: Wed, 1 Jul 2020 17:48:39 +1000 Subject: [PATCH] Improve BAM.quality performance Closes https://github.com/BioJulia/BioAlignments.jl/pull/33/files. --- src/bam/record.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bam/record.jl b/src/bam/record.jl index 56e048d..a70bb17 100644 --- a/src/bam/record.jl +++ b/src/bam/record.jl @@ -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)