ModelPolisher icon indicating copy to clipboard operation
ModelPolisher copied to clipboard

2.1 regression introduces invalid compartment and parameter references

Open Schmoho opened this issue 1 year ago • 0 comments

This occurs on model https://www.ebi.ac.uk/biomodels/BIOMD0000000807

The error is very serious since it changes the mathematical interpretation of the model.

This method https://github.com/draeger-lab/ModelPolisher/blob/113b46764b2df15a0333e6a1244fa1215cee7c39/lib/src/main/java/de/uni_halle/informatik/biodata/mp/polishing/SpeciesPolisher.java#L84-L103

has two errors:

  1. It interprets the species ids normalized_cancer_cell_a, normalized_cancer_cell_n and normalized_cancer_cell_g as BiGG IDs and tries to create compartments a, n and g. This behaviour was preexisting. However, this is actually unwanted here, as the IDs do not in fact represent BiGG IDs.

i.e.

<species compartment="compartment" id="normalized_cancer_cell_a" [...]>
	 [...]
</species>

becomes

<species compartment="a" id="normalized_cancer_cell_a" [...]>
	 [...]
</species>
  1. Since a global parameter with id a exists on the model, the method changes its id to a_non_compartment, but references to the parameter in variable attributes on assignmentRules are not updated. This behaviour is reckless and a regression that I introduced in the 2.1 branch.

i.e.

<parameter constant="false" id="a" metaid="COPASI32" name="a'" value="0">
        [...]
</parameter>

becomes

<parameter constant="false" id="a_non_compartment" metaid="COPASI32" name="a'" value="0">
        [...]
</parameter>

So two fixes are required here:

  1. we need to do better in detecting BiGG IDs
  2. we cannot change the IDs of non-compartment objects if a new compartment is created from a BiGG ID, but need to adapt the name of the new compartment instead

Schmoho avatar Dec 01 '24 14:12 Schmoho