fix bug reported by
MODIFY
gemini/genewise.py
gemini/genewise.py
@@ -121,12 +121,17 @@ def genewise(db, gt_filters, gt_req_filters, filter=None, columns=None, min_filt
gt_filter = gq._correct_genotype_filter(gt_filter)
cleaned_reqs.append(compile(gt_filter, gt_filter, 'eval'))
- gq.run(query.format(columns=", ".join(columns)))
+
+ if not "gt_types" in columns:
+ columns.append("gt_types")
+ added_cols.append("gt_types")
+ gq.run(query.format(columns=", ".join(columns)), needs_genotypes=True)
if isinstance(grouper, basestring):
grouper = operator.itemgetter(grouper)
- user_dict = dict(sample_info=gq.sample_info)
+ user_dict = dict(sample_info=gq.sample_info, HOM_REF=0, HET=1, UNKNOWN=2,
+ HOM_ALT=3, MISSING=None, UNAFFECTED=1, AFFECTED=2)
header_printed = False
for groupkey, grp in it.groupby(gq, grouper):
grp = list(grp)

MODIFY
test/test-genewise.sh
test/test-genewise.sh
@@ -110,3 +110,13 @@ gemini gene_wise \
--min-filters 1 \
test.auto_dom.db > obs
check obs exp
+
+
+echo "genewise.t8"
+
+gemini gene_wise \
+ --columns "start" \
+ --gt-filter "(gt_quals).(=HET).(>=20).(any) or (gt_quals).(=HOM_ALT).(>=20).(any)" \
+ --min-filters 1 \
+ test.auto_dom.db > obs
+

fix bug reported by @jxchong