Skip to content

Commit

Permalink
add conf file for gnomad
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Mar 7, 2017
1 parent b8ce754 commit a187227
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,16 @@ func (a *Annotator) PostAnnotate(chrom string, start int, end int, info interfac
vals = append(vals, val)
} else {
if e != nil {
//log.Println(field, e, vals, chrom, start, end)
err = e
}
}
}
// run this as long as we found any of the values.
if len(vals) != 0 {
if post.Op == "div2" && len(vals) < 2 {
continue
}
fn := Reducers[post.Op]
if post.Name == "ID" && prefix == "" {
newid = fmt.Sprintf("%s", fn(vals))
Expand Down
92 changes: 92 additions & 0 deletions example/gnomad.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
[[annotation]]
file="gnomad.exomes.r2.0.1.sites.no-VEP.nohist.tidy.vcf.gz"
fields = ["AC", "AN", "AC_AFR", "AN_AFR", "AC_AMR", "AN_AMR", "AC_ASJ", "AN_ASJ", "AC_EAS", "AN_EAS", "AC_FIN", "AN_FIN", "AC_NFE", "AN_NFE", "AC_OTH", "AN_OTH", "AC_SAS", "AN_SAS"]

names = ["ac_gnomad_all", "an_gnomad_all", "ac_gnomad_afr", "an_gnomad_afr", "ac_gnomad_amr", "an_gnomad_amr", "ac_gnomad_asj", "an_gnomad_asj", "ac_gnomad_eas", "an_gnomad_eas", "ac_gnomad_fin", "an_gnomad_fin", "ac_gnomad_nfe", "an_gnomad_nfe", "ac_gnomad_oth", "an_gnomad_oth", "ac_gnomad_sas", "an_gnomad_sas"]
ops=["max", "self", "max", "self", "max", "self", "max", "self", "max", "self", "max", "self", "max", "self", "max", "self", "max", "self"]

[[annotation]]
file="clinvar_20160203.tidy.vcf.gz"
fields=["CLNSIG", "CLNDBN"]
names=["clinvar_pathogenic", "clinvar_disease_name"]
ops=["self", "self"]

# convert 5 to 'pathogenic', 255 to 'unknown', etc.
[[postannotation]]
fields=["clinvar_pathogenic"]
op="lua:clinvar_sig(clinvar_pathogenic)"
name="clinvar_sig"
type="String"

# calculate allele frequencies for all populations.
[[postannotation]]
fields=["ac_gnomad_all", "an_gnomad_all"]
name="af_gnomad_all"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_afr", "an_gnomad_afr"]
name="af_gnomad_afr"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_amr", "an_gnomad_amr"]
name="af_gnomad_amr"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_eas", "an_gnomad_eas"]
name="af_gnomad_eas"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_fin", "an_gnomad_fin"]
name="af_gnomad_fin"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_nfe", "an_gnomad_nfe"]
name="af_gnomad_nfe"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_oth", "an_gnomad_oth"]
name="af_gnomad_oth"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_sas", "an_gnomad_sas"]
name="af_gnomad_sas"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_sas", "an_gnomad_sas"]
name="af_gnomad_sas"
op="div2"
type="Float"

[[postannotation]]
fields=["ac_gnomad_asj", "an_gnomad_asj"]
name="af_gnomad_asj"
op="div2"
type="Float"

[[postannotation]]
fields=['af_gnomad_afr', 'af_gnomad_amr', 'af_gnomad_eas', 'af_gnomad_fin', 'af_gnomad_nfe', 'af_gnomad_oth', 'af_gnomad_sas']
op="max"
name="max_aaf_all"
type="Float"

[[postannotation]]
fields=["clinvar_sig", "max_aaf_all"]
op="lua:check_clinvar_aaf(clinvar_sig, max_aaf_all, 0.005)"
name="common_pathogenic"
type="Flag"

0 comments on commit a187227

Please sign in to comment.