Iterating over sequences without comments results in comments from previous records
telatin opened this issue · 4 comments
Using pyfastx version 0.8.4, I tried iterating over records but the "comment" attribute is not reset.
Is there a safer way to iterate (I would like not to assume FASTA format) or did I just miss something obvious?
File (test.fa
):
>1 comment
TTTTTTTT
>3
atatat
Code:
import pyfastx
fa = pyfastx.Fastx("test.fa")
for name,seq,comment in fa:
print(comment)
Output:
comment
comment
Thanks for your help
Thank you for report this issue. But it was very strange. I have run your example on Windows and Ubuntu with Python 3.8.8 and pyfastx 0.8.4, the output of comment is right. Could you tell me your detailed system and python information.
Thanks for the quick reply. I used PyFastx 0.8.4.
I tried both on Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31), [GCC 7.3.0] on linux
under Ubuntu 16.04.4 LTS
, in a Miniconda environment, where pyfastx was also added via conda.
I also tried locally, using Python 3.9.1 [Clang 10.0.0 ] on darwin
, also via Miniconda, but under macOS Big Sur
.
We have fixed this issue in new versions >= 0.9.0