From a1872278477448e3b3aeb6edc9e471d39c97b7fb Mon Sep 17 00:00:00 2001 From: Brent Pedersen Date: Tue, 7 Mar 2017 15:30:06 -0700 Subject: [PATCH] add conf file for gnomad --- api/api.go | 4 ++ example/gnomad.conf | 92 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 example/gnomad.conf diff --git a/api/api.go b/api/api.go index 52dc03b..65fab36 100644 --- a/api/api.go +++ b/api/api.go @@ -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)) diff --git a/example/gnomad.conf b/example/gnomad.conf new file mode 100644 index 0000000..bb1f011 --- /dev/null +++ b/example/gnomad.conf @@ -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"