How to read vcf.bgz or vcf.gz in python using PyVcf?
1
1
Entering edit mode
5.0 years ago
ja4123 ▴ 30

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

pyvcf vcf python • 5.5k views
ADD COMMENT
2
Entering edit mode
5.0 years ago

I haven't tried it by I think you should use the filename parameter:

vcf_reader = vcf.Reader(filename='input.vcf.gz')
ADD COMMENT

Login before adding your answer.

Traffic: 1933 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6