From 2ac41a1999e43a583e0bdbc6956dd893f8c5a6ae Mon Sep 17 00:00:00 2001 From: Brent Pedersen Date: Fri, 17 Mar 2017 19:03:56 -0600 Subject: [PATCH] always run postannotation and set ID even if error in annotation --- api/api.go | 6 +++--- docs/CHANGES.md | 4 ++++ tests/id-test/small.toml | 6 +++--- vcfanno.go | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/api/api.go b/api/api.go index 7036ca8..b4c845e 100644 --- a/api/api.go +++ b/api/api.go @@ -716,13 +716,13 @@ func (a *Annotator) AnnotateEnds(v interfaces.Relatable, ends string) error { } if ends == INTERVAL { err := a.AnnotateOne(v, a.Strict) - if err != nil { - return err - } err2, newid := a.PostAnnotate(v.Chrom(), int(v.Start()), int(v.End()), v.(interfaces.IVariant).Info(), "", id) if newid != "" { v.(*parsers.Variant).IVariant.(*vcfgo.Variant).Id_ = newid } + if err != nil { + return err + } return err2 } // hack: diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 89d02d4..a207d33 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -1,3 +1,7 @@ +v0.2.2 +------ ++ wholely fix order of error checking from postannotation (affects users using ID annotation) (thanks @vladsaveliev) + v0.2.1 ------ + correct order of error-checking on return from postannotation (affects users using ID annotation) diff --git a/tests/id-test/small.toml b/tests/id-test/small.toml index 42b3bcb..bed45c9 100644 --- a/tests/id-test/small.toml +++ b/tests/id-test/small.toml @@ -1,8 +1,8 @@ [[annotation]] file="tests/id-test/dbsnp.small.vcf.gz" -fields=["ID"] -names=["rs_ids"] -ops=["self"] +fields=["ID", "CAF"] +names=["rs_ids", "CAF"] +ops=["self", "self"] [[annotation]] file="tests/id-test/cosmic.small.vcf.gz" diff --git a/vcfanno.go b/vcfanno.go index 3891239..82e799a 100644 --- a/vcfanno.go +++ b/vcfanno.go @@ -24,7 +24,7 @@ import ( "github.com/brentp/xopen" ) -var VERSION = "0.2.1" +var VERSION = "0.2.2" func envGet(name string, vdefault int) int { sval := os.Getenv(name)