bcgsc / straglr

Tandem repeat expansion detection or genotyping from long-read alignments
Other
50 stars 9 forks source link

IndexError: list index out of range #23

Closed HLHsieh closed 8 months ago

HLHsieh commented 1 year ago

Hi there,

I executed the following commad

python ~/bin/straglr/straglr.py ~/stimulated/myseq.sorted.bam ~/Genome/hg38/genome.fa myseq --nprocs 4

I got the error message as follow

  Traceback (most recent call last):
    File "/home/bin/straglr/straglr.py", line 93, in <module>
      main()
    File "/home/bin/straglr/straglr.py", line 82, in main
      variants = tre_finder.examine_ins(ins, min_expansion=args.min_ins_size)
    File "/home/bin/straglr/src/tre.py", line 1254, in examine_ins
      variants = self.collect_alleles(merged_loci)
    File "/home/bin/straglr/src/tre.py", line 1289, in collect_alleles
      tre_variants = combine_batch_results(batched_results, type(batched_results[0]))
  IndexError: list index out of range

Any help would be much appreciated!

Many thanks, Hsin

readmanchiu commented 1 year ago

Thank you for reporting this, @HLHsieh This error happens when there is no tandem repeat expansions that can be identified from the genome scan, which is a rare case that I didn't account for. I added a line to check for such scenario in the repository. You can clone the repo and run it again to see if the error is fixed.

HLHsieh commented 1 year ago

Hi @readmanchiu

I appreciated that your quick response, and letting me know the reason for this issue. I have tried the latest version. It worked with no errors. By the way, if there is no tandem repeat expansions, how it will report in the latest version?

Best, Hsin

readmanchiu commented 1 year ago

If there is no expansion, there will be no output lines in the tsv or bed file (except the headers) You can run with --debug turned on to keep the intermediate files and the failed messages output to stdout to help you understand why there is no output. But do let me know if you think there should be output but you don't see it in the report

HLHsieh commented 1 year ago

Thanks for your information. I will keep trying.