EI-CoreBioinformatics / mikado

Mikado is a lightweight Python3 pipeline whose purpose is to facilitate the identification of expressed loci from RNA-Seq data * and to select the best models in each locus.
https://mikado.readthedocs.io/en/stable/
GNU Lesser General Public License v3.0
98 stars 18 forks source link

IndexError: list index out of range #252

Closed gemygk closed 4 years ago

gemygk commented 4 years ago

Hi @lucventurini

We (@swarbred) are getting below error with commit 2df1d17.

We get the error when we change the proportion_verified_introns_inlocus.

There was no error with the mikado run with proportion_verified_introns_inlocus: {operator: gt, value: 1.0}. If I take @swarbred run as an example, the pick.log is below

/ei/workarea/group-ga/Projects/CB-GENANNO-444_Myzus_persicae_clone_O_v2_annotation/Analysis/mikado-2.0rc4/annotation_run2/mikado-2.0_rc1_run6/integration/integration_run_ds_testrun4/pick.log

The difference between the success and failed job scoring YAML file is below:

$ diff plant.50k_intron.run6_integration.yaml plant.50k_intron.run6_integration.run_ds_test.yaml
15c15
<     proportion_verified_introns_inlocus: {operator: gt, value: 1.0}
---
>     proportion_verified_introns_inlocus: {operator: gt, value: 0.01}

Command issued on the test region is:

sbatch -p ei-cb -c 32 --mem 123G -o out_mikado.serialise-and-pick.run3.%j.log -J Ov2_Mikado_SP --wrap "source mikado-2.0rc6_2df1d17_CBG && /usr/bin/time -v mikado pick --mode nosplit --seed 10 --procs 32 --json-conf mikado.configuration.run6.integration.run_ds_test.yaml --subloci-out mikado.subloci.gff3 --monoloci-out mikado.monoloci.gff3 --output-dir ./integration_run_ds_testrun4 -r scaffold_1:54332451..54394450 -lv DEBUG"

And the error we get is below:

2019-12-10 13:05:18,605 - scaffold_1:54332920-54393917 - loci_processer.py:323 - ERROR - analyse_locus - MainProcess - list index out of range
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/Mikado/picking/loci_processer.py", line 317, in analyse_locus
    stranded_locus.define_loci()
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/superlocus.py", line 1198, in define_loci
    self.define_alternative_splicing()
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/superlocus.py", line 1337, in define_alternative_splicing
    self.loci[lid].finalize_alternative_splicing()
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/locus.py", line 203, in finalize_alternative_splicing
    failed = self.__launch_padding()
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/locus.py", line 233, in __launch_padding
    templates = self.pad_transcripts()
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/locus.py", line 821, in pad_transcripts
    five_graph = self.define_graph(objects=self.transcripts, inters=self._share_extreme, three_prime=False)
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/locus.py", line 937, in define_graph
    edge = inters(objects[obj[2]], objects[other_obj[2]], three_prime=three_prime)
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/locus.py", line 967, in _share_extreme
    return self._share_five_prime(first, second)
  File "/usr/local/lib/python3.7/site-packages/Mikado/loci/locus.py", line 991, in _share_five_prime
    if matched[0][0] < second.start:
IndexError: list index out of range
2019-12-10 13:05:18,611 - scaffold_1:54332920-54393917 - loci_processer.py:324 - ERROR - analyse_locus - MainProcess - Removing failed locus superlocus:scaffold_1+:54332920-54393917

Can you please look into this?

Thanks, Gemy

lucventurini commented 4 years ago

Hi @gemygk , thank you for reporting. I will start having a look now.

lucventurini commented 4 years ago

Hi Gemy, 3f62484 should fix the issue. What should we do with this commit? Shall I merge to master, leave it on a separate branch...? What would be best for your testing?