Python: fasta parser: fixed a bug stopping the program when the last

line contained a single nucleotide
This commit is contained in:
Celine Mercier
2020-05-12 11:24:12 +02:00
parent e9a37d8a6e
commit a72fea3cc9
2 changed files with 5 additions and 3 deletions

View File

@ -104,6 +104,7 @@ def fastaNucIterator(lineiterator,
cdef bytes sequence
cdef int skipped, ionly, read
cdef Nuc_Seq seq
cdef bint stop
if only is None:
ionly = -1
@ -130,7 +131,8 @@ def fastaNucIterator(lineiterator,
else:
line = firstline
while True:
stop=False
while not stop:
if ionly >= 0 and read >= ionly:
break
@ -153,7 +155,7 @@ def fastaNucIterator(lineiterator,
s.append(line[0:-1])
line = next(iterator)
except StopIteration:
pass
stop=True
sequence = b"".join(s)

View File

@ -1,5 +1,5 @@
major = 3
minor = 0
serial= '0-beta16'
serial= '0-beta17'
version ="%d.%02d.%s" % (major,minor,serial)