I'm trying to use this code from https://github.com/dayedepps/q30 and I encountered some issues. I tried fixing some of the issues except for one.
def stat(filename):
reader = fastq.read(filename)
total_count = 0
q20_count = 0
q30_count = 0
while True:
read = reader.nextRead()
if read == None:
break
total_count += len(read[3])
q20, q30 = qual_stat(read[3])
q20_count += q20
q30_count += q30
Whenever I try to run the script, it results to:
File "/home/user/folder/q30.py", line 25, in stat
read = reader.nextRead()
^^^^^^^^^^^^^^^
AttributeError: 'generator' object has no attribute 'nextRead'
Is there an alternative to nextRead so that the script would proceed? I tried changing it to just next() or read() but still the same result. I'm not yet adept in python so I'm not sure how to fix this issue. Thank you.