gyorilab / mira

MIRA modeling framework
BSD 2-Clause "Simplified" License
9 stars 7 forks source link

Add support for sbml qual models #328

Closed nanglo123 closed 4 months ago

nanglo123 commented 5 months ago

This PR adds support for SBML Qual documents and turns them into semantically equivalent MIRA template models.

Models derived from SBML Qual documents do have an empty parameters, compartments, and unit_definitions attribute. There is now an API for extracting template models from SBML Qual documents which has been added to the documentation and two smoke tests have been added to ensure that we can extract a template model from Qual documents found here: https://git-r3lab.uni.lu/covid/models/-/tree/master/Executable%20Modules/SBML_qual_build/sbml?ref_type=heads and to also extract template models from biomodels: BIOMD0000000562, BIOMD0000000592, and BIOMD0000000593. A script has been added as well to retrieve all the sbml qual documents from the covid-19 disease map and to convert them to regnet amrs.

This PR also changes the way in which we export regnet amrs. We now process each upstream controller present in a grouped type template and create an edge for each of them. To account for the duplication of rates that would occur when we process all upstream controllers, we set the expression for any subsequent rate added to the regnet amr processed from the same transition to 0 after the first one has been added. Affected regnet amrs from evaluation_2024.03 and hackathon_2024.02 due ot this change have been regenerated as well.

Additionally shared functionality for processing SBML and SBML Qual documents have been added to a utils.py file in the sbml directory.