From 34de90bce6725aea28d33a06d47041639f9308e6 Mon Sep 17 00:00:00 2001 From: mercierc Date: Wed, 8 Sep 2021 10:30:11 +1200 Subject: [PATCH] ngsfilter: checks better if there is an associated sequencing quality --- python/obitools3/commands/ngsfilter.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 python/obitools3/commands/ngsfilter.pyx diff --git a/python/obitools3/commands/ngsfilter.pyx b/python/obitools3/commands/ngsfilter.pyx old mode 100644 new mode 100755 index 131201c..e7356e9 --- a/python/obitools3/commands/ngsfilter.pyx +++ b/python/obitools3/commands/ngsfilter.pyx @@ -271,7 +271,7 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False): sequences[0][REVERSE_QUALITY_COLUMN] = sequences[1].quality # used by alignpairedend tool for seq in sequences: - if hasattr(seq, "quality_array"): + if hasattr(seq, "quality_array") and seq.quality_array is not None: q = -reduce(lambda x,y:x+y,(math.log10(z) for z in seq.quality_array),0)/len(seq.quality_array)*10 seq[b'avg_quality']=q q = -reduce(lambda x,y:x+y,(math.log10(z) for z in seq.quality_array[0:10]),0)