|
34 | 34 | CURRENT_EXOME_AN_RELEASE = "4.1" |
35 | 35 | CURRENT_GENOME_AN_RELEASE = "4.1" |
36 | 36 |
|
| 37 | +CURRENT_CONSTRAINT_RELEASE = "4.1.1" |
| 38 | + |
37 | 39 | EXOME_RELEASES = ["4.0", "4.1"] |
38 | 40 | GENOME_RELEASES = ["3.0", "3.1", "3.1.1", "3.1.2", "4.0", "4.1"] |
39 | 41 | JOINT_RELEASES = ["4.1"] |
|
45 | 47 | EXOME_AN_RELEASES = ["4.1"] |
46 | 48 | GENOME_AN_RELEASES = ["4.1"] |
47 | 49 |
|
| 50 | +CONSTRAINT_RELEASES = ["4.0", "4.1", "4.1.1"] |
| 51 | +CONSTRAINT_MUTATION_RATE_RELEASES = ["4.1.1"] |
| 52 | + |
48 | 53 | DATA_TYPES = ["exomes", "genomes", "joint"] |
49 | 54 | MAJOR_RELEASES = ["v3", "v4"] |
50 | 55 | CURRENT_MAJOR_RELEASE = MAJOR_RELEASES[-1] |
@@ -422,12 +427,22 @@ def _public_constraint_ht_path(version: str) -> str: |
422 | 427 | """ |
423 | 428 | Get public constraint table path. |
424 | 429 |
|
425 | | - :param version: One of the release versions of gnomAD on GRCh38. |
| 430 | + :param version: One of the constraint release versions of gnomAD on GRCh38. |
426 | 431 | :return: Path to gene constraint Table. |
427 | 432 | """ |
428 | 433 | return f"gs://gnomad-public-requester-pays/release/{version}/constraint/gnomad.v{version}.constraint_metrics.ht" |
429 | 434 |
|
430 | 435 |
|
| 436 | +def _public_constraint_mutation_rate_ht_path(version: str) -> str: |
| 437 | + """ |
| 438 | + Get public constraint mutation rate table path. |
| 439 | +
|
| 440 | + :param version: One of the constraint mutation rate release versions of gnomAD on GRCh38. |
| 441 | + :return: Path to mutation rate Table. |
| 442 | + """ |
| 443 | + return f"gs://gnomad-public-requester-pays/release/{version}/constraint/model/gnomad.v{version}.mutation_rate.ht" |
| 444 | + |
| 445 | + |
431 | 446 | def _public_browser_variant_ht_path(version: str) -> str: |
432 | 447 | """ |
433 | 448 | Get public browser variant table path. |
@@ -833,10 +848,27 @@ def constraint() -> VersionedTableResource: |
833 | 848 | :return: Gene constraint Table. |
834 | 849 | """ |
835 | 850 | return VersionedTableResource( |
836 | | - CURRENT_EXOME_RELEASE, |
| 851 | + CURRENT_CONSTRAINT_RELEASE, |
837 | 852 | { |
838 | 853 | release: GnomadPublicTableResource(path=_public_constraint_ht_path(release)) |
839 | | - for release in EXOME_RELEASES |
| 854 | + for release in CONSTRAINT_RELEASES |
| 855 | + }, |
| 856 | + ) |
| 857 | + |
| 858 | + |
| 859 | +def constraint_mutation_rate() -> VersionedTableResource: |
| 860 | + """ |
| 861 | + Retrieve constraint mutation rate Table. |
| 862 | +
|
| 863 | + :return: Mutation rate Table. |
| 864 | + """ |
| 865 | + return VersionedTableResource( |
| 866 | + CURRENT_CONSTRAINT_RELEASE, |
| 867 | + { |
| 868 | + release: GnomadPublicTableResource( |
| 869 | + path=_public_constraint_mutation_rate_ht_path(release) |
| 870 | + ) |
| 871 | + for release in CONSTRAINT_MUTATION_RATE_RELEASES |
840 | 872 | }, |
841 | 873 | ) |
842 | 874 |
|
|
0 commit comments