-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
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
UnboundLocalError: local variable 'i' referenced before assignment #22
Comments
Hi, which version of uLTRA is this? You can run If it is not v0.1 I suggest you update it to the latest version. If it is v0.1, I will have an extra look. thanks, |
@ksahlin Hi Kristoffer. I'm getting this same error in a confirmed v0.1 container. File "/usr/local/lib/python3.10/site-packages/modules/create_augmented_gene.py", line 442, in create_graph_from_exon_parts In create_augmented_gene.py, is it possible that 442-449 need an additional tab to be include in the FOR loop block iterating with 'i' that begins on 311? Thanks, |
Hi @gootee and @rkworkhelp1 , (TLDR: check that the input GTF is formatted in the way uLTRA expects it - with the I looked at the code and figured out the error. What happens is that your database does not have any I verified this by running e.g.,
which gives the same error. So, while the error is confusing (i should have inserted a check that You probably need to check that the input GTF is formatted in the way uLTRA expects it (with the HTH, |
Thanks, Kristoffer. We fixed it and it worked great. I appreciate all
your work and the great explanation.
John
…On Mon, Mar 25, 2024 at 12:32 AM Kristoffer ***@***.***> wrote:
Hi @gootee <https://github.com/gootee> and @rkworkhelp1
<https://github.com/rkworkhelp1> ,
(TLDR: check that the input GTF is formatted in the way uLTRA expects it -
with theexon feature in the file, column 3 in the GTF.)
I looked at the code and figured out the error. What happens is that your
database does not have any exon fields in the GTF. Therefore, the loop
starting at 311 in create_augmented_gene.py is never initialized. Hence, i
is never initialized. This throws an error on line 442 because we expect
the loop to have done some work.
I verified this by running e.g.,
def test():
for i, x in enumerate([]):
pass
if i > 0:
pass
test()
which gives the same error.
So, while the error is confusing (i should have inserted a check that db.features_of_type('exon',
order_by='seqid') is not empty), fixing the error won't lead to any
success on your data.
You probably need to check that the input GTF is formatted in the way
uLTRA expects it (with theexon feature in the file, column 3) and then
you won't get the runtime error.
HTH,
Kristoffer
—
Reply to this email directly, view it on GitHub
<#22 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFK4UAXEOKGIIICWJJHJ6TTYZ7HI3AVCNFSM6AAAAABEIC6DA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJXGM4DGNZTGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello,
I encountered the following errors when trying to run uLTRA index and uLTRA align.
Help resolving this issue would be greatly appreciated.
See image for more details.
The text was updated successfully, but these errors were encountered: