Skip to content
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

Bug: local variable 'n_reads' referenced before assignment when running with "coverage" #253

Closed
ghoresh11 opened this issue Feb 22, 2024 · 3 comments
Assignees
Labels

Comments

@ghoresh11
Copy link

Hello,

Thank you for this tool and for the updated version, the performance seems to have really improved and it will come in handy for my work!

I am trying to simulate a metagenome with the "coverage" option rather than abundance (i.e. I would like to consider the genome-length in the final output), and I would like iss to generate the log-normal coverage distribution for me.

I tried running as follows:

iss generate --draft *fasta --model hiseq --coverage lognormal --n_reads 1M

And I get the following error:

Traceback (most recent call last):
  File "/home/ghoresh/.cache/pypoetry/virtualenvs/simulate-metagenome-oP5jUgnD-py3.9/bin/iss", line 8, in <module>
    sys.exit(main())
  File "/home/ghoresh/.cache/pypoetry/virtualenvs/simulate-metagenome-oP5jUgnD-py3.9/lib/python3.9/site-packages/iss/app.py", line 454, in main
    args.func(args)
  File "/home/ghoresh/.cache/pypoetry/virtualenvs/simulate-metagenome-oP5jUgnD-py3.9/lib/python3.9/site-packages/iss/app.py", line 81, in generate_reads
    n_read_pairs = n_reads // 2
UnboundLocalError: local variable 'n_reads' referenced before assignment

Your assistance would be appreciated!
Many thanks
Gal

@HadrienG HadrienG added the bug label Feb 23, 2024
@HadrienG HadrienG self-assigned this Feb 23, 2024
@HadrienG
Copy link
Owner

HadrienG commented Feb 23, 2024

Hi! Thanks for reporting this. I'll fix and push a bugfix release asap.

HadrienG added a commit that referenced this issue Feb 23, 2024
fix crash when using --coverage (#253)
@HadrienG
Copy link
Owner

Should be fixed in 2.0.1, now available with pip. Should be in conda shortly.

@ghoresh11
Copy link
Author

ghoresh11 commented Feb 25, 2024

Please ignore my previous comments, I found where the issue was coming from in my code. Thanks again for fixing this so quickly!! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants