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

IndexError: list index out of range #7

Open
antoine4ucsd opened this issue Oct 4, 2022 · 2 comments
Open

IndexError: list index out of range #7

antoine4ucsd opened this issue Oct 4, 2022 · 2 comments

Comments

@antoine4ucsd
Copy link

Hello
I am using quasitools to generate consensus an specify the minimum frequency of 20% required for a base to be incorporated into the mixed base consensus sequence
It works for some of my samples but for others, I have this error:

quasitools consensus -p 20 -o  myouput input.bam  reference.fasta
Traceback (most recent call last):
  File "/Users/antoinechaillon/opt/miniconda3/bin/quasitools", line 10, in <module>
    sys.exit(cli())
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/quasitools/commands/cmd_consensus.py", line 52, in cli
    conseq = mrc.to_consensus(percentage)
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/quasitools/mapped_read.py", line 159, in to_consensus
    pileup = self.pileup(indels=(percentage == 100))
  File "/Users/antoinechaillon/opt/miniconda3/lib/python3.9/site-packages/quasitools/mapped_read.py", line 100, in pileup
    pileup[i].get(self.reference.sub_seq(i, i).upper(), 0)\
IndexError: list index out of range

I was able to get full genome consensus with other algorithm (e.g. cliqueSNV)
any advice or parameters I can adapt?

thank you

@ericenns
Copy link
Member

ericenns commented Oct 4, 2022

Hi @antoine4ucsd,
This error usually occurs when the alignment does not meet the minimum required coverage. This is hardcoded to 100 bases (https://github.com/phac-nml/quasitools/blob/master/quasitools/mapped_read.py#L166). Unfortunately this is not user configurable at the moment.

@antoine4ucsd
Copy link
Author

thank you

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

No branches or pull requests

2 participants