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
* Backward incompatibility: debian package cannot be upgraded from version
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: missing info about species for SBML parsing warning
(#1472)
......
......@@ -26,8 +26,7 @@ import lcsb.mapviewer.model.map.species.field.*;
import lcsb.mapviewer.modelutils.map.ElementUtils;
public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species> {
private static String ARTIFITIAL_SINK_ID = "sbml_artifitial_sink";
private static String ARTIFITIAL_SOURCE_ID = "sbml_artifitial_source";
private static String ARTIFITIAL_ID = "sbml_artifitial_";
Logger logger = LogManager.getLogger();
Map<String, String> structuralStateIdMap = new HashMap<>();
......@@ -433,8 +432,7 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species>
speciesId = ((org.sbml.jsbml.Species) getLayout().getSpeciesGlyph(element.getElementId()).getSpeciesInstance())
.getId();
} else {
if (!element.getElementId().equals(ARTIFITIAL_SINK_ID)
&& !element.getElementId().equals(ARTIFITIAL_SOURCE_ID)) {
if (!element.getElementId().startsWith(ARTIFITIAL_ID)) {
compartmentId = getSbmlModel().getSpecies(element.getElementId()).getCompartment();
}
}
......@@ -547,22 +545,16 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species>
}
public Species getArtifitialInput() {
Species result = getMinervaModel().getElementByElementId(ARTIFITIAL_SOURCE_ID);
if (result == null) {
result = new Unknown(ARTIFITIAL_SOURCE_ID);
result.setName("Artifitial source");
getMinervaModel().addElement(result);
}
Species result = new Unknown(ARTIFITIAL_ID + getNextId());
result.setName("Artifitial source");
getMinervaModel().addElement(result);
return result;
}
public Species getArtifitialOutput() {
Species result = getMinervaModel().getElementByElementId(ARTIFITIAL_SINK_ID);
if (result == null) {
result = new Degraded(ARTIFITIAL_SINK_ID);
result.setName("Artifitial sink");
getMinervaModel().addElement(result);
}
Species result = new Degraded(ARTIFITIAL_ID + getNextId());
result.setName("Artifitial sink");
getMinervaModel().addElement(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