Skip to content

Commit ffdb18d

Browse files
authored
Merge pull request #710 from broadinstitute/dev
main <- dev
2 parents 46e81af + a3f9cdd commit ffdb18d

File tree

94 files changed

+537
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+537
-153
lines changed

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
python -m pip install --upgrade pip
3131
pip install -r requirements.txt
3232
pip install -r requirements-dev.txt
33+
- name: Check Ruff Format
34+
run: ruff format --check v03_pipeline --diff
3335
- name: Check Ruff
3436
run: ruff . --output-format github
3537
- name: Unit Tests

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ idna==3.6
3838
# requests
3939
imagesize==1.4.1
4040
# via sphinx
41-
jinja2==3.1.2
41+
jinja2==3.1.3
4242
# via
4343
# -c requirements.txt
4444
# sphinx

requirements.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
elasticsearch==7.9.1
22
google-api-python-client>=1.8.0
3-
hail==0.2.122
3+
hail==0.2.128
44
luigi>=3.4.0
55
gnomad==0.6.4
6+
google-cloud-storage>=2.14.0

requirements.txt

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ asttokens==2.4.1
1616
# via stack-data
1717
async-timeout==4.0.3
1818
# via aiohttp
19-
asyncinit==0.2.4
20-
# via hail
2119
attrs==23.1.0
2220
# via aiohttp
2321
avro==1.11.3
@@ -119,19 +117,19 @@ google-auth-httplib2==0.1.1
119117
# via google-api-python-client
120118
google-auth-oauthlib==0.8.0
121119
# via hail
122-
google-cloud-core==2.3.3
120+
google-cloud-core==2.4.1
123121
# via google-cloud-storage
124-
google-cloud-storage==2.13.0
125-
# via hail
122+
google-cloud-storage==2.14.0
123+
# via -r requirements.in
126124
google-crc32c==1.5.0
127125
# via
128126
# google-cloud-storage
129127
# google-resumable-media
130-
google-resumable-media==2.6.0
128+
google-resumable-media==2.7.0
131129
# via google-cloud-storage
132130
googleapis-common-protos==1.61.0
133131
# via google-api-core
134-
hail==0.2.122
132+
hail==0.2.128
135133
# via -r requirements.in
136134
hdbscan==0.8.33
137135
# via gnomad
@@ -204,7 +202,7 @@ numpy==1.26.2
204202
# scipy
205203
oauthlib==3.2.2
206204
# via requests-oauthlib
207-
orjson==3.9.15
205+
orjson==3.9.11
208206
# via hail
209207
packaging==23.2
210208
# via
@@ -254,9 +252,7 @@ pygments==2.17.2
254252
# ipython
255253
# rich
256254
pyjwt[crypto]==2.8.0
257-
# via
258-
# msal
259-
# pyjwt
255+
# via msal
260256
pyparsing==3.1.1
261257
# via httplib2
262258
pyspark==3.3.3

v03_pipeline/lib/annotations/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
'Likely_pathogenic/Likely_risk_allele',
205205
'Established_risk_allele',
206206
'Likely_risk_allele',
207-
'Conflicting_interpretations_of_pathogenicity',
207+
'Conflicting_classifications_of_pathogenicity',
208208
'Uncertain_risk_allele',
209209
'Uncertain_significance/Uncertain_risk_allele',
210210
'Uncertain_significance',

v03_pipeline/lib/annotations/fields_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ def setUp(self) -> None:
3131
),
3232
)
3333

34+
@patch('v03_pipeline.lib.vep.validate_vep_config_reference_genome')
3435
@patch('v03_pipeline.lib.vep.hl.vep')
35-
def test_get_formatting_fields(self, mock_vep: Mock) -> None:
36+
def test_get_formatting_fields(self, mock_vep: Mock, mock_validate: Mock) -> None:
3637
ht = hl.read_table(TEST_COMBINED_1)
3738
mock_vep.return_value = ht.annotate(vep=MOCK_VEP_DATA)
39+
mock_validate.return_value = None
3840
ht = run_vep(
3941
ht,
4042
DatasetType.SNV_INDEL,
43+
ReferenceGenome.GRCh38,
4144
None,
4245
)
4346
ht = ht.annotate(rsid='abcd')

v03_pipeline/lib/annotations/mito.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def HL(mt: hl.MatrixTable, **_: Any) -> hl.Expression: # noqa: N802
4444
return hl.if_else(is_called, mt.HL, 0)
4545

4646

47-
def high_constraint_region(
47+
def high_constraint_region_mito(
4848
ht: hl.Table,
4949
interval_ht: hl.Table,
5050
**_: Any,

v03_pipeline/lib/annotations/shared_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010

1111

1212
class SharedAnnotationsTest(unittest.TestCase):
13+
@patch('v03_pipeline.lib.vep.validate_vep_config_reference_genome')
1314
@patch('v03_pipeline.lib.vep.hl.vep')
14-
def test_sorted_transcript_consequences(self, mock_vep: Mock) -> None:
15+
def test_sorted_transcript_consequences(
16+
self,
17+
mock_vep: Mock,
18+
mock_validate: Mock,
19+
) -> None:
1520
ht = hl.Table.parallelize(
1621
[
1722
{
@@ -30,9 +35,11 @@ def test_sorted_transcript_consequences(self, mock_vep: Mock) -> None:
3035
key=['locus', 'alleles'],
3136
)
3237
mock_vep.return_value = ht.annotate(vep=MOCK_VEP_DATA)
38+
mock_validate.return_value = None
3339
ht = run_vep(
3440
ht,
3541
DatasetType.SNV_INDEL,
42+
ReferenceGenome.GRCh38,
3643
None,
3744
)
3845
ht = ht.select(

v03_pipeline/lib/logger.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import logging.config
2+
3+
LOG_CONFIG = {
4+
'version': 1,
5+
'disable_existing_loggers': False,
6+
'propagate': True,
7+
'formatters': {
8+
'default': {
9+
'format': '%(asctime)s - %(module)s - %(levelname)s - %(message)s',
10+
'datefmt': '%Y-%m-%d %H:%M:%S',
11+
},
12+
},
13+
'handlers': {
14+
'default': {
15+
'formatter': 'default',
16+
'class': 'logging.StreamHandler',
17+
},
18+
},
19+
'loggers': {
20+
'': {
21+
'level': 'INFO',
22+
'handlers': ['default'],
23+
'propagate': True,
24+
},
25+
'py4j': {
26+
'level': 'CRITICAL',
27+
},
28+
'urllib3': {
29+
'level': 'CRITICAL',
30+
},
31+
},
32+
}
33+
34+
_CONFIGURED = False
35+
36+
37+
def get_logger(name: str):
38+
global _CONFIGURED # noqa: PLW0603
39+
if not _CONFIGURED:
40+
logging.config.dictConfig(LOG_CONFIG)
41+
_CONFIGURED = True
42+
return logging.getLogger(name)

v03_pipeline/lib/model/dataset_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def formatting_annotation_fns(
175175
DatasetType.MITO: [
176176
mito.common_low_heteroplasmy,
177177
mito.haplogroup,
178-
mito.high_constraint_region,
178+
mito.high_constraint_region_mito,
179179
mito.mitotip,
180180
mito.rsid,
181181
shared.sorted_transcript_consequences,

0 commit comments

Comments
 (0)