EOFError: read end of file
Hello, I use while loop to read GFF3 file but I got this error.I do not know how it happens and how to solve it. Here is my code:
# Import the GFF3 module.
using GFF3
exonDict = Dict{String,Int64}()
# Open a GFF3 file.
reader = open(GFF3.Reader, "Homo_sapiens.GRCh38.106.gff3")
# Pre-allocate record.
record = GFF3.Record()
# Iterate over records.
while !eof(reader)
empty!(record)
read!(reader,record)
# do something
if GFF3.featuretype(record) == "exon"
transid = split(GFF3.attributes(record,"Parent")[1],":")[2]
exonLength = abs(GFF3.seqend(record) - GFF3.seqstart(record)) + 1
# println(exonLength)
if !haskey(exonDict,transid)
exonDict[transid] = exonLength
else
exonDict[transid] += exonLength
end
end
end
# Finally, close the reader.
close(reader)
Thank you for your reply!
EOFError: read end of file
Hello, I use while loop to read GFF3 file but I got this error.I do not know how it happens and how to solve it. Here is my code:
Thank you for your reply!