Commit 41725e7d authored by Piotr Gawron's avatar Piotr Gawron

import of complex with no border fixed

parent 221794ab
Pipeline #23754 failed with stage
in 49 minutes and 59 seconds
minerva (14.0.11) stable; urgency=medium
* Bug fix: miRTarBase was down and targetting by miRNA stopped working on new
installations (#1207)
* Bug fix: complex with no border was inproperly imported from CellDesigner
(#1198)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 30 Mar 2020 10:00:00 +0200
......
......@@ -20,6 +20,7 @@ import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelData;
import lcsb.mapviewer.model.map.species.Complex;
import lcsb.mapviewer.model.map.species.Species;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
* Parser of CellDesigner xml used for parsing complex aliases. Important: Only
......@@ -132,9 +133,13 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
if (state.equalsIgnoreCase("usual")) {
view = usualView;
} else if (state.equalsIgnoreCase("brief")) {
view = briefView;
view = usualView;
} else if (state.equalsIgnoreCase("complexnoborder")) {
view = usualView;
} else if (state.equalsIgnoreCase("complexparentbrief")) {
view = briefView;
} else {
throw new InvalidXmlSchemaException(new ElementUtils().getElementTag(result)+"Don't know how to process state: " + state);
}
if (view != null) {
......
......@@ -2,10 +2,9 @@ package lcsb.mapviewer.converter.model.celldesigner;
import static org.junit.Assert.*;
import java.awt.*;
import java.awt.Color;
import java.io.ByteArrayInputStream;
import java.util.*;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -317,4 +316,12 @@ public class ComplexParserTests extends CellDesignerTestFunctions {
testXmlSerialization(model);
}
@Test
public void testComplexNoBorder() throws Exception {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/problematic/complex_no_border.xml"));
assertTrue(model.getElementByElementId("csa1").getWidth() > 0);
testXmlSerialization(model);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" xmlns:celldesigner="http://www.sbml.org/2001/ns/celldesigner" level="2" version="4">
<model metaid="untitled" id="untitled">
<annotation>
<celldesigner:extension>
<celldesigner:modelVersion>4.0</celldesigner:modelVersion>
<celldesigner:modelDisplay sizeX="600" sizeY="400"/>
<celldesigner:listOfIncludedSpecies>
<celldesigner:species id="s2" name="s2">
<celldesigner:notes>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body/>
</html>
</celldesigner:notes>
<celldesigner:annotation>
<celldesigner:complexSpecies>s1</celldesigner:complexSpecies>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr1</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
</celldesigner:annotation>
</celldesigner:species>
</celldesigner:listOfIncludedSpecies>
<celldesigner:listOfCompartmentAliases/>
<celldesigner:listOfComplexSpeciesAliases>
<celldesigner:complexSpeciesAlias id="csa1" species="s1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="171.0" y="79.0" w="100.0" h="120.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="complexnoborder"/>
<celldesigner:backupSize w="0.0" h="0.0"/>
<celldesigner:backupView state="none"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="100.0" height="120.0"/>
<celldesigner:singleLine width="2.0"/>
<celldesigner:paint color="fff7f7f7" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="2.0"/>
<celldesigner:paint color="fff7f7f7" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:complexSpeciesAlias>
</celldesigner:listOfComplexSpeciesAliases>
<celldesigner:listOfSpeciesAliases>
<celldesigner:speciesAlias id="sa1" species="s2" complexSpeciesAlias="csa1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="183.0" y="91.0" w="80.0" h="40.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="usual"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="12.0" y="12.0"/>
<celldesigner:boxSize width="80.0" height="40.0"/>
<celldesigner:singleLine width="1.0"/>
<celldesigner:paint color="ffccffcc" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="0.0"/>
<celldesigner:paint color="3fff0000" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:speciesAlias>
</celldesigner:listOfSpeciesAliases>
<celldesigner:listOfGroups/>
<celldesigner:listOfProteins>
<celldesigner:protein id="pr1" name="s2" type="GENERIC"/>
</celldesigner:listOfProteins>
<celldesigner:listOfGenes/>
<celldesigner:listOfRNAs/>
<celldesigner:listOfAntisenseRNAs/>
<celldesigner:listOfLayers/>
<celldesigner:listOfBlockDiagrams/>
</celldesigner:extension>
</annotation>
<listOfUnitDefinitions>
<unitDefinition metaid="substance" id="substance" name="substance">
<listOfUnits>
<unit metaid="CDMT00001" kind="mole"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="volume" id="volume" name="volume">
<listOfUnits>
<unit metaid="CDMT00002" kind="litre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="area" id="area" name="area">
<listOfUnits>
<unit metaid="CDMT00003" kind="metre" exponent="2"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="length" id="length" name="length">
<listOfUnits>
<unit metaid="CDMT00004" kind="metre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="time" id="time" name="time">
<listOfUnits>
<unit metaid="CDMT00005" kind="second"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfCompartments>
<compartment metaid="default" id="default" size="1" units="volume"/>
</listOfCompartments>
<listOfSpecies>
<species metaid="s1" id="s1" name="s1" compartment="default" initialAmount="0">
<annotation>
<celldesigner:extension>
<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment>
<celldesigner:speciesIdentity>
<celldesigner:class>COMPLEX</celldesigner:class>
<celldesigner:name>s1</celldesigner:name>
</celldesigner:speciesIdentity>
</celldesigner:extension>
</annotation>
</species>
</listOfSpecies>
</model>
</sbml>
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