RabadanLab / arcasHLA

Fast and accurate in silico inference of HLA genotypes from RNA-seq
GNU General Public License v3.0
121 stars 50 forks source link

[KeyError] arcasHLA `convert` - using "group" #122

Closed jinhys closed 9 months ago

jinhys commented 9 months ago

Hi, I'm getting KeyErrors when I run arcasHLA convert using the -r parameter like the commands as follows:

./arcasHLA convert -r p-group <genotypes.tsv> <outfile.tsv>
./arcasHLA convert -r g-group <genotypes.tsv> <outfile.tsv>

1. error message from running -r p-group:

Traceback (most recent call last):
  File "/home/user/tool/arcasHLA/arcasHLA_master/scripts/convert.py", line 196, in <module>
    genotypes[subject][gene] = convert_allele(allele, resolution)
  File "/home/user/tool/arcasHLA/arcasHLA_master/scripts/convert.py", line 98, in convert_allele
    if allele in p_group[i]:
KeyError: 3

2. error message from running -r g-group:

Traceback (most recent call last):
  File "/home/user/tool/arcasHLA/arcasHLA_master/scripts/convert.py", line 196, in <module>
    genotypes[subject][gene] = convert_allele(allele, resolution)
  File "/home/user/tool/arcasHLA/arcasHLA_master/scripts/convert.py", line 90, in convert_allele
    if allele in g_group[i]:
KeyError: 3

*For your reference, these commands work well without any errors:

./arcasHLA convert -r 1 <genotypes.tsv> <outfile.tsv>
./arcasHLA convert -r 2 <genotypes.tsv> <outfile.tsv>
./arcasHLA convert -r 3 <genotypes.tsv> <outfile.tsv>

It would be greatly appreciated if you could fix these KeyErrors! - Please let me know if you need further details.

jinhys commented 9 months ago

Hi @abuendia - If you're available, could you please take a look at these KeyErrors? Thank you!

GaryZhangYue commented 9 months ago

Hi @abuendia - If you're available, could you please take a look at these KeyErrors? Thank you!

This worked: https://github.com/RabadanLab/arcasHLA/issues/91

abuendia commented 9 months ago

Hi @jinhys - Please pull latest from master and let me know if the error persists. Fixed in #94.

jinhys commented 9 months ago

Hi @abuendia, thanks for fixing this issue. I pulled the latest version (v0.5.1) - Now I can generate the output files (both p-group and g-group) successfully using this version. Thank you!