How to read vcf.bgz or vcf.gz in python using PyVcf?
When I try to do simply like this:
vcf_reader = vcf.Reader(open("input.vcf.gz", 'r')) vcf_writer = vcf.Writer(open('input.vcf.gz', 'w'), vcf_reader)
there is an error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
• 6,285 views
•
link
1 answer
I haven't tried it by I think you should use the filename parameter:
vcf_reader = vcf.Reader(filename='input.vcf.gz')
• 0 views
•
link
Log in to answer this question.