1
$\begingroup$

Could someone please confirm that I understand this correctly? I have the res and qual columns from mpileup and I would like to match them to get the qual per base. It seems that the indel initiation (+2tt) has no qual so if I remove that I can get the phred with pythons ord().

res_with_indel = 'T*,t**,***T**t***,+2tt**,TT,.**.***.,'
res_without_indel= 'T*,t**,***T**t***,**,TT,.**.***.,'
qual = ":'21(:,838><*'915%2-;=@=99'*9'A$("
len(res_with_indel), len(res_without_indel), len(qual)

(37, 33, 33)

for base, quality in zip(res_without_indel, qual):
    print(f'{base} : {ord(quality)}')

T : 58
* : 39
, : 50
t : 49
*  : 40
* : 58
, : 44
...

To get the indel qualities then I need to match up each of the *'s across their respective indels lengths?

Is there a library that does that? Biopython maybe?

Thanks!

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.