Browse Source

Fix another Python3 compatibility issue.

Sequence data and annotations needs to be decoded before we can
use any string functions on it.
snapgene-write
Damien Goutte-Gattat 3 years ago
parent
commit
6dd965d341
  1. 6
      incenp/bio/seqio/XdnaIO.py

6
incenp/bio/seqio/XdnaIO.py

@ -49,7 +49,7 @@ def _read(handle, length):
def _read_pstring(handle):
length = unpack('>B', _read(handle, 1))[0]
return unpack('%ds' % length, _read(handle, length))[0]
return unpack('%ds' % length, _read(handle, length))[0].decode('ASCII')
def _read_pstring_as_integer(handle):
return int(_read_pstring(handle))
@ -126,8 +126,8 @@ def XdnaIterator(handle):
raise ValueError("Unknown sequence type")
# Read actual sequence and comment found in all XDNA files
sequence = _read(handle, length)
comment = _read(handle, com_length)
sequence = _read(handle, length).decode('ASCII')
comment = _read(handle, com_length).decode('ASCII')
# Try to derive a name from the first "word" of the comment.
name = comment.split(' ', 2)[0]

Loading…
Cancel
Save