Entering edit mode
22 months ago
Najla
•
0
I was working on a building a GUI with wxPython and wanted to import a VCF file
with open(file_path, 'r') as file:
vcf_reader = vcf.Reader(file)
for record in vcf_reader:
# Access the fields of each VCF record as needed
chrom = record.CHROM
pos = record.POS
ref = record.REF
alt = record.ALT
qual = record.QUAL
however I got this error
SyntaxError: One of the FILTER lines is malformed: ##FILTER=All filters passed
even though I check the header in the vcf file and it seems correct
##fileformat=VCFv4.1
##fileDate=20221003
##phasing=unphased
##source=VariantAnnotation 1.40.0
##FILTER=<ID=PASS,Description="All filters passed">
##FORMAT=<ID=AD,Number=2,Type=Integer,Description="Allelic depths (number of reads in each observed allele)">
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Total read depth">
##FORMAT=<ID=FT,Number=1,Type=String,Description="Variant filters">
Does anyone know why is this happening and how to fix this issue? Thanks!
Have you tried to check all the lines having the word "FILTER"? You might have another FILTER line in your header not compliant.
grep FILTER input.vcf