ngsfilter: checks better if there is an associated sequencing quality
This commit is contained in:
2
python/obitools3/commands/ngsfilter.pyx
Normal file → Executable file
2
python/obitools3/commands/ngsfilter.pyx
Normal file → Executable file
@ -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
|
sequences[0][REVERSE_QUALITY_COLUMN] = sequences[1].quality # used by alignpairedend tool
|
||||||
|
|
||||||
for seq in sequences:
|
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
|
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
|
seq[b'avg_quality']=q
|
||||||
q = -reduce(lambda x,y:x+y,(math.log10(z) for z in seq.quality_array[0:10]),0)
|
q = -reduce(lambda x,y:x+y,(math.log10(z) for z in seq.quality_array[0:10]),0)
|
||||||
|
Reference in New Issue
Block a user