Skip to content

Commit 07d009d

Browse files
authored
Merge branch 'master' into infer_sex
2 parents e056c66 + bfdf209 commit 07d009d

File tree

15 files changed

+1519
-928
lines changed

15 files changed

+1519
-928
lines changed

gnomad_hail/resources/grch37/gnomad.py

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -10,69 +10,9 @@
1010
CURRENT_EXOME_RELEASE = "2.1.1"
1111
CURRENT_GENOME_RELEASE = "2.1.1"
1212

13-
CURRENT_EXOME_META = "2018-10-11"
14-
CURRENT_GENOME_META = "2018-10-11"
15-
16-
CURRENT_EXOME_FAM = "2018-04-12"
17-
CURRENT_GENOME_FAM = "2018-04-12"
18-
1913
EXOME_RELEASES = ["2.1", "2.1.1"]
2014
GENOME_RELEASES = ["2.1", "2.1.1"]
2115

22-
EXOME_META_DATES = [
23-
"2018-03-29",
24-
"2018-03-30",
25-
"2018-04-03",
26-
"2018-04-10",
27-
"2018-04-11",
28-
"2018-04-12",
29-
"2018-04-13",
30-
"2018-04-18",
31-
"2018-04-19",
32-
"2018-04-25",
33-
"2018-05-11",
34-
"2018-06-08",
35-
"2018-06-10",
36-
"2018-08-04",
37-
"2018-08-16",
38-
"2018-09-12",
39-
"2018-10-10",
40-
"2018-10-11",
41-
]
42-
GENOME_META_DATES = [
43-
"2018-03-29",
44-
"2018-03-30",
45-
"2018-04-03",
46-
"2018-04-10",
47-
"2018-04-11",
48-
"2018-04-12",
49-
"2018-04-13",
50-
"2018-04-18",
51-
"2018-04-19",
52-
"2018-04-25",
53-
"2018-05-11",
54-
"2018-06-08",
55-
"2018-06-10",
56-
"2018-08-04",
57-
"2018-08-16",
58-
"2018-09-12",
59-
"2018-10-10",
60-
"2018-10-11",
61-
]
62-
63-
EXOME_FAM_DATES = [
64-
"2017-10-03",
65-
"2018-04-09",
66-
"2018-04-12",
67-
"2018-04-12.true_trios",
68-
]
69-
GEOME_FAM_DATES = [
70-
"2017-10-03",
71-
"2018-04-09",
72-
"2018-04-12",
73-
"2018-04-12.true_trios",
74-
]
75-
7616
SUBPOPS = {
7717
"NFE": ["BGR", "EST", "NWE", "SEU", "SWE", "ONF"],
7818
"EAS": ["KOR", "JPN", "OEA"],
@@ -152,30 +92,6 @@ def _public_pca_ht_path(subpop: str) -> str:
15292
return f"gs://gnomad-public/release/2.1/pca/gnomad.r2.1.pca_loadings{subpop}.ht"
15393

15494

155-
def _metadata_ht_path(data_type: str, date: str) -> str:
156-
"""
157-
Metadata ht path for supplied date
158-
159-
:param data_type: One of "exomes" or "genomes"
160-
:param date: One of the dates in data_types meta date array
161-
:return: Path to metadata
162-
"""
163-
return f"gs://gnomad/metadata/{data_type}/gnomad.{data_type}.metadata.{date}.ht"
164-
165-
166-
def _fam_path(data_type: str, date: str, true_trios: bool = False) -> str:
167-
"""
168-
Pedigree path for supplied date
169-
170-
:param data_type: One of "exomes" or "genomes"
171-
:param date: Date from fam file generation
172-
:param true_trios: Whether to include only true trios
173-
:return:
174-
"""
175-
true_trios = ".true_trios" if true_trios else ""
176-
return f"gs://gnomad/metadata/{data_type}/gnomad.{data_type}.metadata.{date}{true_trios}.ht"
177-
178-
17995
def _liftover_data_path(data_type: str, version: str) -> str:
18096
"""
18197
Paths to liftover gnomAD Table
@@ -286,45 +202,3 @@ def release_vcf_path(data_type: str, version: str, contig: str) -> str:
286202
"""
287203
contig = f".{contig}" if contig else ""
288204
return f"gs://gnomad-public/release/{version}/vcf/{data_type}/gnomad.{data_type}.r{version}.sites{contig}.vcf.bgz"
289-
290-
291-
def metadata(data_type: str) -> VersionedTableResource:
292-
"""
293-
Sample metadata associated with gnomAD release
294-
295-
:param data_type: One of "exomes" or "genomes"
296-
:return: Versioned metadata Tables
297-
"""
298-
if data_type not in DATA_TYPES:
299-
raise DataException(f'{data_type} not in {DATA_TYPES}')
300-
301-
if data_type == "exomes":
302-
current_meta = CURRENT_EXOME_META
303-
dates = EXOME_META_DATES
304-
else:
305-
current_meta = CURRENT_GENOME_META
306-
dates = GENOME_META_DATES
307-
308-
return VersionedTableResource(
309-
current_meta,
310-
{date: TableResource(path=_metadata_ht_path(data_type, date)) for date in dates},
311-
)
312-
313-
314-
def fam(data_type: str, true_trios: bool = False) -> PedigreeResource:
315-
"""
316-
Returns the path to gnomAD pedigree file.
317-
318-
:param data_type: One of 'exomes' or 'genomes'
319-
:param true_trios: If set, removes all families with more than one offspring
320-
:return: Path to fam file
321-
"""
322-
if data_type not in DATA_TYPES:
323-
raise DataException(f'{data_type} not in {DATA_TYPES}')
324-
325-
if data_type == "exomes":
326-
current_fam = CURRENT_EXOME_FAM
327-
else:
328-
current_fam = CURRENT_GENOME_FAM
329-
330-
return PedigreeResource(path=_fam_path(data_type, current_fam, true_trios))

gnomad_hail/resources/grch37/gnomad_annotations.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)