KarchinLab / open-cravat-modules-karchinlab

MIT License
0 stars 6 forks source link

Dynamic parsing for CSQ field #2

Closed chadisaad closed 4 years ago

chadisaad commented 4 years ago

You suppose that the alt allele is the first field in CSQ array. But when using VEP with custom databases, these custom fields are inserted et the end of the CSQ fields. And so, vepalt isn't vepalt = colvalss[i][0] anymore.

https://github.com/KarchinLab/open-cravat-modules-karchinlab/blob/5692447aaa103abb1105dfd6f013b814059b9733/converters/vcf-converter/vcf-converter.py#L261

and getting this error: File /oc/converters/vcf-converter/vcf-converter.py", line 488, in convert_line self.info_field_data = self.parse_data_info_field(info, pos, ref, alts, l, all_wdicts) File "/oc/converters/vcf-converter/vcf-converter.py", line 268, in parse_data_info_field if colname not in info_dict[refalt]: KeyError: 'A:191'

Is it possible to get the alt allele index from the header ? instead of assuming that it is 0

rkimoakbioinformatics commented 4 years ago

Thanks Chadi. I have merged your pull request.