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

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.2k views
ADD COMMENT
1
Entering edit mode
4.4 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: 2640 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