Skip to content
Snippets Groups Projects
Commit 9c622782 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '2194-bug-in-sbgn-ml-export-empty-sets-are-exported-with-a-label' into 'master'

Resolve "bug in SBGN-ML export: empty sets are exported with a label"

See merge request !1859
parents f2bd1f87 17fe5965
No related branches found
No related tags found
2 merge requests!1871Resolve "problem with websocket connection",!1859Resolve "bug in SBGN-ML export: empty sets are exported with a label"
Pipeline #100825 failed
......@@ -12,6 +12,8 @@ minerva (18.1.0) stable; urgency=medium
separated using compartment (#2169)
* Bug fix: exporting model should provide deterministic output for species and
compartments (#2187)
* Bug fix: exporting degraded to SBGN-ML should not produce a label for it
(#2194)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 19 Dec 2024 13:00:00 +0200
......
......@@ -615,6 +615,9 @@ public class SbgnmlXmlExporter {
* @return label for a glyph
*/
private Label getGlyphLabelFromAlias(final Element element) {
if (element instanceof Degraded) {
return null;
}
final Label label = new Label();
label.setText(element.getName());
final Bbox box = new Bbox();
......
......@@ -17,6 +17,7 @@ import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.compartment.SquareCompartment;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.species.Complex;
import lcsb.mapviewer.model.map.species.Degraded;
import lcsb.mapviewer.model.map.species.Drug;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.GenericProtein;
......@@ -74,6 +75,14 @@ public class SbgnmlTestFunctions extends TestUtils {
return protein;
}
protected Degraded createDegraded() {
Degraded degraded = new Degraded("id" + (counter++));
assignLayout(degraded);
degraded.setWidth(degraded.getHeight());
degraded.setNameWidth(degraded.getHeight());
return degraded;
}
protected Compartment createCompartment() {
SquareCompartment compartment = new SquareCompartment("id" + (counter++));
assignLayout(compartment);
......
......@@ -12,6 +12,7 @@ import lcsb.mapviewer.model.map.reaction.Reactant;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.reaction.type.ModifierReactionNotation;
import lcsb.mapviewer.model.map.reaction.type.ReducedNotation;
import lcsb.mapviewer.model.map.species.Degraded;
import lcsb.mapviewer.model.map.species.Drug;
import lcsb.mapviewer.model.map.species.GenericProtein;
import lcsb.mapviewer.model.map.species.Ion;
......@@ -191,4 +192,16 @@ public class SbgnmlXmlExporterTest extends SbgnmlTestFunctions {
assertEquals(0, new ModelComparator().compare(model, model2));
}
@Test
public void importExportDegraded() throws Exception {
Degraded degraded = createDegraded();
Model model = new ModelFullIndexed(null);
model.setWidth(2000);
model.setHeight(2000);
model.addElement(degraded);
serializeAndCleanOverSbgn(model);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment