Calculating average quality score
Closed this issue · 2 comments
Hi Wouter,
Thank you for your blog posts on how the average qscores are calculated for nanopore data, I have found them very useful.
When I tried out your aveQual function, I realised that I wasn't getting the correct outcome until I converted q to float, that is :
-10*math.log(sum([10**(float(q)/-10) for q in quals]) / len(quals), 10)
It seems that if q is integer, then the exponent will be rounded up to an integer value.
Best regards,
Laura
Hi Laura,
Is my assumption correct that you are using Python2.7? If so, this is relatively easy to fix.
I always use Python3, and integer division is different then. Actually, unless you have good reasons to use Python2.7 (for example maintaining legacy code) you should also move to Python3. In just a few years support for Python2.7 will be dropped and many modules have already moved to Python3.
Cheers,
Wouter
I will close this due to lack of activity. Feel free to reopen or post a new issue if you (or someone else) wants to follow up.