import cyvcf2 # Open VCF file vcf = cyvcf2.VCF('/path/to/file.vcf.gz') # Iterate over variants on chromosome 1 for variant in vcf('1'): print(variant)
import cyvcf2 # Open VCF file vcf = cyvcf2.VCF('/path/to/file.vcf.gz') # Iterate over variants passing a quality score threshold for variant in vcf: if variant.QUAL > 20: print(variant)This code examples belong to the library: cyvcf2.