Commit c00fe9ef authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1147-message-in-copasi-in-importing-sbml-map-exported-from-gpml' into 'master'

Resolve "message in COPASI in importing SBML map exported from GPML"

Closes #1147

See merge request !1105
parents b02c2f06 4ba641a4
Pipeline #24149 passed with stage
in 13 minutes and 38 seconds
minerva (15.0.0~beta.2) stable; urgency=medium
minerva (15.0.0~beta.3) unstable; urgency=medium
* Improvement: API allows to merge files (#1208)
* Bug fix: exported SBML was not compliant with the standard when element
name was empty (#1147)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 1 Apr 2020 14:00:00 +0200
minerva (15.0.0~beta.2) unstable; urgency=medium
* Small Improvement: SBO annotation support added (#1194)
* Small Improvement: additional annotation uri qualifiers added: hasProperty,
isPropertyOf (#1193)
......@@ -39,14 +45,14 @@ minerva (15.0.0~beta.2) stable; urgency=medium
-- Piotr Gawron <piotr.gawron@uni.lu> Tue, 31 Mar 2020 14:00:00 +0200
minerva (15.0.0~beta.1) stable; urgency=medium
minerva (15.0.0~beta.1) unstable; urgency=medium
* Bug fix: conflict on libraries caused some features to stop working in
production (like parsing text notes of species, regresion in
15.0.0~alpha.1, #1139)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 26 Feb 2020 13:00:00 +0200
minerva (15.0.0~beta.0) stable; urgency=medium
minerva (15.0.0~beta.0) unstable; urgency=medium
* Feature removal: old connection to CTD is removed and replaced with
new Data-API interface that closely check license compliance
* Feature removal: some custom fields (like transparency zoom level) are not
......@@ -71,7 +77,7 @@ minerva (15.0.0~beta.0) stable; urgency=medium
-- Piotr Gawron <piotr.gawron@uni.lu> Tue, 28 Jan 2020 13:00:00 +0200
minerva (15.0.0~alpha.2) stable; urgency=medium
minerva (15.0.0~alpha.2) unstable; urgency=medium
* Feature removal: old connection to DrugBank is removed and replaced with
new Data-API interface that closely check license compliance
* Small improvement: when typing drug, list of autocomplete drugs should be
......@@ -89,7 +95,7 @@ minerva (15.0.0~alpha.2) stable; urgency=medium
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 22 Jan 2020 13:00:00 +0200
minerva (15.0.0~alpha.1) stable; urgency=medium
minerva (15.0.0~alpha.1) unstable; urgency=medium
* Feature removal: when uploading complex map with submap there is no
possibility to change submap name (#947)
* Improvement: support for rendering colors in SBGNML added (#1009)
......@@ -128,7 +134,7 @@ minerva (15.0.0~alpha.1) stable; urgency=medium
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 15 Nov 2019 9:00:00 +0200
minerva (15.0.0~alpha.0) stable; urgency=medium
minerva (15.0.0~alpha.0) unstable; urgency=medium
* Improvement: logs provided for validation data model are structurized (#325)
* Improvement: import/export of GPML implemented
* Small improvement: compartments in not layouted SBML file are more
......
......@@ -8,6 +8,8 @@ import org.sbml.jsbml.Model;
import org.sbml.jsbml.ext.layout.*;
import org.sbml.jsbml.ext.render.*;
import lcsb.mapviewer.model.LogMarker;
import lcsb.mapviewer.model.ProjectLogEntryType;
import lcsb.mapviewer.model.map.species.Element;
public abstract class SbmlElementExporter<T extends Element, S extends org.sbml.jsbml.Symbol>
......@@ -39,7 +41,13 @@ public abstract class SbmlElementExporter<T extends Element, S extends org.sbml.
assignStyleToGlyph(speciesGlyph, style);
}
TextGlyph textGlyph = getLayout().createTextGlyph("text_" + getElementId(element), element.getName());
String name = element.getName();
if (name.equals("")) {
logger.warn(new LogMarker(ProjectLogEntryType.EXPORT_ISSUE, element), "Empty text label is not valid in SBML");
name = " ";
}
TextGlyph textGlyph = getLayout().createTextGlyph("text_" + getElementId(element), name);
double width = element.getWidth();
double height = element.getHeight();
double x = element.getNamePoint().getX() - width / 2;
......
......@@ -20,26 +20,36 @@ import lcsb.mapviewer.model.map.species.Species;
public class GeneratedSbmlValidationTests extends SbmlTestFunctions {
Logger logger = LogManager.getLogger();
Model model ;
Model model;
public GeneratedSbmlValidationTests(Model model, String name) {
this.model= model;
this.model = model;
}
@Parameters(name = "{index}: {1}")
public static Collection<Object[]> data() throws Exception {
List<Object[]> result = new ArrayList<>();
result.add(createRow( createModelWithSingleSpecies() ));
result.add(createRow(createModelWithSingleSpecies()));
result.add(createRow(createModelWithEmptySpeciesName()));
return result;
}
private static Model createModelWithEmptySpeciesName() throws Exception {
Model model = createModelWithSingleSpecies();
model.setName("Species without name");
model.getElements().iterator().next().setName("");
return model;
}
private static Object[] createRow(Model model) {
new ZIndexPopulator().populateZIndex(model);
return new Object[] {model, model.getName()};
return new Object[] { model, model.getName() };
}
private static Model createModelWithSingleSpecies() throws Exception {
Model model = new ModelFullIndexed(null);
model.setIdModel("unk");
model.setName("Single species");
Species species = new GenericProtein("id");
species.setBoundaryCondition(null);
......@@ -50,7 +60,7 @@ public class GeneratedSbmlValidationTests extends SbmlTestFunctions {
new ApplySimpleLayoutModelCommand(model).execute();
return model;
}
@Test
public void testIsValidSbml() throws Exception {
SbmlParser parser = new SbmlParser();
......
......@@ -70,6 +70,7 @@ public class SbmlTestFunctions {
protected static Compartment createCompartment() {
Compartment result = new Compartment("c" + (identifierCounter++));
result.setName("comp name");
result.setZ(124);
result.setX(10);
result.setY(10);
......
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