dridk / PyVCF3

A Variant Call Format reader for Python.
http://pyvcf.readthedocs.org/en/latest/index.html
Other
52 stars 9 forks source link

List index out of range with VCARD file Version 3.0 #4

Closed chentz78 closed 2 years ago

chentz78 commented 2 years ago

Hi, I'm trying to use the project to read a VCARD file generated from Android Phone App. This App generate a version 3.0 VCard that I'm trying to read with the code below:

import vcf

reader = vcf.Reader(open('a.vcf','r'))
for e in reader:
  print(e)

The file 'a.vcf' has only one register and you can see its content below:

BEGIN:VCARD
VERSION:3.0
N:123;Joao;;;
FN:Joao 123
TEL;TYPE=CELL:997-345-21
END:VCARD

When I run the code I get this error message:

Traceback (most recent call last):
  File "./vcf2Panda.py", line 17, in <module>
    for e in reader:
  File "/opt/python-3.6.6/lib/python3.6/site-packages/vcf/parser.py", line 684, in __next__
    pos = int(row[1])
IndexError: list index out of range

My environment is an Debian Linux with Python 3.6.6 installed. How can I solve this problem?

Rohan-cod commented 2 years ago

I don't think a VCARD can be parsed using PyVCF/PyVCF3. It's only for VCF(variant call format).

chentz78 commented 2 years ago

Thanks @Rohan-cod ! I'm sorry, I had confuse myself about the project's goal.