gymrek-lab/TRTools

IndexError: tuple index out of range

emersond368 opened this issue · 2 comments

Not sure how to fix the problem, but I performed several different parameter settings, including all the default settings for dumpSTR on the the *.vcf input ( dumpSTR --vcf input.vcf --out output). All of which returned:

Traceback (most recent call last):
File "/project/jcreminslab/emersond_projects/4d_nucleome/clctools_hic_loop_calling_pipeline/venv/bin/dumpSTR", line 33, in
sys.exit(load_entry_point('trtools', 'console_scripts', 'dumpSTR')())
File "/project/jcreminslab/emersond_projects/4d_nucleome/ALS/TRTools/trtools/dumpSTR/dumpSTR.py", line 1245, in run
retcode = main(args)
File "/project/jcreminslab/emersond_projects/4d_nucleome/ALS/TRTools/trtools/dumpSTR/dumpSTR.py", line 1204, in main
record.vcfrecord.INFO['HWEP'] = utils.GetHardyWeinbergBinomialTest(allele_freqs, genotype_counts)
File "/project/jcreminslab/emersond_projects/4d_nucleome/ALS/TRTools/trtools/utils/utils.py", line 312, in GetHardyWeinbergBinomialTest
if gt[1] not in allele_freqs.keys():
IndexError: tuple index out of range

Hi there,

My guess is that you're running this on a haploid sample (probably a male with one X chromosome). Is that correct? As it says on our README, we currently only support diploid genotypes (though our error message around this should be better). That's something we want to change and is quite doable, but is a decent amount of effort and so hasn't been prioritized yet.

If that's not what's happening, can you share the VCF you're working with so that we can look into it further?

See issue #89
dumpSTR doesn't handle chrX in males
To verify this is your problem, delete chrX variants from gangSTR output and try dumpSTR again