gnomad_toolbox.load_data

Functions to import gnomAD data.

Module Functions

gnomad_toolbox.load_data.GnomADSession()

Class to manage the default data type and version for a gnomAD session.

gnomad_toolbox.load_data.get_gnomad_release([...])

Get gnomAD HT by dataset, data type, and version.

gnomad_toolbox.load_data.get_compatible_dataset_versions(dataset)

Get the compatible version of another datasets for a given gnomAD variant data version.

Functions to import gnomAD data.

class gnomad_toolbox.load_data.GnomADSession[source]

Class to manage the default data type and version for a gnomAD session.

set_default_data(data_type=None, version=None)[source]

Set default data type and version.

Parameters:
  • data_type (Optional[str]) – Data type (exomes, genomes, or joint).

  • version (Optional[str]) – gnomAD version.

Return type:

None

Returns:

None.

gnomad_toolbox.load_data.get_gnomad_release(dataset='variant', data_type=None, version=None)[source]

Get gnomAD HT by dataset, data type, and version.

Not all combinations of dataset, data type, and version are available and/or supported by the toolbox. The table below shows what is supported.

Available versions for each dataset and data type are (as of 2025-1-13)

Genome Build

Dataset

Version

Data Types

GRCh37

variant

2.1.1

exomes, genomes

coverage

2.1

exomes, genomes

constraint

2.1.1

N/A

pext

v7

base_level, annotation_level

liftover

2.1.1

exomes, genomes

GRCh38

variant

4.1

exomes, genomes, joint

all_sites_an

4.1

exomes, genomes

browser

4.1

N/A (joint, but doesn’t need to be specified)

coverage

3.0.1

genomes

constraint

4.1

N/A

pext

v10

base_level, annotation_level

Parameters:
  • dataset (str) – Dataset type. One of “variant”, “coverage”, “all_sites_an”, “constraint”, “liftover”, “pext”, “browser”. Default is “variant”.

  • data_type (Optional[str]) – Data type. One of “exomes”, “genomes”, “joint” for all datasets except “pext” where it is one of “base_level”, “annotation_level”. Default is the current session data type.

  • version (Optional[str]) – gnomAD dataset version. Default is the current session version.

Return type:

Table

Returns:

Hail Table for requested dataset, data type, and version.

gnomad_toolbox.load_data.get_compatible_dataset_versions(dataset, variant_version=None, data_type=None)[source]

Get the compatible version of another datasets for a given gnomAD variant data version.

Parameters:
  • dataset (str) – Dataset to get the compatible version for.

  • variant_version (Optional[str]) – Optional gnomAD variant data version. If not provided, the current session version is used.

  • data_type (Optional[str]) – Optional data type for the dataset if applicable.

Return type:

Union[str, dict]

Returns:

Compatible version of the dataset for the given variant version.