From dde235fbc8313432dc7b16f94310128074d875e4 Mon Sep 17 00:00:00 2001 From: Jonathan Bieler Date: Fri, 26 Jul 2019 10:43:36 +0200 Subject: [PATCH] improve BAM.quality performance --- 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)