We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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!
The text was updated successfully, but these errors were encountered:
Your code is reasonable and should work.
In the middle time, you could adjust your loop to use the following, which works because the iterator for the reader catches the EOF error.
for record in reader # 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
Sorry, something went wrong.
No branches or pull requests
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!
The text was updated successfully, but these errors were encountered: