Skip to content

Commit c67c68f

Browse files
authored
Merge pull request #212 from monarch-initiative/develop
Develop -> Main
2 parents 620be64 + 3176b3b commit c67c68f

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

data/protected-disease-gene.tsv

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ OMIM:108770 MONDO:0007171 atrial standstill 1 digenic OMIM:600163 HGNC:10593 htt
88
OMIM:620040 MONDO:0031057 "dyskeratosis congenita, digenic" digenic OMIM:188350 HGNC:12441 https://orcid.org/0000-0002-4142-7153
99
OMIM:620040 MONDO:0031057 "dyskeratosis congenita, digenic" digenic OMIM:607427 HGNC:30365 https://orcid.org/0000-0002-4142-7153
1010
OMIM:619478 MONDO:0030355 "facioscapulohumeral muscular dystrophy 4, digenic" digenic OMIM:602900 HGNC:2979 https://orcid.org/0000-0002-4142-7153
11-
OMIM:619478 MONDO:0030355 "facioscapulohumeral muscular dystrophy 4, digenic" digenic OMIM:606009 HGNC:50800 https://orcid.org/0000-0002-4142-7153
11+
OMIM:619478 MONDO:0030355 "facioscapulohumeral muscular dystrophy 4, digenic" digenic OMIM:606009 HGNC:50800 https://orcid.org/0000-0002-4142-7153
12+
OMIM:614102 MONDO:0013576 "recurrent infections associated with rare immunoglobulin isotypes deficiency" immunoglobin OMIM:147200 HGNC:5716 https://orcid.org/0000-0002-3458-4839
13+
OMIM:615387 MONDO:0014160 "TCR-alpha-beta-positive T-cell deficiency" immunoglobin OMIM:186880 HGNC:12029 https://orcid.org/0000-0002-3458-4839
14+
OMIM:601495 MONDO:0020729 "autosomal recessive agammaglobulinemia 1" immunoglobin OMIM:147020 HGNC:5541 https://orcid.org/0000-0002-3458-4839

omim2obo/main.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,19 +375,23 @@ def omim2obo(use_cache: bool = False):
375375

376376
# - Add relations (subclass restrictions)
377377
exclusions_p_mim_orcid_map: Dict[str, Optional[URIRef]] = get_d2g_exclusions_by_curator()
378-
digenic_protection_gene_pheno_orcids: Dict[Tuple[str, str], Optional[URIRef]] = get_d2g_digenic_protections()
378+
protections_gene_pheno__hgnc_orcid_map: Dict[Tuple[str, str], Tuple[str, Optional[URIRef]]] = \
379+
get_d2g_digenic_protections()
379380
for p_mim, assocs in phenotype_genes.items():
380381
for assoc in assocs:
381382
gene_mim, p_lab, p_map_key, p_map_lab = assoc['gene_id'], assoc['phenotype_label'], \
382383
assoc['mapping_key'], assoc['mapping_label']
383384
evidence = f'Evidence: ({p_map_key}) {p_map_lab}'
384385
p_mim_excluded = p_mim in exclusions_p_mim_orcid_map
385386
protected_digenic_key = (p_mim, gene_mim)
386-
protected_digenic_assoc: bool = protected_digenic_key in digenic_protection_gene_pheno_orcids
387387

388+
protected_digenic_assoc: bool = protected_digenic_key in protections_gene_pheno__hgnc_orcid_map
388389
if protected_digenic_assoc:
389-
orcid: Optional[URIRef] = digenic_protection_gene_pheno_orcids[protected_digenic_key]
390-
add_gene_disease_associations(graph, gene_mim, p_mim, evidence, orcid)
390+
hgnc_id_protected: str
391+
orcid_protected: Optional[URIRef]
392+
hgnc_id_protected, orcid_protected = protections_gene_pheno__hgnc_orcid_map[protected_digenic_key]
393+
add_gene_disease_associations(graph, gene_mim, p_mim, evidence, orcid_protected)
394+
graph.add((OMIM[gene_mim], SKOS.exactMatch, HGNC[hgnc_id_protected]))
391395
continue
392396

393397
# Skip: No phenotype or unknown defect

omim2obo/utils/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ def remove_angle_brackets(uris: Union[str, List[str]]) -> Union[str, List[str]]:
2222
return uris2[0] if str_input else uris2
2323

2424

25-
def get_d2g_digenic_protections(path=DISEASE_GENE_PROTECTED_PATH) -> Dict[Tuple[str, str], Optional[URIRef]]:
25+
def get_d2g_digenic_protections(
26+
path=DISEASE_GENE_PROTECTED_PATH
27+
) -> Dict[Tuple[str, str], Tuple[str, Optional[URIRef]]]:
2628
"""Get information for manually curated disease-gene association protections.
2729
2830
Protections are associatiosn we want to add even if they (no longer) appear in the OMIM source data.
2931
30-
:return: Dictionary with phenotype and gene MIMs as keys and ORCID of curator as values.
32+
:return: Dictionary with (phenotype MIM, gene MIM) keys and (HGNC id, curator ORCID) values.
3133
"""
3234
df = pd.read_csv(path, sep='\t').fillna('')
33-
for col in ['phenotype_mim', 'gene_mim']:
35+
for col in ['phenotype_mim', 'gene_mim', 'hgnc_id']:
3436
df[col] = df[col].apply(lambda x: x.split(':')[1])
3537
return {
36-
(x['phenotype_mim'], x['gene_mim']): ORCID[x['orcid']] if x['orcid'] else None
38+
(x['phenotype_mim'], x['gene_mim']): (x['hgnc_id'], ORCID[x['orcid']] if x['orcid'] else None)
3739
for x in df.to_dict(orient='records')
3840
}
3941

0 commit comments

Comments
 (0)