Skip to content

Commit

Permalink
Merge pull request #284 from gyorilab/sif_dm
Browse files Browse the repository at this point in the history
Add Regnet AMR export of COVID-19 Disease Map
  • Loading branch information
bgyori authored Feb 21, 2024
2 parents ef82a63 + c2c0251 commit 0f3d13b
Show file tree
Hide file tree
Showing 24 changed files with 37,145 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mira/modeling/amr/regnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def __init__(self, model: Model):
self.transitions.append(transition_dict)

for key, param in model.parameters.items():
if param.placeholder:
continue
param_dict = {'id': str(key)}
if param.value:
param_dict['value'] = param.value
Expand Down
12 changes: 11 additions & 1 deletion scripts/covid19_diseasemaps/process_covid19_diseasemaps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import tqdm
from mira.metamodel import Annotations
from mira.modeling.amr.regnet import template_model_to_regnet_json
from mira.sources.sif import template_model_from_sif_url

Expand All @@ -20,6 +21,15 @@
for model in tqdm.tqdm(models):
url = f'{SIF_URL_BASE}/{model}_stable.sif'
tm = template_model_from_sif_url(url)
tm.annotations = Annotations(
name=model,
description=("A submodel of the COVID-10 Disease Map "
f"focusing on {model}"),
pathogens=["ncbitaxon:2697049"],
diseases=["doid:0080600"],
hosts=["ncbitaxon:9606"],
references=["pubmed:34664389"]
)
regnet = template_model_to_regnet_json(tm)
with open(f'{model}.json', 'w') as fh:
with open(f'regnet_amr/{model}.json', 'w') as fh:
json.dump(regnet, fh, indent=1)
Loading

0 comments on commit 0f3d13b

Please sign in to comment.