add allele frequency for gnomad controls and non_neuro
see
MODIFY
docs/content/database_schema.rst
docs/content/database_schema.rst
@@ -181,6 +181,9 @@ aaf_gnomad_fin FLOAT Allele frequency (FIN population) of the
aaf_gnomad_nfe FLOAT Allele frequency (NFE population) of the variant in gnomad
aaf_gnomad_oth FLOAT Allele frequency (OTH population) of the variant in gnomad
aaf_gnomad_sas FLOAT Allele frequency (SAS population) of the variant in gnomad
+aaf_gnomad_non_neuro FLOAT Allele frequency in non_neuro samples
+aaf_gnomad_controls FLOAT Allele frequency in control samples
+
gnomad_num_het INTEGER Number of het genotypes observed in gnomad
gnomad_num_hom_alt INTEGER Number of hom_alt genotypes observed in gnomad
gnomad_num_chroms INTEGER Number of chromosomes genotyped in gnomad

MODIFY
gemini/annotations.py
gemini/annotations.py
@@ -180,11 +180,13 @@ GnomadInfo = collections.namedtuple('GnomadInfo',
aaf_NFE \
aaf_OTH \
aaf_SAS \
+ aaf_non_neuro \
+ aaf_controls \
num_het \
num_hom_alt \
num_chroms")
-GNOMAD_EMPTY = GnomadInfo(-1, -1, -1, -1, -1, -1,
+GNOMAD_EMPTY = GnomadInfo(-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1)
def load_annos(args):
@@ -799,6 +801,8 @@ def get_gnomad_info(var, empty=GNOMAD_EMPTY):
afs[grp] = float(ac) / float(an)
if ac is None or an is None: continue
+ afs['non_neuro'] = info_map.get('non_neuro_AF', 0.0)
+ afs['control'] = info_map.get('controls_AF', 0.0)
nhm = sum(map(int, info_map.get('GC_Male', '').split(",")[1:-1]))
nhf = sum(map(int, info_map.get('GC_Female', '').split(",")[1:-1]))
@@ -812,7 +816,10 @@ def get_gnomad_info(var, empty=GNOMAD_EMPTY):
float(afs['_amr']), float(afs['_asj']),
float(afs['_eas']), float(afs['_fin']),
float(afs['_nfe']), float(afs['_oth']),
- float(afs['_sas']), num_hets, num_homs,
+ float(afs['_sas']),
+ info_map.get('non_neuro_AF', 0.0),
+ info_map.get('controls_AF', 0.0),
+ num_hets, num_homs,
called_chroms)
return empty

MODIFY
gemini/database.py
gemini/database.py
@@ -272,6 +272,8 @@ def create_tables(path, effect_fields=None, pls=True):
aaf_gnomad_nfe decimal(2,7),
aaf_gnomad_oth decimal(2,7),
aaf_gnomad_sas decimal(2,7),
+ aaf_gnomad_non_neuro decimal(2,7),
+ aaf_gnomad_controls decimal(2,7),
gnomad_num_het int,
gnomad_num_hom_alt int,

MODIFY
gemini/gemini_load_chunk.py
gemini/gemini_load_chunk.py
@@ -688,6 +688,9 @@ class GeminiLoader(object):
aaf_gnomad_nfe=gnomad.aaf_NFE,
aaf_gnomad_oth=gnomad.aaf_OTH,
aaf_gnomad_sas=gnomad.aaf_SAS,
+ aaf_gnomad_non_neuro=gnomad.aaf_non_neuro,
+ aaf_gnomad_controls=gnomad.aaf_controls,
+
gnomad_num_het=gnomad.num_het,
gnomad_num_hom_alt=gnomad.num_hom_alt,

MODIFY
test/test-gnomad.sh
test/test-gnomad.sh
@@ -12,7 +12,7 @@ check()
export -f check
-echo " gnomad.t01...\c"
+echo " gnomad.t01...\n"
echo "chrom start end ref alt aaf_gnomad_all aaf_gnomad_all aaf_gnomad_afr aaf_gnomad_amr aaf_gnomad_eas aaf_gnomad_fin aaf_gnomad_nfe aaf_gnomad_oth aaf_gnomad_sas
chr1 985954 985955 G C -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0
chr1 1199488 1199489 G A -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0
@@ -31,4 +31,20 @@ gemini query --header -q "select chrom, start, end, ref, alt, aaf_gnomad_all, aa
check obs.$$ exp.$$
rm obs.$$ exp.$$
+echo " gnomad.t02...\n"
+gemini query --header -q "select chrom, start, end, ref, alt, aaf_gnomad_non_neuro, aaf_gnomad_controls from variants" test.exac.db > obs.$$
+echo "chrom start end ref alt aaf_gnomad_non_neuro aaf_gnomad_controls
+chr1 985954 985955 G C -1.0 -1.0
+chr1 1199488 1199489 G A -1.0 -1.0
+chr1 1959698 1959699 G A 0.0164560005069 0.0170828998089
+chr1 161276552 161276553 G T -1.0 -1.0
+chr1 247587092 247587093 C T -1.0 -1.0
+chr9 112185055 112185056 C G 9.61224031926e-06 0.0
+chr12 121432116 121432118 GC G 5.28017008037e-05 6.08346999798e-05
+chr14 105420589 105420590 C T 0.0016407299554 0.00138945004437" > exp.$$
+
+check obs.$$ exp.$$
+
+#############################################
+
#############################################

add allele frequency for gnomad controls and non_neuro

see #912