Biopython: AbiIO.py issue with reading file from .fsa file: seq referenced before assignment

Created on 3 Jan 2017  路  5Comments  路  Source: biopython/biopython

I'm using SeqIO.read to read a fsa file from an Applied Biosystems 3730xl machine.
Fails to find the key of PBAS2 then doesn't set seq thus causing it to fail when used on line 411. I've found if I hard code the seq, smaple_id and qual array it is able to build with abif_raw intact and usable.

3730xl does not have PBAS2 listed: ABI Format docs
I would like to extend this file to allow for 3730xl

This is how I'm using it: record = SeqIO.read(file, 'abi')

Stack Trace:

Traceback (most recent call last):
  File "/Users/kgraff/Projects/fsa_interperter/fsa_reader.py", line 48, in <module>
    result = openFileCreatePlot(fileNameDir)
  File "/Users/kgraff/Projects/fsa_interperter/fsa_reader.py", line 20, in openFileCreatePlot
    record = SeqIO.read(file, 'abi')
  File "/Users/kgraff/anaconda/lib/python2.7/site-packages/Bio/SeqIO/__init__.py", line 664, in read
    first = next(iterator)
  File "/Users/kgraff/anaconda/lib/python2.7/site-packages/Bio/SeqIO/__init__.py", line 600, in parse
    for r in i:
  File "/Users/kgraff/anaconda/lib/python2.7/site-packages/Bio/SeqIO/AbiIO.py", line 411, in AbiIterator
    record = SeqRecord(Seq(seq, alphabet),
UnboundLocalError: local variable 'seq' referenced before assignment
Bug

All 5 comments

@bow could you take a look at this please?

@graph1994 could you share a test file for debugging, ideally something we could include in future releases for our unit tests?

Thanks!

If you don't mind I'd like to try and help solve the problem, I'll try to find a test file that can be used and include that with my PR as well

Sure - Bow wrote the original code so would be the ideal person to review a pull request from you.

@graph1994, thanks for reporting the bug and feel free to explore how to solve the problem. The current parser does lack tests for .fsa files, so adding them would be much appreciated.

Closing this issue since this has been addressed in #1037.

Was this page helpful?
0 / 5 - 0 ratings