Could not able to export the data to ElasticSearch

You’ll need to create an entirely new reference genome – not add sequence to GRCh37 (this is used to add a fasta file for reference base lookups).

This will look something like

hs37d5 = hl.ReferenceGenome(name='hs37d5', contigs=['1', '2', '3', ...], ...)

Then you’ll need to use this reference on import.

1 Like

Thanks @tpoterba, it helps. Great work.

Hi @tpoterba,

Is there a way, I can add hs37d5 to the existing contigs of GRCh37?

Thanks

You can build a new reference genome based on GRCh37, but you cannot modify the existing GRCh37 - this is a somewhat nonsensical thing to do, since GRCh37 is a well-defined reference genome and does not contain a hs37d5 contig.

Hi Hail team,

While exporting the data to Elasticsearch there is an error in Hail 0.2.11, where I can export the same data in version 0.2.10. I have installed Hail 0.2.10 and I can export the data. Just wanted to report this error.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-2faccc96d948> in <module>()
  8                           block_size=1000,
  9                           config={'es.nodes.wan.only':'true'},
---> 10                           verbose=True)

<decorator-gen-1270> in export_elasticsearch(t, host, port, index, index_type, block_size, config, verbose)

~/anaconda3/envs/python3/lib/python3.6/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
559     def wrapper(__original_func, *args, **kwargs):
560         args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 561         return __original_func(*args_, **kwargs_)
562 
563     return wrapper

~/anaconda3/envs/python3/lib/python3.6/site-packages/hail/methods/impex.py in export_elasticsearch(t, host, port, index, index_type, block_size, config, verbose)
   2102         :func:`.export_elasticsearch` is EXPERIMENTAL.
   2103     """
-> 2104     Env.hail().io.ElasticsearchConnector.export(t.expand_types()._jt, host, port, index, index_type, block_size, config, verbose)

~/anaconda3/envs/python3/lib/python3.6/site-packages/hail/table.py in __getattr__(self, item)
 99             return self.__dict__[item]
100         else:
--> 101             raise AttributeError(get_nice_attr_error(self, item))
102 
103     def _copy_fields_from(self, other: 'ExprContainer'):

AttributeError: Table instance has no attribute '_jt'

have a fix in an open pull request: