Skip to content

Commit 5fe2352

Browse files
authored
add new clinvar pathogenicity and contig filter workaround (#713)
* add new clinvar pathogenicity and contig filter workaround * remove filter * tables * change filtering
1 parent cae8023 commit 5fe2352

40 files changed

+24
-7
lines changed

v03_pipeline/lib/annotations/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
CLINVAR_PATHOGENICITIES = [
199199
'Pathogenic',
200200
'Pathogenic/Likely_pathogenic',
201+
'Pathogenic/Likely_pathogenic/Established_risk_allele',
201202
'Pathogenic/Likely_pathogenic/Likely_risk_allele',
202203
'Pathogenic/Likely_risk_allele',
203204
'Likely_pathogenic',

v03_pipeline/lib/reference_data/clinvar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def parsed_clnsig(ht: hl.Table):
6464
'Likely_pathogenic,_low_penetrance',
6565
'Likely_pathogenic|low_penetrance',
6666
)
67+
.replace(
68+
'/Pathogenic,_low_penetrance/Established_risk_allele',
69+
'/Established_risk_allele|low_penetrance',
70+
)
6771
.replace(
6872
'/Pathogenic,_low_penetrance',
6973
'|low_penetrance',

v03_pipeline/lib/reference_data/clinvar_test.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ def test_parsed_clnsig(self):
3131
},
3232
{'info': hl.Struct(CLNSIG=['Likely_pathogenic', '_low_penetrance'])},
3333
{'info': hl.Struct(CLNSIG=['association|protective'])},
34+
{
35+
'info': hl.Struct(
36+
CLNSIG=[
37+
'Pathogenic/Likely_pathogenic/Pathogenic',
38+
'_low_penetrance/Established_risk_allele',
39+
],
40+
),
41+
},
3442
],
3543
hl.tstruct(info=hl.tstruct(CLNSIG=hl.tarray(hl.tstr))),
3644
)
@@ -42,6 +50,10 @@ def test_parsed_clnsig(self):
4250
['Likely_pathogenic', 'low_penetrance', 'association', 'protective'],
4351
['Likely_pathogenic', 'low_penetrance'],
4452
['association', 'protective'],
53+
[
54+
'Pathogenic/Likely_pathogenic/Established_risk_allele',
55+
'low_penetrance',
56+
],
4557
],
4658
)
4759

@@ -66,8 +78,8 @@ def test_parsed_and_mapped_clnsigconf(self):
6678
None,
6779
[
6880
hl.Struct(count=9, pathogenicity_id=0),
69-
hl.Struct(count=2, pathogenicity_id=4),
70-
hl.Struct(count=1, pathogenicity_id=11),
81+
hl.Struct(count=2, pathogenicity_id=5),
82+
hl.Struct(count=1, pathogenicity_id=12),
7183
],
7284
],
7385
)

v03_pipeline/lib/reference_data/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def custom_mpc_select(ht):
192192
'pathogenicity': CLINVAR_PATHOGENICITIES,
193193
'assertion': CLINVAR_ASSERTIONS,
194194
},
195-
'filter': lambda ht: ht.locus.contig != 'MT',
195+
'filter': lambda ht: ~(ht.locus.contig == 'MT'),
196196
},
197197
'38': {
198198
'custom_import': download_and_import_latest_clinvar_vcf,
@@ -203,7 +203,7 @@ def custom_mpc_select(ht):
203203
'pathogenicity': CLINVAR_PATHOGENICITIES,
204204
'assertion': CLINVAR_ASSERTIONS,
205205
},
206-
'filter': lambda ht: ht.locus.contig != 'chrM',
206+
'filter': lambda ht: ~(ht.locus.contig == 'chrM'),
207207
},
208208
},
209209
'dbnsfp': {
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
This folder comprises a Hail (www.hail.is) native Table or MatrixTable.
22
Written with version 0.2.128-eead8100a1c1
3-
Created at 2024/02/28 14:36:31
3+
Created at 2024/03/01 15:52:48
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)