[Breaking Change] Rename of methods/fields: ctt, chisq, hardy_weinberg, hardy_weinberg_p, variant_qc, transition_disequilibrium_test

For clarity and consistency, we’ve renamed the following:

Functions:
ctt => contingency_table_test
chisq => chi_squared_test
hardy_weinberg => hardy_weinberg_test

Aggregator:
hardy_weinberg_p => hardy_weinberg_test

Fields in hardy_weinberg_test:
p_hwe => p_value
r_expected_het_freq => het_freq_hwe (the expected frequency of het under HWE)

Fields in variant_qc result:
p_hwe => p_value_hwe
r_expected_het_freq => het_freq_hwe

Field in transition_disequilibrium_test result:
chi2 => chi_sq

Hi Jon,

From the 01-gwas.ipynb tutorial from github (updated 13 hrs ago), when running:

qc_table = mt.rows()
qc_table = qc_table.select(gq_mean = qc_table.variant_qc.gq_stats.mean,
                           call_rate = qc_table.variant_qc.call_rate,
                           p_value_hwe = qc_table.variant_qc.p_value_hwe,
                           AAF = qc_table.variant_qc.AF[1],)

p1 = hl.plot.histogram(qc_table.gq_mean, range=(10,80), legend='Variant Mean GQ')

p2 = hl.plot.histogram(qc_table.AAF, range=(0,1), legend='Alternate Allele Frequency')

p3 = hl.plot.histogram(qc_table.call_rate, range=(.5,1), legend='Variant Call Rate')

p4 = hl.plot.histogram(qc_table.p_value_hwe, range=(0,1), legend='Hardy-Weinberg Equilibrium p-value')

g = gridplot([[p1, p2], [p3, p4]])
show(g) 

I get the following:

FatalError                                Traceback (most recent call last)
<ipython-input-50-2cbb8f9733b0> in <module>()
      5                            AAF = qc_table.variant_qc.AF[1],)
      6 
----> 7 p1 = hl.plot.histogram(qc_table.gq_mean, range=(10,80), legend='Variant Mean GQ')
      8 
      9 p2 = hl.plot.histogram(qc_table.AAF, range=(0,1), legend='Alternate Allele Frequency')

~/hail-python.zip/hail/typecheck/check.py in wrapper(*args, **kwargs)
    545         def wrapper(*args, **kwargs):
    546             args_, kwargs_ = check_all(f, args, kwargs, checkers, is_method=is_method)
--> 547             return f(*args_, **kwargs_)
    548 
    549         update_wrapper(wrapper, f)

~/hail-python.zip/hail/plot/plots.py in histogram(data, range, bins, legend, title)
     45             else:
     46                 start, end = agg_f((aggregators.min(data), aggregators.max(data)))
---> 47             data = agg_f(aggregators.hist(data, start, end, bins))
     48         else:
     49             return ValueError('Invalid input')

~/hail-python.zip/hail/table.py in aggregate(self, expr)
   1137         analyze('Table.aggregate', expr, self._global_indices, {self._row_axis})
   1138 
-> 1139         result_json = base._jt.aggregateJSON(str(expr._ir))
   1140         return expr.dtype._from_json(result_json)
   1141 

/usr/lib/spark/python/lib/py4j-src.zip/py4j/java_gateway.py in __call__(self, *args)
   1131         answer = self.gateway_client.send_command(command)
   1132         return_value = get_return_value(
-> 1133             answer, self.gateway_client, self.target_id, self.name)
   1134 
   1135         for temp_arg in temp_args:

~/hail-python.zip/hail/utils/java.py in deco(*args, **kwargs)
    198             raise FatalError('%s\n\nJava stack trace:\n%s\n'
    199                              'Hail version: %s\n'
--> 200                              'Error summary: %s' % (deepest, full, hail.__version__, deepest)) from None
    201         except pyspark.sql.utils.CapturedException as e:
    202             raise FatalError('%s\n\nJava stack trace:\n%s\n'

FatalError: NoSuchMethodError: is.hail.stats.package$.hardyWeinbergTest(III)[D

Any idea? I’m running:version devel-98f4d6a179b4. Thanks!

Your Python and Java libraries are out of sync - you’ll need to recompile

(I’m assuming that you are compiling your own, because this should not be happening with a distribution. let us know if it is)

I re-compiled and re-distributed to my core instances and it worked. Thanks!