Sources of model content

Sources of models.

ASKEM AMR (mira.sources.askenet)

model_from_url(url)[source]

Return a model from a URL, handling multiple frameworks.

Parameters:

url – The URL to the JSON file.

Returns:

A TemplateModel object.

model_from_json_file(fname)[source]

Return a model from a file, handling multiple frameworks.

Parameters:

fname – The path to the JSON file.

Returns:

A TemplateModel object.

ASKEM AMR Petri nets (mira.sources.askenet.petrinet)

This module implements parsing Petri net models defined in https://github.com/DARPA-ASKEM/Model-Representations/tree/main/petrinet.

MIRA TemplateModel representation limitations to keep in mind:

  • Model version not supported

  • Model schema not supported

  • Initials only have a value, cannot be expressions so information on initial condition parameter relationship is lost

model_from_url(url)[source]

Return a model from a URL

Parameters:

url (str) – The URL to the JSON file.

Return type:

TemplateModel

Returns:

A TemplateModel object.

model_from_json_file(fname)[source]

Return a model from a JSON file.

Parameters:

fname (str) – The path to the JSON file.

Return type:

TemplateModel

Returns:

A TemplateModel object.

template_model_from_askenet_json(model_json)[source]

Return a model from a JSON object.

Parameters:

model_json – The JSON object.

Return type:

TemplateModel

Returns:

A TemplateModel object.

ASKEM AMR Regulatory nets (mira.sources.askenet.regnet)

Reconstruct ODE semantics (mira.sources.askenet.flux_span)

This module implements handling flux span model representations that are the result of stratification and map back to original models before stratification.

reproduce_ode_semantics(flux_span)[source]

Reproduce ODE semantics from a stratified model (flux span).

SBML extraction (mira.sources.sbml)

template_model_from_sbml_file(file_path, *, model_id=None, reporter_ids=None)[source]

Extract a MIRA template model from a file containing SBML XML.

Return type:

TemplateModel

template_model_from_sbml_file_obj(file, *, model_id=None, reporter_ids=None)[source]

Extract a MIRA template model from a file object containing SBML XML.

Return type:

TemplateModel

template_model_from_sbml_string(s, *, model_id=None, reporter_ids=None)[source]

Extract a MIRA template model from a string representing SBML XML.

Return type:

TemplateModel

template_model_from_sbml_model(sbml_model, *, model_id=None, reporter_ids=None)[source]

Extract a MIRA template model from an SBML model object.

Return type:

TemplateModel

sbml_model_from_file(fname)[source]

Return an SBML model object from an SBML file.

BioModels client (mira.sources.biomodels)

The BioModels database lists several high quality models at https://www.ebi.ac.uk/biomodels/covid-19.

NON_COVID_EPI_MODELS = {'BIOMD0000000249', 'BIOMD0000000294', 'BIOMD0000000715', 'BIOMD0000000716', 'BIOMD0000000717', 'BIOMD0000000726', 'BIOMD0000000922', 'BIOMD0000000949', 'BIOMD0000000950', 'BIOMD0000001045', 'MODEL1008060000', 'MODEL1008060002', 'MODEL1805220001', 'MODEL1805230001', 'MODEL1808280006', 'MODEL1808280011', 'MODEL2212310001'}

Additional model identifiers for epidemiology models that do not appear in the BioModels curated list of COVID-19 models

MODEL_TO_PUBMED = {'BIOMD0000000716': '30839942', 'BIOMD0000000717': '30839942'}

Annotation of missing pubmeds to model ids

query_biomodels(query='submitter_keywords:COVID-19', limit=30)[source]

Query and paginate over results from the BioModels API.

get_sbml_model(model_id)[source]

Return the SBML string content for a BioModels model from the web.

Parameters:

model_id (str) – The BioModels ID of the model.

Return type:

str

Returns:

The SBML XML string corresponding to the model.

get_template_model(model_id)[source]

Return the Template Model processed from a BioModels model from the web.

Parameters:

model_id (str) – The BioModels ID of the model.

Return type:

TemplateModel

Returns:

The Template model corresponding to the BioModels model.

main()[source]

Iterate over COVID-19 models and parse them.

Bilayer extraction (mira.sources.bilayer)

This module implements an input processor for bilayer representations of models based on mass-action kinetics.

template_model_from_bilayer_file(fname)[source]

Return a TemplateModel by processing a bilayer JSON file.

Parameters:

fname (str) – The path to a bilayer JSON file.

Return type:

TemplateModel

Returns:

A TemplateModel extracted from the bilayer.

template_model_from_bilayer(bilayer_json)[source]

Return a TemplateModel by processing a bilayer JSON file.

Parameters:

bilayer_json (dict) – A bilayer JSON structure.

Return type:

TemplateModel

Returns:

A TemplateModel extracted from the bilayer.

ACSets Petri Net extraction (mira.sources.petri)

template_model_from_petri_json(petri_json)[source]

Return a TemplateModel by processing a Petri net JSON dict

Parameters:

petri_json (dict) – A Petri net JSON structure.

Return type:

TemplateModel

Returns:

A TemplateModel extracted from the Petri net.