-
Notifications
You must be signed in to change notification settings - Fork 6
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
A short "genome" sequence causes a hang, not a fail #9
Comments
Hi Rachel, thanks for the report! I completely agree that this needs to be fixed. |
For anyone coming across this, I found a workaround. @karel-brinda I wonder if max_readlength should be set by default to the length of the reference rather than infinity? NanoSim-H/nanosimh/simulate.py Line 785 in 1e2d374
It doesn't make sense to be able to generate reads longer than the reference? |
Actually, I have been digging into this a little more and found something interesting. If I indeed set However, if I make If you want the fasta file I am working with I'll attach it below (it says it's a .txt file but it is actually fasta). |
Pretty sure there's a bug in
Then we hit this if ref_pos + length < seq_len[key]:
new_read = seq_dict[key][ref_pos:ref_pos + length]
read_info = (key, ref_pos)
break
elif ref_pos < seq_len[key]:
break
else:
ref_pos -= seq_len[key] But even in the best case where I'll have a fiddle around and see if there's an easy fix. |
#16 fixes the hang. However, when running against a short reference with that fix applied, I now see this crash instead:
I'll keep debugging. :) |
I've pushed another commit to #16 to fix the error mentioned above. |
I think this is fixed on devel and can be closed? Not yet released to master or PyPI, though. |
It's included in the You can install the devel version by:
|
I realise this is not the typical use case, but I was trying to simulate reads with the error profile of nanopore and did not care about the length. I ran the example case just fine, but found that when I simulated reads from a short sequence (2000bps) this caused nanosim-h to start and just hang until my server timed out. Adding 15,000 "A"s to the beginning and end of my short sequence enabled it to work. A sanity check on user input would be a good idea.
The text was updated successfully, but these errors were encountered: