I am trying to run the below on a small Exome matrix table
def filter_matrix_table(self): logging.info(f"Filtering matrix table") mt = hl.read_matrix_table(self.input_matrix_table) # memoize the loci we care about mt = mt.annotate_globals(fp_loci=self.get_loci_from_sites_path()) # filter and grab what we need mt = mt.filter_rows(mt.fp_loci.contains(mt.locus)) mt = mt.drop('info', 'fp_loci') return mt.select_entries('GT', 'PL')
I am getting back
Traceback (most recent call last): File "/tmp/1d77d8061d704092bf4a465ab1d44975/extract_fingerprint_sites.py", line 63, in <module> output_path=args.output_path File "/tmp/1d77d8061d704092bf4a465ab1d44975/extract_fingerprint_sites.py", line 44, in run mt = self.filter_matrix_table() File "/tmp/1d77d8061d704092bf4a465ab1d44975/extract_fingerprint_sites.py", line 36, in filter_matrix_table mt = mt.drop('info', 'fp_loci') File "<decorator-gen-1185>", line 2, in drop File "/opt/conda/default/lib/python3.6/site-packages/hail/typecheck/check.py", line 614, in wrapper return __original_func(*args_, **kwargs_) File "/opt/conda/default/lib/python3.6/site-packages/hail/matrixtable.py", line 1315, in drop raise IndexError("MatrixTable has no field '{}'".format(e)) IndexError: MatrixTable has no field 'info'
I think I should be able to run describe or summarize to see if ‘info’ or other fields needs to be removed (should I expect it to be there?), but I am having some trouble finding how I can run that in a python script and grab fields as a list.
edit
Just for clarity, I have already confirmed there is no info field in this specific matrix table using describe and seeing the output, but I would like a way for the script to check on its own without manual intervention.