Commit 0df2497d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '957-unknown-boolean-reaction-as-modifier-is-displayed-not-fully-dotted' into 'master'

Resolve "Unknown boolean reaction as modifier is displayed not fully dotted"

Closes #957

See merge request !1008
parents 038fd3b5 0e1c0623
......@@ -9,6 +9,8 @@ minerva (15.0.0~alpha.1) stable; urgency=medium
(#930)
* Bug fix: layout of the exported reactome pathways is fixed when reactome
exporter violates SBGN specification (#707)
* Bug fix: unknown catalysis boolean gate modifiers in CellDesigner are
visualized with proper line type across all included modifiers (#957)
minerva (15.0.0~alpha.0) stable; urgency=medium
* Improvement: logs provided for validation data model are structurized (#325)
......
......@@ -445,7 +445,6 @@ public class ReactionFromXml {
createLineForModifier(modifier);
}
}
if (result.isReversible()) {
for (Reactant reactant : result.getReactants()) {
reactant.getLine().getBeginAtd()
......@@ -803,6 +802,10 @@ public class ReactionFromXml {
ModifierTypeUtils modifierTypeUtils = new ModifierTypeUtils();
modifierTypeUtils.updateLineEndPoint(operator);
for (AbstractNode inputs : operator.getInputs()) {
inputs.getLine().setType(operator.getLine().getType());
}
reaction.addNode(operator);
}
......
......@@ -59,7 +59,7 @@ public class OperatorTypeUtils {
* Creates operator for the type identified by CellDesigner string.
*
* @param type
* CellDesigner string identifing operator type.
* CellDesigner string identifying operator type.
* @return empty {@link NodeOperator} of the type given in parameter
*/
public NodeOperator createModifierForStringType(String type) {
......
......@@ -71,12 +71,28 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
public void testSubstanceUnitAsType() throws Exception {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser
.createModel(new ConverterParams().filename("testFiles/problematic/substance_defined_as_type.xml").sizeAutoAdjust(false));
.createModel(new ConverterParams().filename("testFiles/problematic/substance_defined_as_type.xml")
.sizeAutoAdjust(false));
assertNotNull(model);
assertNotNull(model.getSpeciesList().get(0).getSubstanceUnits());
super.testXmlSerialization(model);
}
@Test
public void testUnknownCatalysisWithGate() throws Exception {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser
.createModel(new ConverterParams().filename("testFiles/problematic/unknown_catalysis_with_gate.xml")
.sizeAutoAdjust(false));
Reaction reaction = model.getReactionByReactionId("re1");
NodeOperator operator = reaction.getOperators().get(0);
for (Modifier modifiers : reaction.getModifiers()) {
assertEquals(operator.getLine().getType(), modifiers.getLine().getType());
}
super.testXmlSerialization(model);
}
@Test
public void testParseTransparency() throws Exception {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
......
<?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:listOfCompartmentAliases>
<celldesigner:compartmentAlias id="ca1" compartment="c1">
<celldesigner:class>SQUARE</celldesigner:class>
<celldesigner:bounds x="100.0" y="86.0" w="446.0" h="245.0"/>
<celldesigner:namePoint x="314.5" y="295.5"/>
<celldesigner:doubleLine thickness="12.0" outerWidth="2.0" innerWidth="1.0"/>
<celldesigner:paint color="ffcccc00" scheme="Color"/>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:compartmentAlias>
</celldesigner:listOfCompartmentAliases>
<celldesigner:listOfComplexSpeciesAliases/>
<celldesigner:listOfSpeciesAliases>
<celldesigner:speciesAlias id="sa1" species="s1" compartmentAlias="ca1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="171.0" y="118.0" w="80.0" h="40.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="usual"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="71.0" y="32.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:speciesAlias id="sa2" species="s2" compartmentAlias="ca1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="157.0" y="225.0" w="80.0" h="40.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="usual"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="57.0" y="139.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:speciesAlias id="sa3" species="s3" compartmentAlias="ca1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="365.0" y="116.0" w="80.0" h="40.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="usual"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="265.0" y="30.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:speciesAlias id="sa4" species="s4" compartmentAlias="ca1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="363.0" y="209.0" w="80.0" h="40.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="usual"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="263.0" y="123.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="s1" type="GENERIC"/>
<celldesigner:protein id="pr2" name="s2" type="GENERIC"/>
<celldesigner:protein id="pr3" name="s3" type="GENERIC"/>
<celldesigner:protein id="pr4" name="s4" 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="CDMT00005" kind="mole"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="volume" id="volume" name="volume">
<listOfUnits>
<unit metaid="CDMT00006" kind="litre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="area" id="area" name="area">
<listOfUnits>
<unit metaid="CDMT00007" kind="metre" exponent="2"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="length" id="length" name="length">
<listOfUnits>
<unit metaid="CDMT00008" kind="metre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="time" id="time" name="time">
<listOfUnits>
<unit metaid="CDMT00009" kind="second"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfCompartments>
<compartment metaid="default" id="default" size="1" units="volume"/>
<compartment metaid="c1" id="c1" name="c1" size="1" units="volume" outside="default">
<annotation>
<celldesigner:extension>
<celldesigner:name>c1</celldesigner:name>
</celldesigner:extension>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species metaid="s1" id="s1" name="s1" compartment="c1" initialAmount="0">
<annotation>
<celldesigner:extension>
<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr1</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
</celldesigner:extension>
</annotation>
</species>
<species metaid="s2" id="s2" name="s2" compartment="c1" initialAmount="0">
<annotation>
<celldesigner:extension>
<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr2</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
</celldesigner:extension>
</annotation>
</species>
<species metaid="s3" id="s3" name="s3" compartment="c1" initialAmount="0">
<annotation>
<celldesigner:extension>
<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr3</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
<celldesigner:listOfCatalyzedReactions>
<celldesigner:catalyzed reaction="re1"/>
</celldesigner:listOfCatalyzedReactions>
</celldesigner:extension>
</annotation>
</species>
<species metaid="s4" id="s4" name="s4" compartment="c1" initialAmount="0">
<annotation>
<celldesigner:extension>
<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr4</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
<celldesigner:listOfCatalyzedReactions>
<celldesigner:catalyzed reaction="re1"/>
</celldesigner:listOfCatalyzedReactions>
</celldesigner:extension>
</annotation>
</species>
</listOfSpecies>
<listOfReactions>
<reaction metaid="re1" id="re1" reversible="false">
<annotation>
<celldesigner:extension>
<celldesigner:reactionType>STATE_TRANSITION</celldesigner:reactionType>
<celldesigner:baseReactants>
<celldesigner:baseReactant species="s1" alias="sa1">
<celldesigner:linkAnchor position="INACTIVE"/>
</celldesigner:baseReactant>
</celldesigner:baseReactants>
<celldesigner:baseProducts>
<celldesigner:baseProduct species="s2" alias="sa2">
<celldesigner:linkAnchor position="INACTIVE"/>
</celldesigner:baseProduct>
</celldesigner:baseProducts>
<celldesigner:connectScheme connectPolicy="direct" rectangleIndex="0">
<celldesigner:listOfLineDirection>
<celldesigner:lineDirection index="0" value="unknown"/>
</celldesigner:listOfLineDirection>
</celldesigner:connectScheme>
<celldesigner:line width="1.0" color="ff000000"/>
<celldesigner:listOfModification>
<celldesigner:modification type="BOOLEAN_LOGIC_GATE_AND" modifiers="s3,s4" aliases="sa3,sa4" modificationType="UNKNOWN_CATALYSIS" targetLineIndex="-1,2" editPoints="340.3333333333333,181.66666666666666">
<celldesigner:connectScheme connectPolicy="direct">
<celldesigner:listOfLineDirection>
<celldesigner:lineDirection index="0" value="unknown"/>
</celldesigner:listOfLineDirection>
</celldesigner:connectScheme>
<celldesigner:line width="1.0" color="ff000000"/>
</celldesigner:modification>
<celldesigner:modification type="UNKNOWN_CATALYSIS" modifiers="s3" aliases="sa3" targetLineIndex="-1,0">
<celldesigner:connectScheme connectPolicy="direct">
<celldesigner:listOfLineDirection>
<celldesigner:lineDirection index="0" value="unknown"/>
</celldesigner:listOfLineDirection>
</celldesigner:connectScheme>
<celldesigner:line width="1.0" color="ff000000"/>
</celldesigner:modification>
<celldesigner:modification type="UNKNOWN_CATALYSIS" modifiers="s4" aliases="sa4" targetLineIndex="-1,0">
<celldesigner:connectScheme connectPolicy="direct">
<celldesigner:listOfLineDirection>
<celldesigner:lineDirection index="0" value="unknown"/>
</celldesigner:listOfLineDirection>
</celldesigner:connectScheme>
<celldesigner:line width="1.0" color="ff000000"/>
</celldesigner:modification>
</celldesigner:listOfModification>
</celldesigner:extension>
</annotation>
<listOfReactants>
<speciesReference metaid="CDMT00001" species="s1">
<annotation>
<celldesigner:extension>
<celldesigner:alias>sa1</celldesigner:alias>
</celldesigner:extension>
</annotation>
</speciesReference>
</listOfReactants>
<listOfProducts>
<speciesReference metaid="CDMT00002" species="s2">
<annotation>
<celldesigner:extension>
<celldesigner:alias>sa2</celldesigner:alias>
</celldesigner:extension>
</annotation>
</speciesReference>
</listOfProducts>
<listOfModifiers>
<modifierSpeciesReference metaid="CDMT00003" species="s3">
<annotation>
<celldesigner:extension>
<celldesigner:alias>sa3</celldesigner:alias>
</celldesigner:extension>
</annotation>
</modifierSpeciesReference>
<modifierSpeciesReference metaid="CDMT00004" species="s4">
<annotation>
<celldesigner:extension>
<celldesigner:alias>sa4</celldesigner:alias>
</celldesigner:extension>
</annotation>
</modifierSpeciesReference>
</listOfModifiers>
</reaction>
</listOfReactions>
</model>
</sbml>
......@@ -774,6 +774,15 @@ AddProjectDialog.prototype._fillProjectFormatSelectOptions = function (select, c
option.selected = true;
select.appendChild(option);
var converters = configuration.getModelConverters();
converters.sort(function (a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
});
for (var i = 0; i < converters.length; i++) {
var converter = converters[i];
option = Functions.createElement({
......
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