|
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.1", "4.1.1"] |
| 51 | + |
48 | 52 | DATA_TYPES = ["exomes", "genomes", "joint"] |
49 | 53 | MAJOR_RELEASES = ["v3", "v4"] |
50 | 54 | CURRENT_MAJOR_RELEASE = MAJOR_RELEASES[-1] |
@@ -428,6 +432,16 @@ def _public_constraint_ht_path(version: str) -> str: |
428 | 432 | return f"gs://gnomad-public-requester-pays/release/{version}/constraint/gnomad.v{version}.constraint_metrics.ht" |
429 | 433 |
|
430 | 434 |
|
| 435 | +def _public_constraint_mutation_rate_ht_path(version: str) -> str: |
| 436 | + """ |
| 437 | + Get public constraint mutation rate table path. |
| 438 | +
|
| 439 | + :param version: One of the constraint release versions of gnomAD on GRCh38. |
| 440 | + :return: Path to mutation rate Table. |
| 441 | + """ |
| 442 | + return f"gs://gnomad-public-requester-pays/release/{version}/constraint/model/gnomad.v{version}.mutation_rate.ht" |
| 443 | + |
| 444 | + |
431 | 445 | def _public_browser_variant_ht_path(version: str) -> str: |
432 | 446 | """ |
433 | 447 | Get public browser variant table path. |
@@ -833,10 +847,27 @@ def constraint() -> VersionedTableResource: |
833 | 847 | :return: Gene constraint Table. |
834 | 848 | """ |
835 | 849 | return VersionedTableResource( |
836 | | - CURRENT_EXOME_RELEASE, |
| 850 | + CURRENT_CONSTRAINT_RELEASE, |
837 | 851 | { |
838 | 852 | release: GnomadPublicTableResource(path=_public_constraint_ht_path(release)) |
839 | | - for release in EXOME_RELEASES |
| 853 | + for release in CONSTRAINT_RELEASES |
| 854 | + }, |
| 855 | + ) |
| 856 | + |
| 857 | + |
| 858 | +def constraint_mutation_rate() -> VersionedTableResource: |
| 859 | + """ |
| 860 | + Retrieve constraint mutation rate Table. |
| 861 | +
|
| 862 | + :return: Mutation rate Table. |
| 863 | + """ |
| 864 | + return VersionedTableResource( |
| 865 | + CURRENT_CONSTRAINT_RELEASE, |
| 866 | + { |
| 867 | + release: GnomadPublicTableResource( |
| 868 | + path=_public_constraint_mutation_rate_ht_path(release) |
| 869 | + ) |
| 870 | + for release in CONSTRAINT_RELEASES |
840 | 871 | }, |
841 | 872 | ) |
842 | 873 |
|
|
0 commit comments