Commit 14497a71 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1475-sbml-conversion-individual-source-sink-objects-for-all-reactions' into 'master'

Resolve "SBML conversion: individual source/sink objects for all reactions"

Closes #1475

See merge request !1295
parents 2dcc5326 1d423443
Pipeline #40065 canceled with stage
in 17 minutes and 43 seconds
minerva (16.0.0~alpha.2) stable; urgency=medium minerva (16.0.0~alpha.2) stable; urgency=medium
* Backward incompatibility: debian package cannot be upgraded from version * Backward incompatibility: debian package cannot be upgraded from version
prior to 12.1.0 (#1464) prior to 12.1.0 (#1464)
* Small improvement: artifitial source and sink is created separately for
each uncomplete reaction (#1475)
* Small improvement: homomultimer information is provided in API (#1468) * Small improvement: homomultimer information is provided in API (#1468)
* Small improvement: missing info about species for SBML parsing warning * Small improvement: missing info about species for SBML parsing warning
(#1472) (#1472)
......
...@@ -26,8 +26,7 @@ import lcsb.mapviewer.model.map.species.field.*; ...@@ -26,8 +26,7 @@ import lcsb.mapviewer.model.map.species.field.*;
import lcsb.mapviewer.modelutils.map.ElementUtils; import lcsb.mapviewer.modelutils.map.ElementUtils;
public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species> { public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species> {
private static String ARTIFITIAL_SINK_ID = "sbml_artifitial_sink"; private static String ARTIFITIAL_ID = "sbml_artifitial_";
private static String ARTIFITIAL_SOURCE_ID = "sbml_artifitial_source";
Logger logger = LogManager.getLogger(); Logger logger = LogManager.getLogger();
Map<String, String> structuralStateIdMap = new HashMap<>(); Map<String, String> structuralStateIdMap = new HashMap<>();
...@@ -433,8 +432,7 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species> ...@@ -433,8 +432,7 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species>
speciesId = ((org.sbml.jsbml.Species) getLayout().getSpeciesGlyph(element.getElementId()).getSpeciesInstance()) speciesId = ((org.sbml.jsbml.Species) getLayout().getSpeciesGlyph(element.getElementId()).getSpeciesInstance())
.getId(); .getId();
} else { } else {
if (!element.getElementId().equals(ARTIFITIAL_SINK_ID) if (!element.getElementId().startsWith(ARTIFITIAL_ID)) {
&& !element.getElementId().equals(ARTIFITIAL_SOURCE_ID)) {
compartmentId = getSbmlModel().getSpecies(element.getElementId()).getCompartment(); compartmentId = getSbmlModel().getSpecies(element.getElementId()).getCompartment();
} }
} }
...@@ -547,22 +545,16 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species> ...@@ -547,22 +545,16 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species>
} }
public Species getArtifitialInput() { public Species getArtifitialInput() {
Species result = getMinervaModel().getElementByElementId(ARTIFITIAL_SOURCE_ID); Species result = new Unknown(ARTIFITIAL_ID + getNextId());
if (result == null) { result.setName("Artifitial source");
result = new Unknown(ARTIFITIAL_SOURCE_ID); getMinervaModel().addElement(result);
result.setName("Artifitial source");
getMinervaModel().addElement(result);
}
return result; return result;
} }
public Species getArtifitialOutput() { public Species getArtifitialOutput() {
Species result = getMinervaModel().getElementByElementId(ARTIFITIAL_SINK_ID); Species result = new Degraded(ARTIFITIAL_ID + getNextId());
if (result == null) { result.setName("Artifitial sink");
result = new Degraded(ARTIFITIAL_SINK_ID); getMinervaModel().addElement(result);
result.setName("Artifitial sink");
getMinervaModel().addElement(result);
}
return result; return result;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment