Skip to content

Commit

Permalink
always run postannotation and set ID even if error in annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Mar 18, 2017
1 parent 5f96ad2 commit 2ac41a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/id-test/small.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion vcfanno.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2ac41a1

Please sign in to comment.