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

intronerate IndexError: list index out of range error #41

Closed
bruceamurphy opened this issue Nov 22, 2018 · 5 comments
Closed

intronerate IndexError: list index out of range error #41

bruceamurphy opened this issue Nov 22, 2018 · 5 comments

Comments

@bruceamurphy
Copy link

I'm getting an "index out of range error" from intronerate.py for certain combinations of genes and samples when the following line of code is reached:

return [hits[kept_indicies[x]] for x in sorted(non_overlapping_indicies)]#.sort()]

The error doesn't seem to occur with the pre-herbarium-update code.

These are the values of the relevant list variables just before the error is triggered:
kept_indices: [0, 4, 5]
non_overlapping indices: [0, 4]

Therefore, it would seem that the second element (i.e. 4) in non_overlapping indices is being used as the index to access kept_indices, which means it is trying to access the fith element in kept_indices when there are actually only three elements present.

I don't know why this is happening. For what it's worth, hits contains 6 elements at this point.

@mossmatters
Copy link
Owner

Thanks, I will work on this ASAP. I am trying to build a reproducible example-- do you know what gene is causing the problem? Can you send the whole directory for that gene (including the interleaved.fasta and contigs.fasta) so I can test it including the main HybPiper scripts?

Just adding some of the rest of the info you provided via e-mail:
'''
Traceback (most recent call last):
File "/home/bruce/software/HybPiper/intronerate.py", line 307, in
if name == "main":main()
File "/home/bruce/software/HybPiper/intronerate.py", line 286, in main
kept_hits = filter_gff(hits,merge=args.merge)
File "/home/bruce/software/HybPiper/intronerate.py", line 194, in filter_gff
return [hits[kept_indicies[x]] for x in sorted(non_overlapping_indicies)]#.sort()]
IndexError: list index out of range
'''

mossmatters pushed a commit that referenced this issue Dec 3, 2018
@mossmatters
Copy link
Owner

This should be fixed in the develop branch. The problem was in referencing the wrong part of the GFF file when attempting to sort out overlapping gene annotations.

If you download intronerate.py from the develop branch and use it instead of the version from 1.3.1, it should fix the issue. Let me know if you have any further trouble!

@V-Z
Copy link

V-Z commented Nov 29, 2019

Hello,
I think I run into same error. The most recent log is:

[CMD] exonerate -m protein2genome -q sequences/FAA/probe6955.FAA -t sequences/intron/probe6955_supercontig.fasta --verbose 0 --showalignment no --showvulgar no --showtargetgff yes > intronerate_raw.gff
0 introns found for probe6955.
[CMD] exonerate -m protein2genome -q sequences/FAA/probe6439.FAA -t sequences/intron/probe6439_supercontig.fasta --verbose 0 --showalignment no --showvulgar no --showtargetgff yes > intronerate_raw.gff
2 introns found for probe6439.
[CMD] exonerate -m protein2genome -q sequences/FAA/probe6284.FAA -t sequences/intron/probe6284_supercontig.fasta --verbose 0 --showalignment no --showvulgar no --showtargetgff yes > intronerate_raw.gff
2 introns found for probe6284.
[CMD] exonerate -m protein2genome -q sequences/FAA/probe5614.FAA -t sequences/intron/probe5614_supercontig.fasta --verbose 0 --showalignment no --showvulgar no --showtargetgff yes > intronerate_raw.gff
Traceback (most recent call last):
  File "/scratch.ssd/gunnera/job_14028574.arien-pro.ics.muni.cz/HybPiper/intronerate.py", line 307, in <module>
    if __name__ == "__main__":main()
  File "/scratch.ssd/gunnera/job_14028574.arien-pro.ics.muni.cz/HybPiper/intronerate.py", line 286, in main
    kept_hits = filter_gff(hits,merge=args.merge)
  File "/scratch.ssd/gunnera/job_14028574.arien-pro.ics.muni.cz/HybPiper/intronerate.py", line 194, in filter_gff
    return [hits[kept_indicies[x]] for x in sorted(non_overlapping_indicies)]#.sort()]
IndexError: list index out of range

It happens only with one probe set and only with some samples. I can mail You the affected data, if necessary. I'm running HybSeq cloned from the git.

@mossmatters
Copy link
Owner

Hello -- did you try the development version? There is an updated version of intronerate.py that has not been pushed to the main branch yet. Let me know if you are still having problems with the newer version and I will take a look.

https://github.com/mossmatters/HybPiper/blob/develop/intronerate.py

@V-Z
Copy link

V-Z commented Dec 9, 2019

Hello, thank You. The development version works well.

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

3 participants