Closed dwaggott closed 8 years ago
Just looking quickly on my phone but looks like you need to quote AC. and AN. and op= and Float etc
On Jul 19, 2016 4:18 PM, "Daryl Waggott" notifications@github.com wrote:
If you have encountered an error, please include:
minimal conf and lua files that you are using. urls or actual files for annotations in conf file. minimal query file. the command you used to invoke vcfanno the full error message CONF
[[postannotation]] fields=[AC, AN] op=lua:AC / AN name=AF type=Float
QUERY
tmp.vcf
COMMAND
$ vcfanno add_af.toml tmp.vcf > tmp_af.vcf
ERROR
============================================= vcfanno version 0.0.11-beta [built with devel +5ec87ba Thu Apr 28 15:36:34 2016 +0000] see: https://github.com/brentp/vcfanno ============================================= panic: Near line 2 (last key parsed 'postannotation.fields'): Expected value but found 'A' instead. goroutine 1 [running]: panic(0x7bee60, 0xc820015d00) /usr/local/src/go-git/src/runtime/panic.go:500 +0x18c main.main() /usr/local/src/gocode/src/github.com/brentp/vcfanno/vcfanno.go:81 +0x17f5
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Right, that worked, they got lost in an echo
Next error: vcfanno.go:102: ERROR: requested lua op without specifying -lua flag
I tried both:
op="lua:AC / AN"
and
op="lua:function AC / AN"
should be op="lua: AC / AN"
but you have to specify -lua on the command-line, e.g
echo "" > empty.lua
vcfanno -lua emtpy.lua add_af.toml tmp.vcf
I should ease up that check, but that's how to get around it for now.
Nice, next...
api.go:442: lua error in postannotation AF <string>:1: cannot perform div operation between table and number
stack traceback:
<string>:1: in main chunk
[G]: ?
api.go:442: lua error in postannotation AF <string>:1: cannot perform div operation between table and number
stack traceback:
<string>:1: in main chunk
[G]: ?
api.go:442: lua error in postannotation AF <string>:1: cannot perform div operation between table and number
stack traceback:
<string>:1: in main chunk
[G]: ?
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele count in genotypes, for each ALT allele">
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
Oh, I see it's because AC has NUMBER=A. Hmm, I should have run vt / bcftools norm on these so it shouldn't be the case.
So, thats when you have multiple alternate alleles so you get 2 values for AC. if you want to ignore the possibility of multiple alts, you can do:
op="lua: AC[1] / AN"
but you may want to just do:
[[postannotation]]
fields=["AC"]
op="max"
name="AC_max"
type="Float"
[[postannotation]]
fields=["AC_max", "AN"]
op="lua:AC_max / AN"
# op="div2"
name="AF"
type="Float"
also note that there is a builtin op "div2" that will be faster than using lua
yeah, you can also use vt decompose.
Excellent!
To summarize... a few requested features (a) relax the check for a lua file when not required (b) add an error check message when computing with arrays (c) flush out the doc a bit on subscripted arrays.
remember, after you decompose, you'll still need AC[1] or just use op="div2"
If you have encountered an error, please include:
CONF
QUERY
tmp.vcf
COMMAND
ERROR