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

UnboundLocalError: local variable 'dispatch_tuple' referenced before assignment #69

Closed
Lcarey opened this issue Sep 4, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@Lcarey
Copy link

Lcarey commented Sep 4, 2018

Hi,
ISS looks interesting. I'd like to simulate error rates from aligned reads.
I installed via pip3 (python 3.6.4) and tried to generate a model, but got an error:

~/.local/bin/iss model --bam test2.bam --output test
INFO:iss.app:Starting iss model
INFO:iss.app:Using KDE ErrorModel
INFO:iss.bam:Reading bam file: test2.bam
Traceback (most recent call last):
  File "/home/lcarey/.local/bin/iss", line 11, in <module>
    sys.exit(main())
  File "/home/lcarey/.local/lib/python3.6/site-packages/iss/app.py", line 417, in main
    args.func(args)
  File "/home/lcarey/.local/lib/python3.6/site-packages/iss/app.py", line 214, in model_from_bam
    bam.to_model(args.bam, args.output)
  File "/home/lcarey/.local/lib/python3.6/site-packages/iss/bam.py", line 180, in to_model
    for pos, indel in modeller.dispatch_indels(read):
  File "/home/lcarey/.local/lib/python3.6/site-packages/iss/modeller.py", line 330, in dispatch_indels
    yield dispatch_tuple
UnboundLocalError: local variable 'dispatch_tuple' referenced before assignment

I've uploaded a bam file that fails, and a subset of that file that works:
https://www.dropbox.com/sh/vl1zhz59u8nyela/AAAzAAn4fgdmzixe9cQDCa4Sa?dl=0

@HadrienG HadrienG self-assigned this Sep 4, 2018
@HadrienG HadrienG added the bug label Sep 4, 2018
@HadrienG
Copy link
Owner

HadrienG commented Sep 4, 2018

Hi!

Thank you for reporting this and providing test files. It also fails on my machine.

What fails is the CIGAR parsing. InSilicoSeq only handles matches, insertions and deletions at the moment. I've omitted the special (and rarer!) cases of skipped region, padding and soft/hard clipping in the parsing logic, which I think causes this error.

I'll fix this in the coming days, and come back to you with a minor version bump.

Best,
Hadrien

@HadrienG HadrienG added this to the 1.2.1 milestone Sep 4, 2018
@Lcarey
Copy link
Author

Lcarey commented Sep 4, 2018

Hi Hadrien,

Cool.

Did you think about learning context-dependent error profiles from the .bam file? My understanding of Illumina errors is that they also depend on the -1nt, and to a lesser extent on the -2nt. (eg https://www.ncbi.nlm.nih.gov/pubmed/18660515 and others).

We're interested in using ultra-high coverage (~milllion x) coverage to identify subclonal mutations.

-Lucas

@HadrienG
Copy link
Owner

Hi!

Sorry for the delay. The bug you reported is solved with 1.2.1.
For answering your question, we're thinking to give HMMs a try, but I'm still struggling with how to best handle the dependance on the -2nt event. But hopefully there will be a HMM error profile option for version 2 😃

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