BioJulia/GeneticVariation.jl

Fails to parse metadata with hypen in the key

Opened this issue · 0 comments

apraga commented

Expected Behavior

Parse a vcf with metadata containg hyphen in the key

##VEP-command-line='vep -i test'

Current Behavior

Fails to parse with ERROR: LoadError: GeneticVariation.VCF.Reader file format error on line 4

Removing the hyphen makes it work.

Possible Solution / Implementation

Steps to Reproduce (for bugs)

Minimal working example.
For this vcf :

##fileformat=VCFv4.1
##FILTER=<ID=PASS,Description="All filters passed">
##contig=<ID=chr1,length=249250621>
##VEP-command-line='vep -i test'
##FORMAT=<ID=BLT,Number=1,Type=String,Description="High-level location type (het|homref|hetalt|homalt|nocall).">
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	TRUTH	QUERY

The reader

using GeneticVariation
reader = VCF.Reader(open("script/test.vcf"))

fails with

ERROR: LoadError: GeneticVariation.VCF.Reader file format error on line 4
Stacktrace:
 [1] error(::String, ::Int64)
   @ Base ./error.jl:44
 [2] _readheader!(reader::GeneticVariation.VCF.Reader, state::BioCore.Ragel.State{BufferedStreams.BufferedInputStream{IOStream}})
   @ GeneticVariation.VCF ~/.julia/packages/BioCore/YBJvb/src/ReaderHelper.jl:106
 [3] readheader!(reader::GeneticVariation.VCF.Reader)
   @ GeneticVariation.VCF ~/.julia/packages/BioCore/YBJvb/src/ReaderHelper.jl:80
 [4] Reader
   @ ~/.julia/packages/GeneticVariation/r8DAL/src/vcf/reader.jl:15 [inlined]
 [5] GeneticVariation.VCF.Reader(input::IOStream)
   @ GeneticVariation.VCF ~/.julia/packages/GeneticVariation/r8DAL/src/vcf/reader.jl:28
 [6] top-level scope
   @ /Work/Users/XXX/processing/vcf.jl:4
in expression starting at /Work/Users/XXXX/processing/vcf.jl:4

Your Environment

  • Package Version used:
  • Julia Version used: 1.8.5
  • Operating System and version (desktop or mobile): Rocky Linux 8.5
  • Link to your project: