SeqIO error: local variable 'qual' referenced before assignment
1
0
Entering edit mode
4.3 years ago
KHP • 0

Hello,

I send some samples for Sanger sequencing to a commercial facility. I'm able to read the files they send using the command

from Bio import SeqIO
from Bio import Seq

rec = SeqIO.read("isolation-round4/3dr23_Forward.ab1",'abi-trim').seq

But recently, due to a move, we had to send the samples elsewhere for sequencing. Now, if I try to run the same command on the output I get an error:

UnboundLocalError: local variable 'qual' referenced before assignment    in
  File "C:\Users\Anaconda3\lib\site-packages\Bio\SeqIO\AbiIO.py", line 462, in AbiIterator
    letter_annotations={"phred_quality": qual}`

I would appreciate any help in dealing with this. Here are the two files, one that works and one that does not, if you would like to have a look.

EDIT: I have also posted this issue on stackoverflow Thanks in advance for your help!

biopython SeqIO Sanger_sequence • 1.5k views
ADD COMMENT
0
Entering edit mode

Hello,

Biopython is unable to read the QUAL values from the abi header. I'm not sure if your file is somehow broken.

However, biopython doesn't catch this case correct. In the corresponding lines of code, they reference to qual and seq even if they might not assigned in the code before:

https://github.com/biopython/biopython/blob/fca615b3a56dae0264460ee01911eb9eae42bc0a/Bio/SeqIO/AbiIO.py#L438-L445

Can you please open an issue on github?

BTW: Please always leave a not if you crosspost anywhere else. In this case on stackoverflow

ADD REPLY
0
Entering edit mode

Thanks for your response.

I have opened an issue here and edited the original post to include details of the stackoverflow post.

ADD REPLY
0
Entering edit mode
4.3 years ago
Peter 6.0k

Bug should have already been fixed in Biopython 1.77

ADD COMMENT
0
Entering edit mode

I updated to version 1.77, but still have the same problem.

ADD REPLY

Login before adding your answer.

Traffic: 2382 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6