Beispiel #1
0
def get_reference(name) -> 'hail.ReferenceGenome':
    """Returns the reference genome corresponding to `name`.

    Notes
    -----

    Hail's built-in references are ``'GRCh37'`` and ``GRCh38'``. The contig names
    and lengths come from the GATK resource bundle:
    `human_g1k_v37.dict <ftp://[email protected]/bundle/b37/human_g1k_v37.dict>`__
    and `Homo_sapiens_assembly38.dict <ftp://[email protected]/bundle/hg38/Homo_sapiens_assembly38.dict>`__.

    If ``name='default'``, the value of :func:`.default_reference` is returned.

    Parameters
    ----------
    name : :obj:`str`
        Name of a previously loaded reference genome or one of Hail's built-in
        references: ``'GRCh37'``, ``'GRCh38'``, and ``'default'``.

    Returns
    -------
    :class:`.ReferenceGenome`
    """
    from hail import ReferenceGenome

    if name == 'default':
        return default_reference()
    else:
        return ReferenceGenome._references.get(
            name,
            ReferenceGenome._from_java(
                Env.hail().variant.ReferenceGenome.getReference(name)))
Beispiel #2
0
 def default_reference(self):
     if not self._default_ref:
         self._default_ref = ReferenceGenome._from_java(
             Env.hail().variant.ReferenceGenome.defaultReference())
     return self._default_ref
Beispiel #3
0
 def default_reference(self):
     if not self._default_ref:
         self._default_ref = ReferenceGenome._from_java(Env.hail().variant.ReferenceGenome.defaultReference())
     return self._default_ref