|  | 
| 26 | 26 | CURRENT_GENOME_RELEASE = "4.1" | 
| 27 | 27 | CURRENT_JOINT_RELEASE = "4.1" | 
| 28 | 28 | 
 | 
|  | 29 | +CURRENT_BROWSER_RELEASE = "4.1" | 
|  | 30 | + | 
| 29 | 31 | CURRENT_EXOME_COVERAGE_RELEASE = "4.0" | 
| 30 | 32 | CURRENT_GENOME_COVERAGE_RELEASE = "3.0.1" | 
| 31 | 33 | 
 | 
|  | 
| 35 | 37 | EXOME_RELEASES = ["4.0", "4.1"] | 
| 36 | 38 | GENOME_RELEASES = ["3.0", "3.1", "3.1.1", "3.1.2", "4.0", "4.1"] | 
| 37 | 39 | JOINT_RELEASES = ["4.1"] | 
|  | 40 | +BROWSER_RELEASES = ["4.1"] | 
| 38 | 41 | 
 | 
| 39 | 42 | EXOME_COVERAGE_RELEASES = ["4.0"] | 
| 40 | 43 | GENOME_COVERAGE_RELEASES = ["3.0", "3.0.1"] | 
| @@ -391,6 +394,31 @@ def _public_constraint_ht_path(version: str) -> str: | 
| 391 | 394 |     return f"gs://gnomad-public-requester-pays/release/{version}/constraint/gnomad.v{version}.constraint_metrics.ht" | 
| 392 | 395 | 
 | 
| 393 | 396 | 
 | 
|  | 397 | +def _public_browser_variant_ht_path(version: str) -> str: | 
|  | 398 | +    """ | 
|  | 399 | +    Get public browser variant table path. | 
|  | 400 | +
 | 
|  | 401 | +    :param version: One of the release versions of gnomAD on GRCh38. | 
|  | 402 | +    :return: Path to browser variant Table. | 
|  | 403 | +    """ | 
|  | 404 | +    return f"gs://gnomad-public-requester-pays/release/{version}/ht/browser/gnomad.browser.v{version}.sites.ht" | 
|  | 405 | + | 
|  | 406 | + | 
|  | 407 | +def _public_browser_gene_ht_path() -> str: | 
|  | 408 | +    """ | 
|  | 409 | +    Get public browser gene table path. | 
|  | 410 | +
 | 
|  | 411 | +    .. note:: | 
|  | 412 | +
 | 
|  | 413 | +       This table has smaller number of partitions (n=100) for faster computation and | 
|  | 414 | +       contains pext data compared to gnomad.genes.GRCh38.GENCODEv39.ht (which was | 
|  | 415 | +       used by the browser for ES export) under the same path. | 
|  | 416 | +
 | 
|  | 417 | +    :return: Path to browser gene Table. | 
|  | 418 | +    """ | 
|  | 419 | +    return "gs://gnomad-public-requester-pays/resources/grch38/browser/gnomad.genes.GRCh38.GENCODEv39.pext.ht" | 
|  | 420 | + | 
|  | 421 | + | 
| 394 | 422 | def public_release(data_type: str) -> VersionedTableResource: | 
| 395 | 423 |     """ | 
| 396 | 424 |     Retrieve publicly released versioned table resource. | 
| @@ -759,3 +787,29 @@ def constraint(version: str = CURRENT_EXOME_RELEASE) -> VersionedTableResource: | 
| 759 | 787 |             for release in EXOME_RELEASES | 
| 760 | 788 |         }, | 
| 761 | 789 |     ) | 
|  | 790 | + | 
|  | 791 | + | 
|  | 792 | +def browser_variant() -> VersionedTableResource: | 
|  | 793 | +    """ | 
|  | 794 | +    Retrieve browser variant table. | 
|  | 795 | +
 | 
|  | 796 | +    :return: Browser variant Table. | 
|  | 797 | +    """ | 
|  | 798 | +    return VersionedTableResource( | 
|  | 799 | +        CURRENT_BROWSER_RELEASE, | 
|  | 800 | +        { | 
|  | 801 | +            release: GnomadPublicTableResource( | 
|  | 802 | +                path=_public_browser_variant_ht_path(release) | 
|  | 803 | +            ) | 
|  | 804 | +            for release in BROWSER_RELEASES | 
|  | 805 | +        }, | 
|  | 806 | +    ) | 
|  | 807 | + | 
|  | 808 | + | 
|  | 809 | +def browser_gene() -> GnomadPublicTableResource: | 
|  | 810 | +    """ | 
|  | 811 | +    Retrieve browser gene table. | 
|  | 812 | +
 | 
|  | 813 | +    :return: Browser gene Table. | 
|  | 814 | +    """ | 
|  | 815 | +    return GnomadPublicTableResource(path=_public_browser_gene_ht_path()) | 
0 commit comments