brentp / vcfanno

annotate a VCF with other VCFs/BEDs/tabixed files
https://genomebiology.biomedcentral.com/articles/10.1186/s13059-016-0973-5
MIT License
364 stars 56 forks source link

panic: interface conversion: interface {} is float64, not int #100

Closed wdecoster closed 5 years ago

wdecoster commented 5 years ago

Hi Brent,

I encounter the error below when annotating a vcf of structural variants, obtained using SURVIVOR merge of two input vcfs. The command is vcfanno -ends -p 8 vcfanno_conf.toml {input} > {output} (running in snakemake). A single variant in the vcf is sufficient to reproduce this issue (see bottom of the post). I can't figure out what is wrong

=============================================
vcfanno version 0.3.1 [built with go1.11]

see: https://github.com/brentp/vcfanno
=============================================
vcfanno.go:115: found 1 sources from 1 files
panic: interface conversion: interface {} is float64, not int

goroutine 11 [running]:
github.com/brentp/vcfgo.(*Variant).End(0xc00013add0, 0xc000002801)
        /home/brentp/go/src/github.com/brentp/vcfgo/variant.go:147 +0x95d
github.com/brentp/irelate.ciRel.End(0x830ea0, 0xc0001383f0, 0x0, 0x28a4)
        /home/brentp/go/src/github.com/brentp/irelate/parallel.go:177 +0x31
github.com/brentp/irelate.PIRelate.func4(0x1f40, 0x82dfe0, 0xc000213680, 0x7df101, 0x4e20, 0xc00000eea0, 0xc000111920, 0x1, 0x1, 0xc000331800, ...)
        /home/brentp/go/src/github.com/brentp/irelate/parallel.go:302 +0x1e5
created by github.com/brentp/irelate.PIRelate
        /home/brentp/go/src/github.com/brentp/irelate/parallel.go:277 +0x260

I get the impression that the cause is not in my annotation files, as commenting out entries in the vcfanno_conf.toml (below) did not change anything.

[[annotation]]
file="GRCh38_full_annotation.bed.gz"
columns = [4]
ops = ["uniq"]
names = ["GENE"]

[[annotation]]
file="GRCh38_exons.bed.gz"
columns = [4]
ops = ["uniq"]
names = ["CODING"]

[[annotation]]
file="GRCh38_genomicSuperDups.bed.bgz"
columns = [4]
ops = ["uniq"]
names = ["SEGDUP"]

[[annotation]]
file="dgv_GRCh38.bed.bgz"
columns = [4]
ops = ["uniq"]
names = ["DGV"]

minimal vcf for reproducing the error:

##fileformat=VCFv4.1
##FILTER=<ID=PASS,Description="All filters passed">
##source=SURVIVOR
##fileDate=20190220
##contig=<ID=chr21,length=46709983>
##ALT=<ID=DEL,Description="Deletion">
##ALT=<ID=DUP,Description="Duplication">
##ALT=<ID=INV,Description="Inversion">
##ALT=<ID=BND,Description="Translocation">
##ALT=<ID=INS,Description="Insertion">
##INFO=<ID=CIEND,Number=2,Type=String,Description="PE confidence interval around END">
##INFO=<ID=CIPOS,Number=2,Type=String,Description="PE confidence interval around POS">
##INFO=<ID=CHR2,Number=1,Type=String,Description="Chromosome for END coordinate in case of a translocation">
##INFO=<ID=END,Number=1,Type=Integer,Description="End position of the structural variant">
##INFO=<ID=MAPQ,Number=1,Type=Integer,Description="Median mapping quality of paired-ends">
##INFO=<ID=RE,Number=1,Type=Integer,Description="read support">
##INFO=<ID=IMPRECISE,Number=0,Type=Flag,Description="Imprecise structural variation">
##INFO=<ID=PRECISE,Number=0,Type=Flag,Description="Precise structural variation">
##INFO=<ID=SVLEN,Number=1,Type=Float,Description="Length of the SV">
##INFO=<ID=SVMETHOD,Number=1,Type=String,Description="Method for generating this merged VCF file.">
##INFO=<ID=SVTYPE,Number=1,Type=String,Description="Type of the SV.">
##INFO=<ID=SUPP_VEC,Number=1,Type=String,Description="Vector of supporting samples.">
##INFO=<ID=SUPP,Number=1,Type=String,Description="Number of samples supporting the variant">
##INFO=<ID=STRANDS,Number=1,Type=String,Description="Indicating the direction of the reads with respect to the type and breakpoint.">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##FORMAT=<ID=PSV,Number=1,Type=String,Description="Previous support vector">
##FORMAT=<ID=LN,Number=1,Type=Integer,Description="predicted length">
##FORMAT=<ID=DR,Number=2,Type=Integer,Description="# supporting reference,variant reads in that order">
##FORMAT=<ID=ST,Number=1,Type=String,Description="Strand of SVs">
##FORMAT=<ID=QV,Number=1,Type=String,Description="Quality values: if not defined a . otherwise the reported value.">
##FORMAT=<ID=TY,Number=1,Type=String,Description="Types">
##FORMAT=<ID=ID,Number=1,Type=String,Description="Variant ID from input.">
##FORMAT=<ID=RAL,Number=1,Type=String,Description="Reference allele sequence reported from input.">
##FORMAT=<ID=AAL,Number=1,Type=String,Description="Alternative allele sequence reported from input.">
##FORMAT=<ID=CO,Number=1,Type=String,Description="Coordinates">
#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  NA19240 NA19240_1
chr21   5033804 9       T       <INS>   203     PASS    SUPP=2;SUPP_VEC=11;SVLEN=80;SVTYPE=INS;SVMETHOD=SURVIVOR1.0.6;CHR2=chr21;END=5033805;CIPOS=0,180;CIEND=0,180;STRANDS=+- G
T:PSV:LN:DR:ST:QV:TY:ID:RAL:AAL:CO      0/1:NA:81:12,4:+-:131,131,190,203,32:INS,INS,INS,INS,INS:9:NA:NA:chr21_5033804-chr21_5033805,chr21_5033843-chr21_5033844,chr21_5033857-ch
r21_5033858,chr21_5033893-chr21_5033894,chr21_5033984-chr21_5033985     1/1:NA:79:0,16:+-:.:INS:36951:NA:NA:chr21_5033857-chr21_5033936
brentp commented 5 years ago

Does it go away if you change:

##INFO=<ID=SVLEN,Number=1,Type=Float,Description="Length of the SV">

to:

##INFO=<ID=SVLEN,Number=1,Type=Integer,Description="Length of the SV">

? If so, I can make a quick fix and you can just update that part of your header.

wdecoster commented 5 years ago

That's right, that does the trick!

brentp commented 5 years ago

this is fixed in vcfgo. It will be out in next release.

wangjiawen2013 commented 5 years ago

I met the same issue and solved it according to brentp's suggestion. @wdecoster In fact, I am following your bioRxiv work with your snakemake pipeline ! @brentp when will the issue fixed ? I am using the latest vcfanno now, but it still exists.

brentp commented 5 years ago

I'll make a new release soon, but you can get past this issue by converting SVLEN from type Float to type Integer.