gnomad.resources.import_resources

gnomad.resources.import_resources.get_module_importable_resources(module)

Take a module that was imported and generates a list of all resources in this module that can be imported (i.e.

gnomad.resources.import_resources.get_resources_descriptions(...)

Return a string listing all resources in the input dict along with the path from which they are imported and the path at which they are stored.

gnomad.resources.import_resources.main(args)

Import selected resources.

gnomad.resources.import_resources.get_module_importable_resources(module, prefix=None)[source]

Take a module that was imported and generates a list of all resources in this module that can be imported (i.e. with a path and import_func).

The dict produced is as follows:
  • keys: {prefix}.{resource_name}.{version} (with prefix only present if prefix is set, and version only present for versioned resources)

  • values: ({resource_name}[ version {version}], resource) with resource_name set to the variable name in the module and the version present for versioned resources.

The following example will generate a dict with all the resources in gnomad.resources.grch37 that can be imported:

import gnomad.resources.grch37 as grch37
grch37_resources = get_module_importable_resources(grch37, prefix='grch37')
Parameters:
  • module – Input module

  • prefix (Optional[str]) –

Return type:

Dict[str, Tuple[str, BaseResource]]

Returns:

gnomad.resources.import_resources.get_resources_descriptions(resources, width=100)[source]

Return a string listing all resources in the input dict along with the path from which they are imported and the path at which they are stored.

Parameters:
  • resources (Dict[str, Tuple[str, BaseResource]]) – A dict returned from get_module_importable_resources

  • width (Optional[int]) – Maximum width of lines in the returned string

Return type:

str

gnomad.resources.import_resources.main(args)[source]

Import selected resources.